#102: bash in sh mode may break certain scripts
--------------------------------+-------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |              Owner:  somebody               
     Type:  defect              |             Status:  new                    
 Priority:  high                |          Milestone:  Elatte Unstable Alpha 2
Component:  unknown             |            Version:  1.0                    
 Severity:  major               |         Resolution:                         
 Keywords:                      |   Launchpad_linked:  0                      
--------------------------------+-------------------------------------------
Old description:

> When trying to install the nVidia X11 driver, I get the following:
>
> # ./install
> ./install: line 31: UID: readonly variable
>
> The code is as follows:
>
> # Make sure we are root
> UID=`id | sed -n 's/.*uid=\([0-9][0-9]*\)(.*/\1/p'`
> if [ $UID -ne 0 ] ; then
>     echo "You must be root to install the package"
>     echo "enter this system's root password."
>     exec su root -c "$0 $@"
> fi
>
> This is the behavior of Bash, in that $UID is readonly.
> However, as we've seen certain Bash behaviors in "sh"
> mode tend to also break this script and potentially
> many others.
>
> One way to fix it is to restore /bin/sh to be the real
> Bourne shell and not symlink it to /bin/bash for
> compatibility purposes.

New description:

 When trying to install the nVidia X11 driver, I get the following:

 {{
 # ./install
 ./install: line 31: UID: readonly variable
 }}

 The code is as follows:

 {{
 # Make sure we are root
 UID=`id | sed -n 's/.*uid=\([0-9][0-9]*\)(.*/\1/p'`
 if [ $UID -ne 0 ] ; then
     echo "You must be root to install the package"
     echo "enter this system's root password."
     exec su root -c "$0 $@"
 fi
 }}

 This is the behavior of Bash, in that $UID is readonly.
 However, as we've seen certain Bash behaviors in "sh"
 mode tend to also break this script and potentially
 many others.

 One way to fix it is to restore /bin/sh to be the real
 Bourne shell and not symlink it to /bin/bash for
 compatibility purposes.

-- 
Ticket URL: <http://www.gnusolaris.org/cgi-bin/trac.cgi/ticket/102>
Nexenta Bug Tracking System <http://www.gnusolaris.org/gswiki/Bugs>
Core Components
_______________________________________________
GNU/Solaris Development mailing list
[EMAIL PROTECTED]

Reply via email to