Questions tagged [setgid]
setgid is a bit that can be set in the filesystem. If an executable is setgid, then when that executable is run, the spawned process will have an effective group id (EGID) of the group owning the executable, instead of the group of the user running it.
41 questions
0 votes
3 answers
102 views
Keeping owners in a folder copy
I'm trying to copy a folder (SRC) containing some files and subfolders. The content and SRC itself have setgid bit enabled (that is the s in place of the x in the group triplet). Furthermore, the ...
0 votes
1 answer
829 views
Inherit ownership and permissions to directories and files
I have a directory test with the owner user:group and 770 as permissions. I want, that every directory and file within test do have the same specifications. I tried chmod g+s,u+s test, which partially ...
3 votes
2 answers
333 views
Why is /var/mail setgid?
I am learning about UNIX file permissions and I saw that on my Ubuntu system, /var/mail has the setgid bit set. Why is this? $ ls /var/mail/ -dl drwxrwsr-x 2 root mail 4096 Feb 23 05:57 /var/mail/ ...
0 votes
1 answer
274 views
Shared directory with setgid not working as expected
I have a group of developers who want to share the same directory. I created a new group with these developers and created a directory for them. On that directory, I set the group to the group I ...
1 vote
1 answer
2k views
Is appropriate to use setuid() over setresuid()/setreuid()/seteuid()?
I have an executable binary which was compiled from a C source file The executable has the setuid permission on I noticed that, if the owner of the executable is root, I can use setuid(geteuid()); ...
2 votes
1 answer
545 views
Why "permission denied" when running `less` with chmod 6110?
Assume you are user x, so running id gives uid=1001(x) gid=1001(x) groups=1001(x) And there is also a user y with uid=1002(y) gid=1002(y) groups=1002(y) Now as root we create a file readme in user's ...
2 votes
1 answer
5k views
What does "is set-group-ID on execution - ignored" mean, and why am I unable to uncompress a file because of it?
I'm trying to uncompress a file using gunzip GCF_000746645.1_ASM74664v1_genomic.fna.gz ... but I get the following error: gzip: GCF_000746645.1_ASM74664v1_genomic.fna.gz is set-group-ID on execution -...
0 votes
1 answer
834 views
How to access/set other user's environment variables after setregid() and setreuid() in C
I have a privileged C program that is executed by a standard user (say stduser) and on execution switches to a system user (say sysuser) as follows. Basically, I am trying to do something similar to ...