Package: update-inetd
Version: 4.31
Severity: normal

While debugging #531565 I noticed that there was another problem with
the invocation of itox in update-inetd. If the inetd.conf line includes
any shell meta-characters (in my case, it started with a #-comment),
these are not escaped when the command is run. This is what caused
update-inetd to break debconf when run in my postinst, since the
commande "echo $modearg | itox >&2" actually ended up as an 'echo'
command followed by a long comment, meaning that update-inetd ended up
writing a newline to STDOUT.

Proposed fix:

--- update-inetd.orig   2009-07-19 15:58:59.000000000 +0100
+++ update-inetd        2009-07-19 16:06:57.000000000 +0100
@@ -101,7 +101,9 @@
         print STDERR "/usr/share/doc/xinetd/README.Debian for more 
information.\n";
         if (-f "/usr/sbin/itox") {
                print STDERR "Suggested entry (automatically converted using 
itox):\n\n";
-               system("echo $modearg |itox >&2");
+               my $escapedmodearg = $modearg;
+               $escapedmodearg =~ s/'/'\\''/g;
+               system("printf '$escapedmodearg' |itox >&2");
        }
        print STDERR 
"-----------------------------------------------------------\n\n";
     }

Not only does this fix the quoting problem, but by using printf instead
of echo it should fix the "\t" escaping issue too.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages update-inetd depends on:
ii  debconf [debconf-2.0]         1.5.26     Debian configuration management sy

update-inetd recommends no packages.

update-inetd suggests no packages.

-- debconf information:
  update-inetd/ask-several-entries: true
  update-inetd/title:
  update-inetd/ask-entry-present: true
  update-inetd/ask-disable-entries: false
  update-inetd/ask-remove-entries: false



-- 
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