But this is a behavior change from RHEL5:
[root@svvadm01 tmp]# cat /etc/redhat-release
Red Hat Enterprise Linux Client release 5.4 (Tikanga)
[root@svvadm01 tmp]# mkdir foo
[root@svvadm01 tmp]# ls -lad foo
drwxr-xr-x 2 root root 4096 Mar 24 10:31 foo
[root@svvadm01 tmp]# chmod 2755 foo
[root@svvadm01 tmp]# ls -lad foo
drwxr-sr-x 2 root root 4096 Mar 24 10:31 foo
[root@svvadm01 tmp]# chmod 0755 foo
[root@svvadm01 tmp]# ls -lad foo
drwxr-xr-x 2 root root 4096 Mar 24 10:31 foo
And I don't know of a good reason for the behavior change.
Paul Krizak 7171 Southwest Pkwy MS B200.3A
MTS Systems Engineer Austin, TX 78735
Advanced Micro Devices Desk: (512) 602-8775
Linux/Unix Systems Engineering Cell: (512) 791-0686
Global IT Infrastructure Fax: (512) 602-0468
On 03/24/2011 10:27 AM, Kinzel, David wrote:
Man pages says as much:
chmod preserves a directory's set-user-ID and set-group-ID bits
unless you explicitly specify other-
wise. You can set or clear the bits with symbolic modes like
u+s and g-s, and you can set (but not
clear) the bits with a numeric mode.
From: [email protected]
[mailto:[email protected]] On Behalf Of Kyle O'Donnell
Sent: Thursday, March 24, 2011 11:11 AM
To: [email protected]
Subject: [rhelv6-list] found a chmod bug in rhel 6.0
I think I found a bug with chmod, but I could just be
misinformed...
It looks like the numerical permission syntax for setuid/setgid
can only be unset with the alphabetical syntax on directories.
755 permission set on at directory
# ls -lad at
drwxr-xr-x 2 root root 4096 Mar 24 11:35 at
add setgid
# chmod 2755 at
# ls -lad at
drwxr-sr-x 2 root root 4096 Mar 24 11:35 at
attempt to remove setgid
# chmod 0755 at
# ls -lad at
drwxr-sr-x 2 root root 4096 Mar 24 11:35 at
didnt work
another attempt to remove setgid
# chmod 755 at
# ls -lad at
drwxr-sr-x 2 root root 4096 Mar 24 11:35 at
also didn't work
and one more
# chmod g-s at
# ls -lad at
drwxr-xr-x 2 root root 4096 Mar 24 11:35 at
success
This doesn't appear to affect files only directories.
--kyleo
This email communication and any files transmitted with it may contain
confidential and or proprietary information and is provided for the use of the
intended recipient only. Any review, retransmission or dissemination of this
information by anyone other than the intended recipient is prohibited. If you
receive this email in error, please contact the sender and delete this
communication and any copies immediately. Thank you.
http://www.encana.com
_______________________________________________
rhelv6-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv6-list
_______________________________________________
rhelv6-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv6-list