linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jose Celestino <japc@co.sapo.pt>
To: "Mário Gamito" <gamito@gmail.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: Question regardin deleting a file in /tmp directory
Date: Fri, 28 Mar 2008 15:51:57 +0000	[thread overview]
Message-ID: <20080328155157.GD17605@co.sapo.pt> (raw)
In-Reply-To: <91df29a20803280823i3f259b7emb6504bd08d6461ac@mail.gmail.com>

Words by Mário Gamito [Fri, Mar 28, 2008 at 03:23:37PM +0000]:
> Hi,
> 
> I have this PHP script (simplificated here), called delete_tmp.php
> that basically calls external commands:
> 
> <?php
> 
> $session_file = '/tmp/sess_89765'
> 
> system(''rm -f' . ' ' . $session_file);
> 
> ?>
> 
> delete_tmp.php file is owned by gamito.users
> 
> /tmp/sess_89765 file has permissions -rw------ and is owned by gamito.users
> 
> My /tmp permissions are rwxrwxrwt and is owned by root.root
> 
> I know that the the sticky bit only allows files to be deleted by
> their owners, the owner of the directory or by root.
> 
> Never the less, i can switch to /tmp directory and delete sess_89765
> file as user gamito.
> 
> If I run:
> $ php delete_tmp.php
> 
> as root, it deletes sess_89765 file.
> 
> But if I do the same has user gamito, it doesn't delete the file !!!
> 
> Ideas ?
> 

Yes, remove the -f.

-- 
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

  reply	other threads:[~2008-03-28 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 15:23 Question regardin deleting a file in /tmp directory Mário Gamito
2008-03-28 15:51 ` Jose Celestino [this message]
2008-03-28 17:27 ` Adam Bowen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080328155157.GD17605@co.sapo.pt \
    --to=japc@co.sapo.pt \
    --cc=gamito@gmail.com \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).