• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: which temp dir to use?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: which temp dir to use?


  • Subject: Re: which temp dir to use?
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 24 May 2009 15:34:39 -0700

On Sun, May 24, 2009 at 3:18 PM, Michael Ash <email@hidden> wrote:
> /tmp has a special permissions bit set called the sticky bit. When set
> on directories, the sticky bit modifies the standard UNIX permissions
> model and makes it so that the directory's contents can only be
> deleted or renamed by the owner of the item in question, of the
> directory, or root. In other words, if I write to /tmp/xyz and then
> you try to rm /tmp/xyz, your attempt will fail. Give it a try and see.

Believe it or not, I did before I replied to the thread.  Except this
is what I did:

# cd /tmp
# touch foo
# sudo -s
# su nobody
# rm foo

However, that wasn't what actually happened.  Had I bothered to run
`whoami`, I would have seen this:

# cd /tmp
# touch foo
# whoami
kyle
# sudo -s
# whoami
root
# su nobody
# whoami
root
# rm foo

What I failed to realize is that su will by default execute the user's
specified shell (which is /usr/bin/false for nobody).  You have to
provide -m to override this behavior, and if you do that, it fails.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >which temp dir to use? (From: Nick Rogers <email@hidden>)
 >Re: which temp dir to use? (From: Richard Frith-Macdonald <email@hidden>)
 >Re: which temp dir to use? (From: Dave Keck <email@hidden>)
 >Re: which temp dir to use? (From: Kyle Sluder <email@hidden>)
 >Re: which temp dir to use? (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: dot notation doesn’t work as expected for some library classes
  • Next by Date: Properly scaling a vector image with CG
  • Previous by thread: Re: which temp dir to use?
  • Next by thread: Re: which temp dir to use?
  • Index(es):
    • Date
    • Thread