Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function to generate a temporary filename



> The atomicity needs to occur at the
>      generate unique temp filename
>      create the file
>      open the file
> 
> FSCreateFileAndOpenForkUnicode doesn't addess steps 1 and 2.  I
> believe it is atomic w.r.t steps 2 and 3.

Why would you require atomicity with 1 & 2? Until the file is created, there
is no opportunity for an attacker to try to snag it and fill it in. Yes,
another process could inadvertently create a file with the same name, but
that's easy enough to handle by checking error return and retrying.

-- 
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Function to generate a temporary filename (From: Byron Han <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.