I think I found a bug with chmod, but I could just be misinformed...<br><br>It looks like the numerical permission syntax for setuid/setgid can only be unset with the alphabetical syntax on directories.<br><br>755 permission set on at directory<br>
# ls -lad at<br>drwxr-xr-x 2 root root 4096 Mar 24 11:35 at<br><br>add setgid<br># chmod 2755 at<br># ls -lad at<br>drwxr-sr-x 2 root root 4096 Mar 24 11:35 at<br><br>attempt to remove setgid<br># chmod 0755 at<br># ls -lad at<br>
drwxr-sr-x 2 root root 4096 Mar 24 11:35 at<br>didnt work<br><br>another attempt to remove setgid<br># chmod 755 at<br># ls -lad at<br>drwxr-sr-x 2 root root 4096 Mar 24 11:35 at<br>also didn't work<br><br>and one more<br>
# chmod g-s at<br># ls -lad at<br>drwxr-xr-x 2 root root 4096 Mar 24 11:35 at<br>success<br><br>This doesn't appear to affect files only directories.<br><br><br>--kyleo<br>