-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 04/25/2014 04:04 PM, Wesley Hardman wrote:
> On 2014-04-25 15:26, Zack Weinberg wrote:
> 
> Shouldn't creating a file or directory, simply inherit the 
> permissions from the parent?  That is what I would expect (at
> least on Windows) when saving a file.  Why would there be a need
> to explicitly set the permissions?

That's simply not how it works on Unixy systems.  The owning UID of a
new file or directory is always set to the effective UID of the
process that created it.  The basic user/group/other permissions are
always set to the mode argument to open() or mkdir(), and-not the umask.

Under some circumstances the parent directory determines the group
ownership and the ACL, but the normal case is that the GID is also
determined by the creating process, and there is no ACL.

(It now occurs to me that if the download manager moves files to a
different directory after it finishes downloading them, we need to
reset their ACL and group ownership as well as applying the umask.  On
Unix this might be impossible, e.g. if group ownership inherits from
the directory but the current user is not a member of the directory's
group; it might be better to just create files in the ultimate target
directory if we aren't already.)

zw
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBCAAGBQJTW9F0AAoJEJH8wytnaapko+wP/jPPsn22OlRXCsb+HQOMZSE3
4aiCLUbohEHeXqSElguheQUyYOCNxGuu0z4HM4pQRWf1fPX44wEExUHj1M1X0fRb
nRXriyYMU3AjZqb6rBH0EwQjSE70+7RAFwoTK9IdiRDWjYlr114hmRRdHdbo5+xQ
2ARElVslCeiWd3Z4E6O2fOF+vAF0w09KkyMrAqOfRCYqNXbVfeQ/LJgMqpcJtenq
uiSDtYGlXQ+7FWbfgJQ5TYfsRSm8xprWymgTuW/ywwbIpSASQOnk4kzQdyw+Uz72
rxepz0ocO6FDjePEToahyPkaFX/5hd3lnQcnmDO9j3PrxXzTaeOYypQdNCEf5oBy
9ytts3nHPxgeR/bezYsaocGdI6qaePabKfF40Y8v9eLc96Kl1OFjmCBw0te9Aic0
SrCEwFzUI0Nkf33s51n+b1hANKE/Q6jX1NbFr6ot1XVQJ4Ht++q8S3FZlnBW1rQP
k3VJYJEMd9Zi4HzPGjbhh61qjpJzB7lDyVsqHnhQHZRJI4heYaTTU9NiYln4M6sH
EwvDEjAqwQbYoLozOcsz8X74f2oj5XTT00nhs37fJRShqdXIhRGFpCI2yRLfaoil
a0X2QeMUCUlYRSz798H8tMLRmDi3bidSZgrq6fpGsAaWhacVwxb+L7UoeD8jAo+0
t/jmYtOiXzbZ26Z73h0Q
=JdFz
-----END PGP SIGNATURE-----
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to