found 529313 4.1-3
tags 529313 + patch
thanks

This wasn’t actually fixed in 4.1-3.  Now /etc/bash.bashrc looks for 
‘/usr/share/command-not-found’, when it should be looking for 
‘/usr/share/command-not-found/command-not-found’.  This caused a 
regression in Ubuntu because the former is actually a directory, which 
naturally satisfies -x (see 
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/561046 ).

While you’re fixing that, can you also please put quotes around the $1 
(see http://bugs.debian.org/587185 ) and print a replacement error message 
if command-not-found was removed after bashrc was loaded (see 
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/561155 )?

Patch below.

Thanks,
Anders

--- a/debian/etc.bash.bashrc
+++ b/debian/etc.bash.bashrc
@@ -34,16 +34,17 @@
 #fi
 
 # if the command-not-found package is installed, use it
-if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then
+if [ -x /usr/lib/command-not-found -o -x 
/usr/share/command-not-found/command-not-found ]; then
        function command_not_found_handle {
                # check because c-n-f could've been removed in the meantime
                 if [ -x /usr/lib/command-not-found ]; then
-                  /usr/bin/python /usr/lib/command-not-found -- $1
+                  /usr/bin/python /usr/lib/command-not-found -- "$1"
                    return $?
-                elif [ -x /usr/share/command-not-found ]; then
-                  /usr/bin/python /usr/share/command-not-found -- $1
+                elif [ -x /usr/share/command-not-found/command-not-found ]; 
then
+                  /usr/bin/python 
/usr/share/command-not-found/command-not-found -- "$1"
                    return $?
                else
+                  printf "%s: command not found\n" "$1" >&2
                   return 127
                fi
        }



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