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

Re: CHowning files - or not?



On Fri, Feb 26, 2010 at 3:40 PM, Dominik George <dev@naturalnik.de> wrote:

> The preinst script creates a system user, and this is the user the scripts
> should be owned by (they will be called from a somewhat more complicated
> environment, for now, it's easier if you trust me that this is the way it
> has to be ;)).

Why is the user creation in preinst, that doesn't strike me as the
right place for it. As you can see here the scripts will not even be
unpacked from the .deb yet in preinst:

http://women.debian.org/wiki/English/MaintainerScripts

I do wonder why some scripts have to be owned by a particular user
instead of root, could you explain this?

> - Do a lot of chown in postinst
>
> The problem with the first is that it is run at build time, not at the
> "real" install time, an files in the Debian package will probably be
> fakeroot'ed (or something else that spoild my whol uid/gid stuff). The
> latter one doesn't really fit in with Debian Policy Manual - or if it does,
> the better this is ;). But it still looks "unclean" ...
>
> Can someone provide me with a somewhat comprehensive approach to this?

Please read debian-policy 10.9 and 10.9.1:

http://www.debian.org/doc/debian-policy/ch-files.html#s10.9

In short, use dpkg-statoverride in postinst.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise


Reply to: