[Slackbuilds-users] SlackBuilds Template Changes

Duncan Roe duncan_roe at optusnet.com.au
Wed Jul 14 00:06:23 UTC 2021


On Mon, Jul 12, 2021 at 09:38:51PM -0500, Erik Hanson wrote:
> On 7/5/21 6:11 AM, Duncan Roe wrote:
>
> > With reference to your templates commit bab9e3ed89a5, *please* consider
> > '#!/bin/bash -p' in place of '#!/bin/bash'.
> >
> > Without -p, a script will import all exported command functions. This can cause
> > unpredictable results when a function has the name of a command the script uses.
>
> Do you have an example use-case for this being an issue? SlackBuild
> scripts are not intended to be run from a setuid program, in fact we
> expect them to be run as root, so I don't see the implications here.
>
/root/.bashrc -> /home/dunc/.bashrc on my system. Similarly /root/.profile.
Perhaps that's unusual, but I'm not about to stop doing it.
At the moment I don't export any functions, but am tempted from time to time.
E.g. colon is normally a builtin but I have :() { cd "../$1"; }

Cheers ... Duncan.


More information about the SlackBuilds-users mailing list