Earlier quoted context omitted.
[dozzie@zorn /srv]$ ls -ld foo drwxrwxrwx 2 root wheel uarch 2 Nov 21 12:57 foo/ [dozzie@zorn /srv]$ touch foo/nabla [dozzie@zorn /srv]$ ls -l foo/nabla -rw-r--r-- 1 dozzie wheel uarch 0 Nov 21 12:58 foo/nabla [dozzie@zorn /srv]$ id uid=1001(dozzie) gid=1001(dozzie) groups=1001(dozzie) [dozzie@zorn /srv]$ uname -s -r FreeBSD 11.0-RELEASE-p1 This is called "BSD semantics". You can get the same behaviour with appropria…
While it’s nice to have it as default behavior when it makes sense, it’s also nice to have setgid as an option rather than the rule.
How do groups work on Linux?
11–20 of 68 posts
Re: How do groups work on Linux?
#12Re: How do groups work on Linux?
#13Ohh, so THAT's why I have to log out and back in to have my group changes take effect. That, along with having to start a new shell to pick up new env vars from ~/.profile, are my two biggest annoyances with the Linux process model. Reminds me a bit of the Windows 98 days when you had to restart to change your IP address. I really wish someone would sit down and figure out how to propagate group and environment chang…
Re: How do groups work on Linux?
#14Earlier quoted context omitted.
What filesystem was that? And why is this behavior filesystem-specific?
Not what filesystem , it's what OS . FreeBSD. And ZFS, but UFS works the same.
Re: How do groups work on Linux?
#15Ohh, so THAT's why I have to log out and back in to have my group changes take effect. That, along with having to start a new shell to pick up new env vars from ~/.profile, are my two biggest annoyances with the Linux process model. Reminds me a bit of the Windows 98 days when you had to restart to change your IP address. I really wish someone would sit down and figure out how to propagate group and environment chang…
Re: How do groups work on Linux?
#16Also "newgrp" can be used for join "new" groups without re-login.
Re: How do groups work on Linux?
#17I absolutely love Julia Evan's writing. I find her articles / zines to cover interesting and useful technical topics while remaining _extremely_ accessible to me (especially when I was a student)! I really admire her ability to present technical topics in plain language.
Re: How do groups work on Linux?
#18Earlier quoted context omitted.
While it’s nice to have it as default behavior when it makes sense, it’s also nice to have setgid as an option rather than the rule.
Nice or not, you can't talk about directory's SGID behaviour as it was unversal truth, because it's Linux-specific, and even then it's something that can be changed.
[lau@primus ~/test]$ mkdir setgid nosetgid
[root@primus /home/lau/test]# chmod g+s setgid
[root@primus /home/lau/test]# chgrp lau setgid
[lau@primus ~/test]$ ls -l
total 1
drwxr-xr-x 2 lau users 4 21 Nov 14:52 nosetgid
drwxr-sr-x 2 lau lau 4 21 Nov 14:51 setgid
[lau@primus ~/test]$ touch {nosetgid,setgid}/test
[lau@primus ~/test]$ ls -l *
nosetgid:
total 1
-rw-r--r-- 1 lau users 0 21 Nov 14:52 test
setgid:
total 1
-rw-r--r-- 1 lau lau 0 21 Nov 14:51 test
Looking at your example, I'd guess you didn't set the setgid bit as your `ls` doesn't show the group column to be `S` (instead stating `X` which is the default a directory would be set as).OS build and file system:
[lau@primus ~/test]$ uname -a
FreeBSD primus 10.3-RELEASE-p11 FreeBSD 10.3-RELEASE-p11 #0: Mon Oct 24 18:49:24 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
[lau@primus ~/test]$ mount | grep " / "
zroot2 on / (zfs, local, nfsv4acls)Re: How do groups work on Linux?
#19Earlier quoted context omitted.
Nice or not, you can't talk about directory's SGID behaviour as it was unversal truth, because it's Linux-specific, and even then it's something that can be changed.
Except it does work FreeBSD: [lau@primus ~/test]$ mkdir setgid nosetgid [root@primus /home/lau/test]# chmod g+s setgid [root@primus /home/lau/test]# chgrp lau setgid [lau@primus ~/test]$ ls -l total 1 drwxr-xr-x 2 lau users 4 21 Nov 14:52 nosetgid drwxr-sr-x 2 lau lau 4 21 Nov 14:51 setgid [lau@primus ~/test]$ touch {nosetgid,setgid}/test [lau@primus ~/test]$ ls -l * nosetgid: total 1 -rw-r--r-- 1 lau users 0 21 Nov…
Congratulations, you have an incomplete example.
And what exactly did you want to prove? That an OS-specific behaviour can be exhibited by more than one OS?