RE: [PATCH v2] selftests/lkdtm: Use /bin/sh not $SHELL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux