Dash as default shell

Panu Matilainen pmatilai at laiskiainen.org
Sat Oct 4 05:37:53 UTC 2014


On 10/04/2014 01:04 AM, Orion Poplawski wrote:
> On 10/03/2014 03:55 PM, Orion Poplawski wrote:
>> On 10/03/2014 02:34 PM, Matthew Miller wrote:
>>> On Fri, Oct 03, 2014 at 02:29:53PM -0600, Orion Poplawski wrote:
>>>>> Is it worth considering using Dash as the default (non-interactive)
>>>>> shell in Fedora?  Other distributions including Ubuntu and Debian
>>>>> (https://lwn.net/Articles/343924/) have been using dash as the default
>>>>> shell and Android uses mksh.  While this appears to have been done
>>>>> primary to increase bootup efficiency (which is not relevant with
>>>>> systemd), it might help with security
>>>>
>>>> More bashism's in .spec files:
>>>> + pushd src
>>>> /tmp/rpm/rpm-tmp.047Jay: 43: /tmp/rpm/rpm-tmp.047Jay: pushd: not found
>>>
>>> All the other things aside, I think it'd be fine for us to leave bash
>>> as the
>>> shell for spec file scripts even if we changed /bin/sh and/or the root
>>> shell.
>>>
>>
>> Yeah, I'm wondering if an rpm bug is in order here now to explicitly use
>> /bin/bash.
>>
> http://rpm.org/ticket/877
>

Been there, see https://bugzilla.redhat.com/show_bug.cgi?id=850706.

"Shell correctness" is simple: either avoid bashisms in scriptlets or 
explicitly set -p /bin/bash as the interpreter. Oh and remove this from 
the guidelines: 
https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Default_Shell

I'm sure rpmlint can (be made to) check for bashisms...

	- Panu -


More information about the devel mailing list