Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Dear Release Team, https://bugs.debian.org/856824 (which I already fixed in experimental a while ago) seems to be more severe than I initially thought. If unfixed, it can lead to a race condition at boot time when running with systemd as init system. See Marc's explanations at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856824#24 So I would upload screen/4.5.0-5 with the same fix as already applied in experimental (and with no issues or bug reports there so far) to unstable, too, if you're ok with it. I've prepared the upload in the "stretch" branch at https://anonscm.debian.org/cgit/collab-maint/screen.git/log/?h=stretch The diff as currently committed to git (still at UNRELEASED on purpose) is following, git I recommend to checkout the git repository and run the following command instead: git show 360c7cbfbe4dd7f2dac029b371da973731e4c2ad --color-words=. It makes clear that all of the commit is only removing the string "var/" over and over again. Nevertheless here's the classic diff for the change: diff --git a/debian/NEWS b/debian/NEWS index bac905c..7bef72a 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,6 +1,6 @@ screen (4.1.0~20120320gitdb59704-10) unstable; urgency=medium - On systems running systemd, the management of /var/run/screen previously + On systems running systemd, the management of /run/screen previously handled by /etc/init.d/screen-cleanup now occurs via systemd-tmpfiles and /usr/lib/tmpfiles.d/screen-cleanup.conf. The installed version of that file works for systems with the default screen permissions; if you override diff --git a/debian/README.Debian b/debian/README.Debian index d8160da..0ad2f44 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -7,23 +7,23 @@ and other assorted information. Debian Modifications -------------------- * added Debian package maintenance files - * Use /var/run/screen as socket directory + * Use /run/screen as socket directory * Make it set-gid "utmp" instead of setuid root Debian Screen Q&A ----------------- -Q: screen always complains about the permissions of /var/run/screen. +Q: screen always complains about the permissions of /run/screen. What's wrong? A: Simplified, the binary ensures that $SCREENDIR has just enough permission bits enabled so that each user can create and access his socket directory. This means: - /usr/bin/screen setuid root -> /var/run/screen 0755 - /usr/bin/screen setgid utmp -> /var/run/screen 0775 - /usr/bin/screen without setid bits -> /var/run/screen 0777 + /usr/bin/screen setuid root -> /run/screen 0755 + /usr/bin/screen setgid utmp -> /run/screen 0775 + /usr/bin/screen without setid bits -> /run/screen 0777 These cases are all handled by the init script or by the tmpfiles.d configuration documented later in this file. However, the actual test is a @@ -108,11 +108,11 @@ A: Screen has to be setuid root to accomplish this. (Note the security implicati the feature, you may do so with the following commands: ] dpkg-statoverride --update --add root utmp 4755 /usr/bin/screen -] chmod 0755 /var/run/screen -] echo 'd /var/run/screen 0755 root utmp' > /etc/tmpfiles.d/screen-cleanup.conf +] chmod 0755 /run/screen +] echo 'd /run/screen 0755 root utmp' > /etc/tmpfiles.d/screen-cleanup.conf dpkg-statoverride will make sure that the modified permissions remain in effect - even if a new version of the screen package is installed. /var/run/screen will + even if a new version of the screen package is installed. /run/screen will be automatically recreated with the proper permissions if the directory lives on volatile storage (doesn't persist between subsequent reboots). @@ -122,8 +122,8 @@ Q: I don't want screen to be setuid *or* setgid - how do I disable that? A: As above, via dpkg-statoverride: ] dpkg-statoverride --update --add root utmp 0755 /usr/bin/screen -] chmod 1777 /var/run/screen -] echo 'd /var/run/screen 1777 root utmp' > /etc/tmpfiles.d/screen-cleanup.conf +] chmod 1777 /run/screen +] echo 'd /run/screen 1777 root utmp' > /etc/tmpfiles.d/screen-cleanup.conf Q: I've configured screen with different permissions, but I want to go back to @@ -132,7 +132,7 @@ Q: I've configured screen with different permissions, but I want to go back to A: ] dpkg-statoverride --remove /usr/bin/screen -] chmod 0775 /var/run/screen +] chmod 0775 /run/screen ] rm /etc/tmpfiles.d/screen-cleanup.conf - -- Axel Beckert <a...@debian.org>, Tue, 16 Jun 2015 23:27:03 +0200 + -- Axel Beckert <a...@debian.org>, Sun, 5 Mar 2017 17:23:27 +0100 diff --git a/debian/changelog b/debian/changelog index 36227ce..4b87a32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +screen (4.5.0-5) UNRELEASED; urgency=low + + * Replace all occurrences of /var/run/ in packaging with /run/. (Closes: + #856824) + + -- Axel Beckert <a...@debian.org> Mon, 03 Apr 2017 01:12:34 +0200 + screen (4.5.0-4) unstable; urgency=low * Add CVE-ID to previous changelog entry and diff --git a/debian/patches/11replace_doc_paths.patch b/debian/patches/11replace_doc_paths.patch index 57917cc..9b53da9 100644 --- a/debian/patches/11replace_doc_paths.patch +++ b/debian/patches/11replace_doc_paths.patch @@ -9,7 +9,7 @@ Forwarded: not-needed forked from the parent screen process, not from the invoking shell. .PP -If \*Q/etc/utmp\*U is writable by -+If \*Q/var/run/utmp\*U is writable by ++If \*Q/run/utmp\*U is writable by .IR screen , an appropriate record will be written to this file for each window, and removed when the window is terminated. @@ -18,7 +18,7 @@ Forwarded: not-needed .TP 5 .BR \-l " and " \-ln -turns login mode on or off (for /etc/utmp updating). -+turns login mode on or off (for /var/run/utmp updating). ++turns login mode on or off (for /run/utmp updating). This can also be defined through the \*Qdeflogin\*U .screenrc command. .TP 5 .BR \-ls " [" \fImatch ] @@ -27,7 +27,7 @@ Forwarded: not-needed .SH CUSTOMIZATION The \*Qsocket directory\*U defaults either to $HOME/.screen or simply to -/tmp/screens or preferably to /usr/local/screens chosen at compile-time. If -+/tmp/screens or preferably to /var/run/screen chosen at compile-time. If ++/tmp/screens or preferably to /run/screen chosen at compile-time. If .I screen is installed setuid-root, then the administrator should compile @@ -63,7 +63,7 @@ Forwarded: not-needed +Read in after /etc/screenrc .IP $SCREENDIR/S\-<login> -.IP /local/screens/S\-<login> -+.IP /var/run/screen/S\-<login> ++.IP /run/screen/S\-<login> Socket directories (default) .IP /usr/tmp/screens/S\-<login> Alternate socket directories. @@ -72,7 +72,7 @@ Forwarded: not-needed .IP /etc/termcap Terminal capability databases -.IP /etc/utmp -+.IP /var/run/utmp ++.IP /run/utmp Login records .IP $LOCKPRG Program that locks a terminal. @@ -81,10 +81,10 @@ Forwarded: not-needed to be able to correctly change the owner of the tty device file for each window. -Special permission may also be required to write the file \*Q/etc/utmp\*U. -+Special permission may also be required to write the file \*Q/var/run/utmp\*U. ++Special permission may also be required to write the file \*Q/run/utmp\*U. .IP \(bu -Entries in \*Q/etc/utmp\*U are not removed when -+Entries in \*Q/var/run/utmp\*U are not removed when ++Entries in \*Q/run/utmp\*U are not removed when .I screen is killed with SIGKILL. This will cause some programs (like "w" or "rwho") @@ -95,7 +95,7 @@ Forwarded: not-needed forked from the parent screen process, not from the invoking shell. -If @file{/etc/utmp} is writable by @code{screen}, an appropriate record -+If @file{/var/run/utmp} is writable by @code{screen}, an appropriate record ++If @file{/run/utmp} is writable by @code{screen}, an appropriate record will be written to this file for each window, and removed when the window is closed. This is useful for working with @code{talk}, @code{script}, @code{shutdown}, @code{rsend}, @code{sccs} and other @@ -104,7 +104,7 @@ Forwarded: not-needed @item -l @itemx -ln -Turn login mode on or off (for @file{/etc/utmp} updating). This option -+Turn login mode on or off (for @file{/var/run/utmp} updating). This option ++Turn login mode on or off (for @file{/run/utmp} updating). This option is equivalent to the @code{deflogin} command (@pxref{Login}). @item -ls [@var{match}] @@ -122,7 +122,7 @@ Forwarded: not-needed Place where to collect logfiles. @xref{Log}. @item login [@var{state}] -Log the window in @file{/etc/utmp}. @xref{Login}. -+Log the window in @file{/var/run/utmp}. @xref{Login}. ++Log the window in @file{/run/utmp}. @xref{Login}. @item logtstamp [@var{state}] Configure logfile time-stamps. @xref{Log}. @item mapdefault @@ -131,7 +131,7 @@ Forwarded: not-needed * Console:: See the host's console messages * Kill:: Destroy an unwanted window -* Login:: Control @file{/etc/utmp} logging -+* Login:: Control @file{/var/run/utmp} logging ++* Login:: Control @file{/run/utmp} logging * Mode:: Control the file mode of the pty * Monitor:: Watch for activity or inactivity in a window * Windows:: List the active windows @@ -140,7 +140,7 @@ Forwarded: not-needed @deffn Command login [state] (@kbd{C-a L})@* -Adds or removes the entry in @file{/etc/utmp} for the current window. -+Adds or removes the entry in @file{/var/run/utmp} for the current window. ++Adds or removes the entry in @file{/run/utmp} for the current window. This controls whether or not the window is @dfn{logged in}. In addition to this toggle, it is convenient to have ``log in'' and ``log out'' keys. For instance, @code{bind I login on} and @code{bind O @@ -161,7 +161,7 @@ Forwarded: not-needed @item @code{$SCREENDIR}/S-@var{login} -@item /local/screens/S-@var{login} -+@item /var/run/screen/S-@var{login} ++@item /run/screen/S-@var{login} Socket directories (default) @item /usr/tmp/screens/S-@var{login} @@ -170,7 +170,7 @@ Forwarded: not-needed Terminal capability databases -@item /etc/utmp -+@item /var/run/utmp ++@item /run/utmp Login records @item @code{$LOCKPRG} @@ -179,11 +179,11 @@ Forwarded: not-needed correctly change the owner of the tty device file for each window. Special permission may also be required to write the file -@file{/etc/utmp}. -+@file{/var/run/utmp}. ++@file{/run/utmp}. @item -Entries in @file{/etc/utmp} are not removed when @code{screen} is killed -+Entries in @file{/var/run/utmp} are not removed when @code{screen} is killed ++Entries in @file{/run/utmp} are not removed when @code{screen} is killed with SIGKILL. This will cause some programs (like "w" or "rwho") to advertise that a user is logged on who really isn't. @@ -192,7 +192,7 @@ Forwarded: not-needed The socket directory defaults either to @file{$HOME/.screen} or simply to -@file{/tmp/screens} or preferably to @file{/usr/local/screens} chosen at -+@file{/tmp/screens} or preferably to @file{/var/run/screen} chosen at ++@file{/tmp/screens} or preferably to @file{/run/screen} chosen at compile-time. If @code{screen} is installed setuid root, then the administrator should compile screen with an adequate (not NFS mounted) @code{SOCKDIR}. If @code{screen} is not diff --git a/debian/rules b/debian/rules index 956aa7d..772200d 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,7 @@ ROOT_UDEB := $(CURDIR)/debian/screen-udeb # statically define this... sucko TTYGROUP := 5 # Common configure options for .deb and .udeb -SCREEN_CONFIGURE=--with-socket-dir=/var/run/screen \ +SCREEN_CONFIGURE=--with-socket-dir=/run/screen \ --with-pty-mode=0620 \ --with-pty-group=${TTYGROUP} \ --enable-rxvt_osc \ diff --git a/debian/screen.init b/debian/screen.init index 19c5511..3eb4185 100644 --- a/debian/screen.init +++ b/debian/screen.init @@ -19,7 +19,7 @@ set -e test -f /usr/bin/screen || exit 0 -SCREENDIR=/var/run/screen +SCREENDIR=/run/screen case "$1" in start) diff --git a/debian/screen.postinst b/debian/screen.postinst index d835997..687579f 100644 --- a/debian/screen.postinst +++ b/debian/screen.postinst @@ -4,20 +4,20 @@ set -e . /usr/share/debconf/confmodule if [ "$1" = configure ]; then - if ! test -d /var/run/screen; then - install -g utmp -m 0775 -d /var/run/screen + if ! test -d /run/screen; then + install -g utmp -m 0775 -d /run/screen fi perms="`stat -c%a /usr/bin/screen`" override=/etc/tmpfiles.d/screen-cleanup.conf if [ $perms -eq 4755 ]; then - chmod 0755 /var/run/screen + chmod 0755 /run/screen if [ ! -f $override ]; then - echo 'd /var/run/screen 0755 root utmp' > $override + echo 'd /run/screen 0755 root utmp' > $override fi elif [ $perms -eq 755 ]; then - chmod 1777 /var/run/screen + chmod 1777 /run/screen if [ ! -f $override ]; then - echo 'd /var/run/screen 1777 root utmp' > $override + echo 'd /run/screen 1777 root utmp' > $override fi fi diff --git a/debian/screen.postrm b/debian/screen.postrm index 9328671..457a0dc 100644 --- a/debian/screen.postrm +++ b/debian/screen.postrm @@ -2,7 +2,7 @@ set -e if [ "$1" = purge ] || [ "$1" = remove ]; then - rm -rf /var/run/screen + rm -rf /run/screen fi if [ "$1" = purge ]; then diff --git a/debian/screen.preinst b/debian/screen.preinst index 218840d..a55748b 100644 --- a/debian/screen.preinst +++ b/debian/screen.preinst @@ -6,7 +6,7 @@ if [ "$1" = upgrade ]; then if dpkg --compare-versions "$2" lt-nl 4.0.3-7 && \ dpkg --compare-versions "$2" gt 4.0.3-3; then if ! test -L /tmp/.screen && test -d /tmp/.screen && test -n "`find /tmp/.screen -type p 2>/dev/null`"; then - ln -s /tmp/.screen /var/run/screen + ln -s /tmp/.screen /run/screen fi fi fi diff --git a/debian/screen.screen-cleanup.tmpfile b/debian/screen.screen-cleanup.tmpfile index 1a1128f..551b9ce 100644 --- a/debian/screen.screen-cleanup.tmpfile +++ b/debian/screen.screen-cleanup.tmpfile @@ -1 +1 @@ -d /var/run/screen 0775 root utmp +d /run/screen 0775 root utmp -- System Information: Debian Release: 9.0 APT prefers unstable APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), (500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 'buildd-experimental') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-1-amd64 (SMP w/8 CPU cores) Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init)