https://github.com/msantos/fchmodexec-go
fchmodexec: fchmod(2) fd's before exec(3)
https://github.com/msantos/fchmodexec-go
exec fd
Last synced: 10 months ago
JSON representation
fchmodexec: fchmod(2) fd's before exec(3)
- Host: GitHub
- URL: https://github.com/msantos/fchmodexec-go
- Owner: msantos
- License: isc
- Created: 2022-12-15T11:25:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T13:03:11.000Z (almost 2 years ago)
- Last Synced: 2025-02-13T05:30:03.303Z (over 1 year ago)
- Topics: exec, fd
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SYNOPSIS
fchmodexec *mode* *fd* *...* -- *cmd* *...*
# DESCRIPTION
fchmodexec - fchmod(2) inherited file descriptors before exec(3)'ing
a command
`fchmodexec` runs as part of an exec chain to change the permissions of
any file descriptors inherited from the parent process before executing
a program.
# EXAMPLES
```
$ umask 077; ( ./fchmodexec 644 1 -- ls -al out) > out
$ cat out
-rw-r--r-- 1 msantos msantos 0 Mar 18 07:32 out
$ ls -al out
-rw-r--r-- 1 msantos msantos 48 Mar 18 07:32 out
```
# OPTIONS
None.
# BUILDING
```
go install codeberg.org/msantos/fchmodexec/cmd/fchmodexec@latest
```
To build a reproducible executable from the git repository:
```
CGO_ENABLED=0 go build -trimpath -ldflags "-w" ./cmd/fchmodexec
```
# ALTERNATIVES
- [fchmodexec](https://github.com/msantos/fchmodexec)
- [fchmodexec-rs](https://github.com/msantos/fchmodexec-rs)
# SEE ALSO
*exec(3)*, *fchmod*(2)