http://bugzilla.novell.com/show_bug.cgi?id=626629 http://bugzilla.novell.com/show_bug.cgi?id=626629#c0 Summary: /usr/sbin/Check -- wrong shebang line Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: x86-64 OS/Version: openSUSE 11.3 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: torsten.foertsch@gmx.net QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.1 SUSE/6.0.443.0 (KHTML, like Gecko) Chrome/6.0.443.0 Safari/534.1 /usr/sbin/Check reads: #!/bin/sh ... . /etc/profile "$0" will be "/usr/bin/Check" in this case even while /etc/profile is executed. Now /etc/profile reads: ... is=$(readlink /proc/$$/exe) ... because /bin/sh is a symlink to /bin/bash that yields "/bin/bash". Then "$is" is matched against "*/bash" and if so "$0" is consulted to distiguish between "sh" and "bash". This check reads: case "$0" in sh|-sh|*/sh) is=sh ;; esac ;; Now, because "$0" is "/usr/sbin/Check" "$is" still holds "bash" after the check. Later on /etc/profile reads "$HOME/.bashrc". Unfortunately, if called as "sh" instead of "bash" its syntax slightly changes. For example a-b () { :; } is a valid function definition in bash but fails in sh. So, if the user calling /usr/sbin/Check while rebuilding for example an opensuse source rpm his .bashrc is consulted but the bash runs in sh-mode. Hence "rpmbuild --rebuild" may fail due to the $HOME/.bashrc of an arbitrary user. One possible solution is to change the shebang line in /usr/sbin/Check to #!/bin/bash Another solution is to put more intelligence into the code to tell apart bash and sh in /etc/profile. Reproducible: Always Steps to Reproduce: 1. create a .bashrc for a normal user (not root!) containing "a-b () { :; }" 2. call as this user /usr/sbin/check 3. Actual Results: backup@opi:~> /usr/sbin/Check /home/backup/.bashrc: line 1: `a-b': not a valid identifier Expected Results: backup@opi:~> /usr/sbin/Check Check does not work for normal users. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.