From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jose Celestino Subject: Re: Question regardin deleting a file in /tmp directory Date: Fri, 28 Mar 2008 15:51:57 +0000 Message-ID: <20080328155157.GD17605@co.sapo.pt> References: <91df29a20803280823i3f259b7emb6504bd08d6461ac@mail.gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <91df29a20803280823i3f259b7emb6504bd08d6461ac@mail.gmail.com> Sender: linux-admin-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: =?iso-8859-1?Q?M=E1rio?= Gamito Cc: linux-admin@vger.kernel.org Words by M=E1rio Gamito [Fri, Mar 28, 2008 at 03:23:37PM +0000]: > Hi, >=20 > I have this PHP script (simplificated here), called delete_tmp.php > that basically calls external commands: >=20 > =20 > $session_file =3D '/tmp/sess_89765' >=20 > system(''rm -f' . ' ' . $session_file); >=20 > ?> >=20 > delete_tmp.php file is owned by gamito.users >=20 > /tmp/sess_89765 file has permissions -rw------ and is owned by gamito= =2Eusers >=20 > My /tmp permissions are rwxrwxrwt and is owned by root.root >=20 > I know that the the sticky bit only allows files to be deleted by > their owners, the owner of the directory or by root. >=20 > Never the less, i can switch to /tmp directory and delete sess_89765 > file as user gamito. >=20 > If I run: > $ php delete_tmp.php >=20 > as root, it deletes sess_89765 file. >=20 > But if I do the same has user gamito, it doesn't delete the file !!! >=20 > Ideas ? >=20 Yes, remove the -f. --=20 Jose Celestino ---------------------------------------------------------------- http://www.msversus.org/ ; http://techp.org/petition/show/1 http://www.vinc17.org/noswpat.en.html ---------------------------------------------------------------- "If you would have your slaves remain docile, teach them hymns." -- Ed Weathers ("The Empty Box") -- To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html