[Intel-gfx] [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /
Daniel Vetter
daniel at ffwll.ch
Tue Mar 21 12:50:48 UTC 2017
On Tue, Mar 21, 2017 at 01:15:59PM +0200, Jani Nikula wrote:
> On Tue, 21 Mar 2017, Daniel Vetter <daniel at ffwll.ch> wrote:
> > On Tue, Mar 21, 2017 at 12:14:31PM +0200, Jani Nikula wrote:
> >> Fix shellcheck SC2115: Use "${var:?}" to ensure this never expands to /.
> >>
> >> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> >
> > I'm not sold on these because if those are ever unset, dim will fail all
> > over the place.
>
> Yup, like at the top where we specifically ensure $DIM_PREFIX is not
> empty!
>
> > I'm leaning towards shutting this one up.
>
> I know, I was divided about this one as well, but erred on the safe side
> because 'rm -Rf /*' is such a huge failure mode.
>
> I could lean either way.
Even for this failure mode it feels like noise ... I guess bash scripting
just is noise, and we'll live with it?
Saying, IÍ„'m also ok with you pushing this. We might eventually have a
command where the input is user-supplied and if absent could result in
tears. I just fixed that broken default handling for dim retip :-)
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list