Openmoko Bug #1622: bash -c crashes without $PWD

Openmoko Public Trac bugs at
Wed Aug 13 03:04:28 CEST 2008

#1622: bash -c crashes without $PWD
 Reporter:  hah                                            |        Owner:  openmoko-kernel
     Type:  defect                                         |       Status:  new            
 Priority:  normal                                         |    Milestone:                 
Component:  System Software                                |      Version:                 
 Severity:  normal                                         |   Resolution:                 
 Keywords:  bash segfault crash PWD ssh scp default shell  |     Blocking:                 
Blockedby:                                                 |  

Comment(by hah):

 '''Quick-fix script "/bin/bash-fixed", version 2:'''
 export PWD
 if tty | grep -q '/dev/pts/'; then
   exec /bin/bash --login "$@"
   exec /bin/bash "$@"
 Previous version of the script did not start a proper login-shell.
 Probably because argument zero is not passed to /bin/bash. From {{{man
 A login shell is one whose first character of argument
 zero is a -, or one started with the --login option.

 With the old script, PATH was not exported, causing opkg to segfault:
 # opkg upgrade
 Segmentation fault

Ticket URL: <> <>
openmoko trac

More information about the openmoko-kernel mailing list