From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Le3lf-0000cI-PC for garchives@archives.gentoo.org; Mon, 02 Mar 2009 08:44:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7A671E0338; Mon, 2 Mar 2009 08:44:53 +0000 (UTC) Received: from krasko.eu (unknown [208.86.225.83]) by pigeon.gentoo.org (Postfix) with ESMTP id 5E15AE0338 for ; Mon, 2 Mar 2009 08:44:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by krasko.eu (Postfix) with ESMTP id EC21722DBB for ; Mon, 2 Mar 2009 09:44:52 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.krasko.eu X-Spam-Flag: NO X-Spam-Score: -1.135 X-Spam-Level: X-Spam-Status: No, score=-1.135 required=7 tests=[ALL_TRUSTED=-1.44, AWL=0.228, TW_RW=0.077] Received: from krasko.eu ([127.0.0.1]) by localhost (mail.krasko.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WpywpTsNiHL8 for ; Mon, 2 Mar 2009 09:44:36 +0100 (CET) Received: from [192.168.111.6] (chlievik.krasko.sk [81.91.85.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: krasko@krasko.sk) by krasko.eu (Postfix) with ESMTPSA id 0676322DB9 for ; Mon, 2 Mar 2009 09:44:35 +0100 (CET) Message-ID: <49AB9C27.10009@krasko.sk> Date: Mon, 02 Mar 2009 09:43:19 +0100 From: =?ISO-8859-2?Q?Tom=E1=B9_Krasni=E8an?= User-Agent: Icedove 1.5.0.14eol (X11/20090105) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] SUID References: <49AB9907.1040509@cetrtapot.si> In-Reply-To: <49AB9907.1040509@cetrtapot.si> Content-Type: multipart/mixed; boundary="------------080800030100000001050108" X-Archives-Salt: f3dfd450-fb2d-42fc-a1f2-70de7a39ac36 X-Archives-Hash: a198fe4a839453cf99d9c48e13648e9c This is a multi-part message in MIME format. --------------080800030100000001050108 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Hi, #! scripts can not run as suid. Regards, krasko Hinko Kocevar wrote: > 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 --------------080800030100000001050108 Content-Type: text/x-vcard; charset=utf-8; name="krasko.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="krasko.vcf" begin:vcard fn;quoted-printable:Tom=C3=A1=C5=A1 Krasni=C4=8Dan n;quoted-printable;quoted-printable:Krasni=C4=8Dan;Tom=C3=A1=C5=A1 email;internet:krasko@krasko.sk tel;cell:+420 605 520 368 x-mozilla-html:FALSE version:2.1 end:vcard --------------080800030100000001050108--