Package: apt-listbugs
Version: 0.1.6
Severity: normal
Tags: patch

Running aptitude (and consequently apt-listbug) via sudo, I'm not able to display the bugs list in a browser:

====
Are you sure you want to install/upgrade the above packages? [Y/n/?/...] w
bash: /dev/tty: No such device or address
W: Failed to invoke browser.
 su gpiero -c "/usr/bin/sensible-browser /tmp/apt-listbugs27667.0.html < 
/dev/tty"
====

Not sure when this bug has been introduced: it could be a while it doesn't work for me, but this hunk of code seems to be here since ages ago and I'm pretty sure I used it in the last years. I can only guess su's behaviour has changed in the meantime.

Please consider applying the following patch or a similar one in order to not include the shell redirection inside the command launched via su.

====
--- old-apt-listbugs-0.1.6/lib/apt-listbugs/logic.rb    2012-03-06 
21:56:13.735125556 +0100
+++ new-apt-listbugs-0.1.6/lib/apt-listbugs/logic.rb    2012-03-06 
21:56:14.099128219 +0100
@@ -620,10 +620,9 @@
       tmp.close
puts "Invoking browser for #{tmp.path}" if $DEBUG
-      browsercommandline = ""
-      browsercommandline << "su #{ENV["SUDO_USER"]} -c \"" if ENV["SUDO_USER"]
-      browsercommandline << "#{@config.browser} #{tmp.path} < /dev/tty"
-      browsercommandline << "\"" if ENV["SUDO_USER"]
+      browsercommandline = "#{@config.browser} #{tmp.path}"
+      browsercommandline = "su #{ENV["SUDO_USER"]} -c \"" + browsercommandline + "\"" if 
ENV["SUDO_USER"]
+      browsercommandline << " < /dev/tty"
       if system(browsercommandline)
         puts "successfully invoked browser" if $DEBUG
       else
====

Thanks,
Gian Piero.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apt-listbugs depends on:
ii  apt                            0.8.15.9
ii  libdpkg-ruby1.8                0.3.8
ii  libgettext-ruby1.8             2.1.0-2.1
ii  libruby1.8 [libzlib-ruby1.8]   1.8.7.352-2
ii  ruby-debian [libdpkg-ruby1.8]  0.3.8
ii  ruby-httpclient                2.2.1-1
ii  ruby-xmlparser                 0.7.2-1
ii  ruby1.8                        1.8.7.352-2

apt-listbugs recommends no packages.

Versions of packages apt-listbugs suggests:
ii  chromium [www-browser]     17.0.963.56~r121963-1
ii  debianutils                4.2.1
ii  iceweasel [www-browser]    10.0.2-1
ii  links [www-browser]        2.5-1
ii  links2 [www-browser]       2.5-1
ii  netsurf-gtk [www-browser]  2.8-2
ii  reportbug                  6.3.1
ii  uzbl [www-browser]         0.0.0~git.20111128-2
ii  w3m [www-browser]          0.5.3-5

-- no debconf information



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to