Bug#923478: initscripts use unsafe `: >` shell command to create files

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Mon Apr 8 19:20:20 BST 2019


On Mon, 8 Apr 2019, Dmitry Bogatov wrote:
> [2019-04-07 10:52] Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn at axis.com>
> > On Sat, 6 Apr 2019, Dmitry Bogatov wrote:
> >
> > The redirection in /etc/init.d/bootmisc.sh on line 29 is _not_ error 
> > handled.  Writing to a file can fail (for various reasons).
> >
> > OTOH, the redirection in /lib/init/bootclean.sh on line 22 _is_ error 
> > handled.
> 
> Good catch. Mind to send a patch into a separate bug?

Sure.  So, what do you want it to do when truncating /var/run/utmp 
fails?

     29         : > /var/run/utmp
     30         if grep -q ^utmp: /etc/group
     31         then
     32                 chmod 664 /var/run/utmp
     33                 chgrp utmp /var/run/utmp
     34         fi


Cheers,

-- 
Cristian




More information about the Debian-init-diversity mailing list