[Pkg-shadow-devel] Bug#923478: initscripts use unsafe `: >` shell command to create files

Dmitry Bogatov KAction at debian.org
Thu Apr 25 15:12:36 BST 2019


[2019-04-22 09:18] "Serge E. Hallyn" <serge at hallyn.com>
> > [ Dmitry Bogatov ]
> > Dear login maintainers, currently we have following core executed during
> > boot:
> > 
> > 	# Create /var/run/utmp so we can login.
> > 	true > /var/run/utmp
> > 	if grep -q ^utmp: /etc/group
> > 	then
> > 		chmod 664 /var/run/utmp
> > 		chgrp utmp /var/run/utmp
> > 	fi
> > 
> > It seems that system boots and works just fine without it. Are there any
> > subtle reasons to keep creating /var/run/utmp in initscripts?
>
> Is the above pseudocode?  If not, where is that code precisely?

It is from /etc/init.d/bootmisc.sh from initscripts=2.94-3, lines 28-34.

> Near as I can tell, if you do not create it, it will never exist,
> and pututent entries will not be saved.

According my experiments, it will. Even if I remove this code, something
(login/getty, maybe?) still creates /var/run/utmp, root:root.

Thus I am asking your advice, whether it is safe to not create
/var/run/utmp in initscripts.
-- 
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --



More information about the Pkg-shadow-devel mailing list