Your message dated Sat, 11 May 2019 20:35:07 +0000
with message-id <[email protected]>
and subject line Bug#928348: fixed in sysvinit 2.94-5
has caused the Debian Bug report #928348,
regarding initscripts use unsafe `: >` shell command to create files
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
928348: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=928348
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: initscripts
Severity: wishlist
Followup-For: Bug #923478

[ Moving discussion to separate bug ]
[ Please, drop #923478 on reply ]

[2019-04-29 02:44] Chris Hofstaedtler <[email protected]>
> part       text/plain                 517
> * Dmitry Bogatov <[email protected]> [190429 01:14]:
> > [2019-04-26 13:17] Chris Hofstaedtler <[email protected]>
> > > > According my experiments, it will. Even if I remove this code, something
> > > > (login/getty, maybe?) still creates /var/run/utmp, root:root.
> > >
> > > Which init was used in your experiments?
> > 
> > sysvinit-core.
>
> https://sources.debian.org/src/sysvinit/2.93-8/src/init.c/?hl=2797#L2797
>
> Note that the comment citing the preconditions is not telling the
> entire story on modern systems.

Thank you very much, Chris. I should have found it myself.

Then creating /var/run/utmp is needed, since "runit-init" would not
create it itself: it relies on initscripts. Based on patch of Christian,
I propose following patch. Dear sysvinit folks, opinions?

From ce3417109303bafbc771f40428579e6691a436df Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <[email protected]>
Date: Wed, 1 May 2019 23:43:13 +0000
Subject: [PATCH] Error handle redirection used to truncate /var/run/wtmp

Signed-off-by: Cristian Ionescu-Idbohrn <[email protected]>
Signed-off-by: Dmitry Bogatov <[email protected]>
---
 debian/src/initscripts/etc/init.d/bootmisc.sh | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/debian/src/initscripts/etc/init.d/bootmisc.sh 
b/debian/src/initscripts/etc/init.d/bootmisc.sh
index 06facc2f..461b7472 100755
--- a/debian/src/initscripts/etc/init.d/bootmisc.sh
+++ b/debian/src/initscripts/etc/init.d/bootmisc.sh
@@ -12,6 +12,7 @@
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
+. /lib/lsb/init-functions
 . /lib/init/vars.sh
 
 do_start () {
@@ -25,18 +26,20 @@ do_start () {
                ;;
        esac
 
-       # 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
-
        # Remove bootclean's flag files.
        # Don't run bootclean again after this!
        rm -f /tmp/.clean /run/.clean /run/lock/.clean
        rm -f /tmp/.tmpfs /run/.tmpfs /run/lock/.tmpfs
+
+       readonly utmp='/var/run/utmp'
+       if > "${utmp}" ; then
+               chmod 644  "${utmp}" || log_warning_msg "failed to chmod 
${utmp}"
+               chgrp utmp "${utmp}" || log_warning_msg "failed to chgrp 
${utmp}"
+               return 0
+       else
+               log_failure_msg "failed to truncate ${utmp}"
+               return 1
+       fi
 }
 
 case "$1" in


-- 
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

--- End Message ---
--- Begin Message ---
Source: sysvinit
Source-Version: 2.94-5

We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dmitry Bogatov <[email protected]> (supplier of updated sysvinit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 11 May 2019 20:03:26 +0000
Source: sysvinit
Architecture: source
Version: 2.94-5
Distribution: experimental
Urgency: medium
Maintainer: Debian sysvinit maintainers 
<[email protected]>
Changed-By: Dmitry Bogatov <[email protected]>
Closes: 670585 928249 928250 928348
Changes:
 sysvinit (2.94-5) experimental; urgency=medium
 .
   * Split long message into several lines to avoid terminal glitches.
     + Closes: #670585
     + Thanks: Antoni Villalonga <[email protected]>
   * Fix style in /etc/init.d/rc script (Closes: #928249)
   * Make lsb-base hard dependency of sysv-rc (Closes: #928250)
   * Error handle redirection used to truncate /var/run/wtmp
     + Closes: #928348
     + Thanks: Cristian Ionescu-Idbohrn <[email protected]>
Checksums-Sha1:
 7e84aa02013a55cca84d47ac5f2be17410dfda04 2654 sysvinit_2.94-5.dsc
 ff1002e8e8f18c4195b8e2bf710e40d37c152bac 127368 sysvinit_2.94-5.debian.tar.xz
 02cd817fd1bd610d44032dbb24a529abb3a6806c 5655 sysvinit_2.94-5_source.buildinfo
Checksums-Sha256:
 7c920a2b69fa7187bf3a07c36eb8d65b0860a335032b09911ca3809b70fa15b6 2654 
sysvinit_2.94-5.dsc
 8bd967564dfca17ab6339b3190f4b2c7d00f941f892cd31ea2d2f620d4be204c 127368 
sysvinit_2.94-5.debian.tar.xz
 f446672f6212a117245325327e3dc3b65f72614c2bb445a0d0c86facd7c5b0fd 5655 
sysvinit_2.94-5_source.buildinfo
Files:
 49ae8413d28e0ae61aa024cbd35db217 2654 admin optional sysvinit_2.94-5.dsc
 c734529caa8c925f591e93f92f2a4f05 127368 admin optional 
sysvinit_2.94-5.debian.tar.xz
 90b3694dcc088f2cd07486ed2d6d281e 5655 admin optional 
sysvinit_2.94-5_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJHBAEBCgAxFiEEhnHVzDbtdH7ktKj4SBLY3qgmEeYFAlzXKx0THGthY3Rpb25A
ZGViaWFuLm9yZwAKCRBIEtjeqCYR5rglD/9z01L97Gqo44VWF8sQnj9gm6LQUkbi
yK6esnL0HyQwJrzCLN+3sGr4pmwSnpjQLnspGoJaak5rUBMeKVQOEmRsdEnQsPXZ
rYc9VlYNTDheJhRPNJzKZyUYgONljtz5+Wa/pNy2WQTzJ7mPtvrTW+1TVudIyYGW
fWb8tB+AgfxRNTSe2enWoy/+fM2siBI4NVXd+MHbirky6t/d5Uo158DTBL0k/gwC
lvERRoNZV+sqXU2HrdRJsR1fCdxYdKuo1Z0YwDw4z9VQacwLwbQanZMkGJ7ukEjY
0Fz9amluomvzZt/UrGD0GhSGMDQ16Vvp4YZZ5pAAgrulhDhss1GlumZPONiZfrKZ
Nf211NTEr31YmWdwJeU/EkEOSjGth/EjfNHEcS7hW1vgZJKatvQXQ4/fuTUG683Y
yiaJwS6OLcxk41V4t+HIr7uzCBDncH1BzGs7dQOFfC6Mkdua1Ynbei7LFHtbfSV3
S+n34YjC+9um4elk+K7bYznjw88i8f4pjzJslO3qCav0bGkI2+jYwXVU6JuMf3jT
EvvD7ZWdJvnXVgf4b+9Nry7oiDTZ7RdYxONhYupzKXqgT7qQRmX7LPnSu1qMBag3
v4hizTXtfcu7LUSog3BtTY3EoqiTb72l06coLgstOaoUhR0BLndwpKoPrVxLjLBS
vwJ8WQieNzdcBg==
=hrnR
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to