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
1 Hi,
2
3 I'm trying to touch a file in /sbin during boot time
4 and would like to do that with a normal user by running
5 SUIDed shell script.
6 I have following script:
7 hinkok@alala /tmp $ cat test.sh
8 #!/bin/sh
9
10 touch /sbin/foo.bar
11 exit $?
12
13 hinkok@alala /tmp $ sudo chmod +x test.sh
14 hinkok@alala /tmp $ sudo chown root:root test.sh
15 hinkok@alala /tmp $ sudo chmod +s test.sh
16 hinkok@alala /tmp $ ls -l test.sh
17 -rwsr-sr-x 1 root root 32 Mar 2 09:27 test.sh
18 hinkok@alala /tmp $ sh -x test.sh
19 + touch /sbin/foo.bar
20 touch: cannot touch `/sbin/foo.bar': Permission denied
21
22 Can somebody help me with that?
23
24 Thank you!
25
26 Best regards,
27 Hinko
28 --
29 Hinko Koèevar, OSS developer
30 ÈETRTA POT, d.o.o.
31 Planina 3, 4000 Kranj, SI EU
32 tel ++386 (0) 4 280 66 03
33 e-mail hinko.kocevar@×××××××××.si
34 http www.cetrtapot.si

Replies

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