Gentoo Archives: gentoo-user

From: Hinko Kocevar <hinko.kocevar@×××××××××.si>
To: gentoo-user@l.g.o
Subject: [gentoo-user] SUID
Date: Mon, 02 Mar 2009 08:31:37
Message-Id: 49AB9907.1040509@cetrtapot.si
Hi,

I'm trying to touch a file in /sbin during boot time
and would like to do that with a normal user by running
SUIDed shell script.
I have following script:
hinkok@alala /tmp $ cat test.sh 
#!/bin/sh

touch /sbin/foo.bar
exit $?

hinkok@alala /tmp $ sudo chmod +x test.sh 
hinkok@alala /tmp $ sudo chown root:root test.sh 
hinkok@alala /tmp $ sudo chmod +s test.sh 
hinkok@alala /tmp $ ls -l test.sh 
-rwsr-sr-x 1 root root 32 Mar  2 09:27 test.sh
hinkok@alala /tmp $ sh -x test.sh 
+ touch /sbin/foo.bar
touch: cannot touch `/sbin/foo.bar': Permission denied

Can somebody help me with that?

Thank you!

Best regards,
Hinko
-- 
Hinko Koèevar, OSS developer
ÈETRTA POT, d.o.o.
Planina 3, 4000 Kranj, SI EU
tel     ++386 (0) 4 280 66 03
e-mail  hinko.kocevar@×××××××××.si
http    www.cetrtapot.si

Replies

Subject Author
Re: [gentoo-user] SUID "Tomáš Krasničan" <krasko@××××××.sk>
[gentoo-user] Re: SUID ABCD <en.ABCD@×××××.com>