[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg not changing the ownership of directories.



On 2008-06-27 10:54 +0200, Charles Plessy wrote:

> after banging my head for hours wondering why one given directory in a
> pacakge I work on did not have the correct ownership (www-data), I
> realised that that the answer is in the Policy, footnote #71.
>
>   "... the permissions and ownership of directories already on the system
>   does not change on install or upgrade of packages. This makes sense,
>   since otherwise common directories like /usr would always be in flux.
>   ..."
>
> http://www.debian.org/doc/debian-policy/footnotes.html#f71
>
> So what happened is that first I made a (local) package with the wrong
> permissions, and then any attempt to correct this was doomed as long as
> I would not remove the package before installing a new version testing a
> variation on how to call chown.
>
> After a few hours of more thinking, I still do not understand the
> footnote #71 of the Policy. Could somebody post an explanation?

If packages A and B both contain directory /foo/bar with different
permissions, then the permission of that dir on the user's system is
generally unpredictable, depending on what package is unpacked first.

This holds true regardless of whether dpkg changes the permissions or
not, but the current implementation limits the impact of broken
packages, as changing the mode of /usr/bin to 777 would totally
compromise the system, for instance.

Sven


Reply to: