Re: [opensuse-factory] why are raw scripts forced into /bin/sh instead of user's shell (a Suse patch to bash)
"Carlos E. R."
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
El 2013-02-27 a las 22:52 -0600, Larry Finger escribió:
On 02/27/2013 09:59 PM, Linda Walsh wrote:
Why do you think this is SUSE only. Every distro has a default shell, which is what you get when you do not specify the shell to use.
/bin/sh is a link to a shell. Linda, find out which it is in your system.
If /bin/sh may be linked to different shells, you need to know that many scripts on Linux are not Shell complatible as they depend on bashisms. Jörg -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2013-03-01 a las 10:48 +0100, Joerg Schilling escribió:
If /bin/sh may be linked to different shells, you need to know that many scripts on Linux are not Shell complatible as they depend on bashisms.
If they do and the shebang does't point to bash, they have to be reported in bugzilla, IMO. - -- Cheers Carlos E. R. (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iF4EAREIAAYFAlEwibcACgkQja8UbcUWM1ycnwD9Gk9Fr1TSaFn0n8R4f6tKpLPL k4HYW4ATPi5vG0JBl08A/jGQ0D7e+dY2PFiIC+BccSumt4TPA7/CLkkhi3F3mF1M =24v2 -----END PGP SIGNATURE-----
* Carlos E. R.
El 2013-03-01 a las 10:48 +0100, Joerg Schilling escribió:
If /bin/sh may be linked to different shells, you need to know that many scripts on Linux are not Shell complatible as they depend on bashisms.
If they do and the shebang does't point to bash, they have to be reported in bugzilla, IMO.
We have a rpmlint check which tries to identify bashisms by running shell scripts through checkbashims and dash -n, however it only outputs an "informative" message so it's up to the maintainer to act on that. The situation in non-openSUSE specific software is also not as bad as it used to be since Debian and Ubuntu switched to using dash as /bin/sh a couple of years ago. -- Guido Berhoerster -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2013-03-01 a las 10:48 +0100, Joerg Schilling escribió:
If /bin/sh may be linked to different shells, you need to know that many scripts on Linux are not Shell complatible as they depend on bashisms.
If they do and the shebang does't point to bash, they have to be reported in bugzilla, IMO.
Yeah, someone tried to report a global cleanup bug for that https://bugzilla.novell.com/show_bug.cgi?id=800607, But it ended up on the "won't fix" list -- for reasons Guido mentions -- The best he was able to manage was an rpmbuild-advisory message. Apparently making it a build-error didn't go over too well. ;-) None of this solves the current problem of not executing the scripts under the user's shell. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday 01 March 2013 13:58:11 Linda Walsh wrote:
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
El 2013-03-01 a las 10:48 +0100, Joerg Schilling escribió:
If /bin/sh may be linked to different shells, you need to know that many scripts on Linux are not Shell complatible as they depend on bashisms.
If they do and the shebang does't point to bash, they have to be reported in bugzilla, IMO.
---- Yeah, someone tried to report a global cleanup bug for that https://bugzilla.novell.com/show_bug.cgi?id=800607,
But it ended up on the "won't fix" list -- for reasons Guido mentions -- The best he was able to manage was an rpmbuild-advisory message. Apparently making it a build-error didn't go over too well. ;-)
None of this solves the current problem of not executing the scripts under the user's shell.
Really Linda, unless you have a #! line in your script specifying which shell you want/need for it, you are relying on some undocumented effect that just happened to work in the past. This is not a good way of maintaining a system. If you want to be sure which script is used, use the documented way of doing that and start your script with #!/bin/bash, anything else is just relying on luck And saying "but it used to work" or "it works on system xyz" is just saying "but I want my luck to continue" If the default root password in the past was foobar and you never set it, and relied on its continuing to be foobar in future, and it then changed, would you also file a bug report against that? Use the feature available for determining which shell is used Anders -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Anders Johansson wrote:
On Friday 01 March 2013 13:58:11 Linda Walsh wrote:
None of this solves the current problem of not executing the scripts under the user's shell.
Really Linda, unless you have a #! line in your script specifying which shell you want/need for it, you are relying on some undocumented effect that just happened to work in the past. This is not a good way of maintaining a system.
I think I said that anytime I save a script to my bin directory, I add such a line. I recommended doing that in the bug report above if you bothered to look. My usage was interactive temp script development -- I would expect it to use my current shell like most systems. Even WINDOWS looks at it's COMSPEC and honors it -- and will launch the correct shell -- That SuSE has 5+ year old patches that don't apply to products in it's releases -- and that suse is the only distro with some of it's reported problems that created the need for the patches is likely due to patches from 5 years before that that are still in the code -- i.e. 10 year old patches still left in the code that no longer apply. Stop trying to blame the user for bad SW development practices. The patch says it is for 3.2 -- it should have been retired after that. The current product is 4.2 and it is no longer applicable. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (5)
-
Anders Johansson
-
Carlos E. R.
-
Guido Berhoerster
-
Joerg Schilling
-
Linda Walsh