[Bug 806628] New: Bash doesn't execute a script w/o the #! line as user's shell but as /bin/sh
https://bugzilla.novell.com/show_bug.cgi?id=806628 https://bugzilla.novell.com/show_bug.cgi?id=806628#c0 Summary: Bash doesn't execute a script w/o the #! line as user's shell but as /bin/sh Classification: openSUSE Product: openSUSE 12.3 Version: RC 1 Platform: All OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: suse@tlinx.org QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 Someone hard coded bash to execute /bin/sh to execute user scripts that don't have a #!/bin/bash at the top. This is abnormal and confusing. Scripts should be execute with the user's login or $SHELL scripts, not /bin/sh. I often type in 1-lines that evolve into a short script that I'll edit, but I get different execution results if I edit the command line in 'vim' (for example), vs. if I save the file and the try to execute it. That is counter-intuitive. This is also something that is a SuSE-only patch -- i.e. when I asked about it on the bash list and was pointed at the source, I found the normal code had been #ifdef'ed out, and some hard-coded references to /bin/sh had been put in to always run. Please don't override the user's choice of shells. I've been told that bash is the system shell -- so why invoke it as /bin/sh which invokes incompatible behavior? Reproducible: Always Steps to Reproduce: 1. type "while read fn;do ls -l "$fn"; done < <('ls' -1)" into bash and notice it works. 2. Now put that line into a file and try running it -- (also in bash) and notice it doesn't. 3. Actual Results: /tmp/t: line 3: syntax error near unexpected token `<' /tmp/t: line 3: `done < <('ls' -1)' Expected Results: list of files in long format This is broken in 12.1 and is still broken in 12.3. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c
L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c1
--- Comment #1 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c
L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c2
--- Comment #2 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c3
Lars Müller
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c4
Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c5
--- Comment #5 from Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c6
--- Comment #6 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c7
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c8
--- Comment #8 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c9
--- Comment #9 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c10
--- Comment #10 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c11
--- Comment #11 from Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c12
--- Comment #12 from L. A. Walsh
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c13
--- Comment #13 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c14
Sebastian Krahmer
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c15
--- Comment #15 from L. A. Walsh
Security team has have reviewed the rbash vector and consider it not relevant. rbash is not really a security protection anyway (think perl -e 'system("./a.out");') Also werner has submitted a bash that disables the patch for openSUSE Factory.
closing
Certainly if you wanted rbash to provide any security, anything that allows arbitrary command execution causes a problem. As I find it difficult to imagine anyone using rbash as a security mechanism, I will not disagree with it being it being inadequate -- to the point that I asked why it shouldn't be removed on the bash list. One issue mentioned was "rbash is an optional feature. You can easily remove it by configuring bash with --disable-restricted". If suse doesn't it is useful, they don't have to supply it. It's not required by POSIX (nor by me for that matter). Others followed up with the idea that maybe the wording emphasizing it's low security usefulness should be added to the manpage... no commitments (or comments) after that point.... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c16
--- Comment #16 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c17
--- Comment #17 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=806628
https://bugzilla.novell.com/show_bug.cgi?id=806628#c18
--- Comment #18 from Swamp Workflow Management
participants (1)
-
bugzilla_noreply@novell.com