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

On 04/26/2014 12:17 PM, Dave Hylands wrote:
>> The basic user/group/other permissions are always set to the
>> mode argument to open() or mkdir(), and-not the umask.
> The permissions used by open are affected by umask. If you use 
> open/creat to create a file with 0777 permisions and umask is 022 
> then you will get a 0755 file. See:
> http://linux.die.net/man/2/open and search for umask

I am aware of this. I see now that "the mode argument and-not the umask"
reads like "the umask is irrelevant", but what I actually meant was
"the permissions are set to mode & ~umask".

>> (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.
> 
> The umask would have already been applied when the file was
> created.

Well, the entire point of bug 961080 is that files are being created
mode (0600 & ~umask) rather than (0666 & ~umask) as is more typical,
and that it's not safe to just switch to open(,, 0666), we have to
chmod it later.

> If you copied the file, then it would get assigned the correct
> group. Being the owner of a directory but not a member of the group
> seems unusual.

Consider a directory like this (numeric mode 3777):

drwxrwsrwt 25 root root 4096 Apr 20 12:54 test.d

Anyone can create files in this directory, and the group of files so
created is forced to group 'root', *even if* they are not themselves
members of that group.

Similar, and rather more plausibly relevant to downloads, scenarios
can be constructed with directory default ACLs.

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

iQIcBAEBCAAGBQJTXATaAAoJEJH8wytnaapkhqEP/2/IDDB0cmowE65tg1helk8W
j3PC8j1iOPefT96n6HYZtj/o1jcakBbmO3QKSzE8BsHEV39N9R2qJwwupmiUdVFP
9Al9gSaYWmX0Cc9SPtIyrVdAn54WwudaF7CTkMIKpzywd793YfHE3nQW4PJNf6Hb
c7gNLJytHA2+2hCamkqRfdyTV4mO1LaUrk8N1c/GcQNkkRJDiaw042LB3NOWFwJw
dodMq/ByvjwJUi9ltJheGfwT+pMG8egK8g/zDes66n16XAwpXeqbiZlvwy1oDU0I
pVHPfW6pFZtST2nT5Fj429WWCYyXC+kBN5yAhPwKQdWQeHJpok3c81Hg27Wy1Kkf
YqHJ73Zkj4WWrMUQUVpmAxN+eq40OtNrh3+fEtMIuGewVCwuDxtGZWhcvsmTQUuH
gA026kfY5euiILq2lda2Gw3dp8ZGkXhXuZWv3aoB4954TY/8SK6IUkt/7vhke6Tn
ZKnFNxWIi+d3dWLesZgIOtAKczdPIhfdyURCeVEx+XHdZEIJllXIqRkp01cFNrUG
rY/omKFU7PHM2qGP7HOseGO/aXsy3MqOb/YWTeq8MeEVcHRouge373RCfBRl9MtP
o8cYh4eKgIHVfZjzVJzq1S/ckZy8LciiOtTFaHItz1Lh6Sj+KM3WStAv1IXEnpHQ
4pc5aNQZLSrXDFWR7h7J
=s/jl
-----END PGP SIGNATURE-----
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to