bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash has the current working directory in PATH by default


From: Christian Biere
Subject: Bash has the current working directory in PATH by default
Date: Sun, 23 May 2004 01:29:32 +0200
User-agent: Mutt/1.4.2.1i

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: netbsdelf
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='netbsdelf' -DCONF_MACHTYPE='i386--netbsdelf' -DCONF_VENDOR='' 
-DSHELL  -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib -I/usr/pkg/include -Os 
-march=athlon -mcpu=athlon -I/usr/pkg/include
uname output: NetBSD cyclonus 2.0E NetBSD 2.0E (STARSCREAM) #0: Sat Apr 24 
19:43:57 CEST 2004  address@hidden:/usr/obj/sys/arch/i386/compile/STARSCREAM 
i386
Machine Type: i386--netbsdelf

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:

  Bash (unlike any other shell I've ever used) puts a dot into the default
  PATH value. AFAIR, this has always been considered bad practice and at
  least on a multi-user system it can easily turn a (normally harmless)
  typo into a nightmare. In my experience many people are not aware that
  Bash uses such a default and it's usually discovered after things went
  wrong.

Repeat-By:

 $ cd /tmp
 $ bash -c sl
 Bye bye.

 (There are of course more than thousand and one less obvious ways.)

Fix:

--- config-top.h        2001/10/24 17:28:49     1.1
+++ config-top.h        2004/05/22 22:40:39
@@ -34,7 +34,7 @@
 /* The default value of the PATH variable. */
 #ifndef DEFAULT_PATH_VALUE
 #define DEFAULT_PATH_VALUE \
-  "/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:."
+  "/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin"
 #endif
 
 /* The value for PATH when invoking `command -p'.  This is only used when

Attachment: pgpyFIQ6rhhSB.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]