Bug 149641 - /bin/touch drops setgid privileges for no apparent reason
Summary: /bin/touch drops setgid privileges for no apparent reason
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: i686 SuSE Linux 10.0
: P5 - None : Normal
Target Milestone: SUSE Linux 10.1
Assignee: Andreas Schwab
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-09 18:09 UTC by James Faulkner
Modified: 2006-02-13 16:58 UTC (History)
1 user (show)

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Faulkner 2006-02-09 18:09:44 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.
Comment 1 Andreas Schwab 2006-02-13 16:58:43 UTC
Fixed.