Re: on the use of chmod/chown in maintainer scripts
Charles Plessy <plessy@debian.org> writes:
> in some of my packages, I give the ownership on some directories in /var
> to www-data without checking that the www-data group exists, but I guess
> it is acceptable because it is globally allocated by base-passwd.
Right.
> Dpkg will not update permissions or ownership, but when creating the
> directory it will apply the ones in the 'data' tar archive. So if there
> was no package released with wrong settings, I assume this is safe. Or
> am I simply relying on something undocumented and unwaranteed ?
No, this is fine. But it only works for globally-allocated IDs in
base-passwd. If you instead need to dynamically generate a system user on
the fly and then set ownership of files to that user, which is a
reasonably common case, this is more complex.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: