Bugzilla – Bug 149641
/bin/touch drops setgid privileges for no apparent reason
Last modified: 2006-02-13 16:58:43 UTC
On Suse Linux 10.0 (and Suse Linux 9.3), /bin/touch will drop its privileges if it is executed setgid. This causes problems when /bin/touch is executed by a setgid script, since it executes with the wrong privileges. Here's a simplified example on a fresh install of Suse Linux 10.0: gari:~ # cp /bin/touch /bin/cat /usr/local/bin/ gari:~ # echo hello > /tmp/testing gari:~ # chmod 660 /tmp/testing gari:~ # chgrp postfix /tmp/testing gari:~ # chgrp postfix /usr/local/bin/touch /usr/local/bin/cat gari:~ # chmod g+s /usr/local/bin/touch /usr/local/bin/cat gari:~ # su - tomcat tomcat@gari:~> /usr/local/bin/cat /tmp/testing hello tomcat@gari:~> /usr/local/bin/touch /tmp/testing /usr/local/bin/touch: setting times of `/tmp/testing': Permission denied tomcat@gari:~> As you can see, "touch" is mysteriously dropping its setgid privileges, even though "cat", from the same package, keeps its setgid privileges as it should. On both Gentoo Linux and Red Hat Enterprise Linux, touch will correctly keep its privileges when executing setgid. I've only had this problem on Suse Linux.
Fixed.