lkml.org 
[lkml]   [2021]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2] selftests/lkdtm: Use /bin/sh not $SHELL
Date
From: Kees Cook
> Sent: 23 June 2021 23:47
>
> On Wed, Jun 23, 2021 at 04:27:47PM +0000, David Laight wrote:
...
> > You can probably even do:
> >
> > echo "$test" | /bin/sh -c cat >$TRIGGER || true
> >
> > (moving the redirect to the outer shell).
>
> Actually, it looks like the "write" is already happening in the exec'd
> process, so this can just be:
>
> echo "$test" | cat >$TRIGGER || true
>
> But it still can't be:
>
> echo "$test" >$TRIGGER
>
> which is what I had over-engineered a solution to. :)

That one fails because echo is the shell builtin.
But:
/bin/echo "$test" >$TRIGGER
should be fine.

Quite where the original came from I not sure I want to find out.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2021-06-24 09:22    [W:0.131 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site