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

Re: dhcp3-server postinst

On Sat, Jul 27, 2002 at 04:01:02PM +0200, Wichert Akkerman wrote:
> Previously Russell Coker wrote:
> > In the postinst you create a temporary file under /tmp and then move it to 
> > /etc/default. However on SE Linux that results in the file being in the type 
> > tmp_dpkg_t because it was created by the postinst script (running as dpkg_t) 
> > in the /tmp directory.  The tmp_dpkg_t type is not allowed to be read by the 
> > system init scripts (so dhcp3 server can't start).
> Would it make sense to create a list of all such issues that package
> might want to take into account and submit that to debian-policy?

So far the only one seems to be:

Don't rename /tmp/* file to final directory, instead create temp file in
final directory. This is not just for maintainer scripts, but for normal
program usage to. Even better, copy the new file "into" the old one,
so existing inode, permissions, types, etc are preserved if the file
already exists. That way, creating a temp file in /tmp is OK, but you
miss out on atomic updates of the file.

I am not sure if this will always work with all packages.

Some files will require a different label under /etc depending on
the package installing it, for instance.

Fixing this may require changes to dpkg. I have some very very rough
ideas on how this could possible happen, but nothing really concrete
(eg. run maintainer scripts in seperate domain for every package), and I
don't really have time to think about these issues at the moment either.
Brian May <bam@debian.org>

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: