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:
hin...@alala /tmp $ cat test.sh 
#!/bin/sh

touch /sbin/foo.bar
exit $?

hin...@alala /tmp $ sudo chmod +x test.sh 
hin...@alala /tmp $ sudo chown root:root test.sh 
hin...@alala /tmp $ sudo chmod +s test.sh 
hin...@alala /tmp $ ls -l test.sh 
-rwsr-sr-x 1 root root 32 Mar  2 09:27 test.sh
hin...@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.koce...@cetrtapot.si
http    www.cetrtapot.si


Reply via email to