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

Re: Bug#34408: samba: sambaconfig hoses inetd.conf if interrupted at first prompt (fwd)



> Is this request reasonable? Should a postinst script be made bullet
> proof against a user hitting Control-C in the middle of its execution?
> This will complicate the postinst script a lot.

Absolutely: you should ideally only touch any system config files
(such as /etc/inetd.conf) when you know exactly what you are going to
write to them, and even then, you should always modify a *copy* of
them and when the modification is completed, copy the new version over
the old one.  You might also consider leaving a copy of the old
version on the system ("Original /etc/inetd.conf saved as
/etc/inetd.conf.orig").

I don't know how many of these you already implement; I haven't read
your postinst.  But coding to cause the least possible damage, and
revocable damage if it does occur, is always a good move.

Finally, you might also want to check that your postinst (a) only
plays around with /etc/inetd.conf when it should, perhaps only when
called with a "configure" parameter, and (b) that it is idempotent:
running it twice should not cause havoc.

   Julian

> ----- Forwarded message from ben@bgpc.dymaxion.ca -----
> 
> Subject: Bug#34408: samba: sambaconfig hoses inetd.conf if
>  interrupted at first prompt
> 
> Package: samba
> Version: 1.9.18p10-7
> 
> If sambaconfig is run, but then interrupted at the first prompt, it
> has already disabled netbios-* in /etc/inetd.conf and shutdown samba
> in preparation for the next step.  Unfortunately, this means that if
> you ^C to interrupt the script, your inetd.conf is hosed.  I think
> sambaconfig should be a bit more robust, only committing changes to
> inetd.conf *after* all dialog from the user has been accepted, and
> possibly also disabling ^C when it does the actual modifications to
> inetd.conf.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
             Debian GNU/Linux Developer.  jdg@debian.org
       -*- Finger jdg@master.debian.org for my PGP public key. -*-


Reply to: