severity 668890 serious
# this contains several fix possibilities
tags 668890 + patch
thanks

Hi,

this makes dirmngr fail to start when:

root@ara2:~ # fgrep logo /etc/profile
linux_logo -uy

Excerpt from running sh -x /etc/init.d/dirmngr start:

[…]
DIRMNGR_INFO=/var/run/dirmngr/socket:18493:1; export DIRMNGR_INFO;
+ eval         _,met$$$$$gg.
     ,g$$$$$$$$$$$$$$$P.
   ,g$$P""       """Y$$.".
  ,$$P'              `$$$.
',$$P       ,ggs.     `$$b:
`d$$'     ,$P"'   .    $$$                               ,#.
 $$P      d$'     ,    $$P      ##:          :##        :###:
 $$:      $$.   -    ,d$$'      ##'          `##         `#'
 $$;      Y$b._   _,d$P'    __  ##     __     ##  __      _     __          _
 Y$$.    `.`"Y$$$$P"'     ,####:##  ,######.  ##.#####. :### ,######. ###.####:
 `$$b      "-.__         ,##' `###  ##:  :##  ###' `###  ##' #:   `## `###' `##:
  `Y$$b                  ##    `##  ##    ##  ##'   `##  ##    ___,##  ##:   `##
   `Y$$.                 ##     ##  #######:  ##     ##  ##  .#######  ##'    ##
     `$$b.               ##     ##  ##'       ##     ##  ##  ##'  `##  ##     ##
       `Y$$b.            ##.   ,##  ##        ##    ,##  ##  ##    ##  ##     ##
         `"Y$b._         :#:._,###  ##:__,##  ##:__,##' ,##. ##.__:##. ##     ##
             `""""       `:#### ###  ######'  `######'  #### `#####"## ##     ##
[…]


Peter Eisentraut dixid quod…

> No, that's only done when the shell is interactive.

Using “su -” m̲a̲k̲e̲s̲ the shell interactive!
Actually, it makes it a login shell, which i̲s̲ interactive…

The “obvious” solution is to remove the -l option (dash):

--- /etc/init.d/dirmngr~        2012-12-18 16:53:42.000000000 +0100
+++ /etc/init.d/dirmngr 2012-12-18 16:58:45.000000000 +0100
@@ -32,7 +32,7 @@ d_start() {
                mkdir -p /var/run/dirmngr || return 1
                chown dirmngr:dirmngr /var/run/dirmngr || return 1
 
-               output=$(su -c ". /lib/lsb/init-functions && umask 027 && 
start_daemon -p $PIDFILE $DAEMON --daemon --sh" - dirmngr) || return 1
+               output=$(su -c ". /lib/lsb/init-functions && umask 027 && 
start_daemon -p $PIDFILE $DAEMON --daemon --sh" dirmngr) || return 1
                eval "$output" || return 1
                pid=$(echo "$DIRMNGR_INFO" | cut -d : -f 2) || return 1
                echo "$pid" >$PIDFILE || return 1

Less obvious, start-stop-daemon has a “-c” option to switch the
user before running the dæmon; if you use it directly instead of
LSB’s start_daemon wrapper, you can use that. It’s got quite some
functions that are here possibly useful.

The current code is broken, period. It may not occur during system
startup, but when installing or upgrading the package, the shell
will recognise that its stdin and stderr are a terminal, and it’ll
have a controlling tty and thus be interaceive.

bye,
//mirabilos
-- 
13:37⎜«Natureshadow» Deep inside, I hate mirabilos. I mean, he's a good
guy. But he's always right! In every fsckin' situation, he's right. Even
with his deeply perverted taste in software and borked ambition towards
broken OSes - in the end, he's damn right about it :(! […] works in mksh


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to