bug-coreutils
[Top][All Lists]
Advanced

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

Re: avoid mkdir/selinux failure when mknod is a shell built-in


From: Thomas Schwinge
Subject: Re: avoid mkdir/selinux failure when mknod is a shell built-in
Date: Wed, 16 Apr 2008 14:43:04 +0200
User-agent: Mutt/1.5.11

Hello!

On Wed, Apr 16, 2008 at 02:30:57PM +0200, Jim Meyering wrote:
> Eric Blake <address@hidden> wrote:
> > According to Jim Meyering on 4/16/2008 2:33 AM:
> > | This test would fail not only because the built-in mknod
> > | doesn't support -Z, but because it doesn't know about 'p' pipes.
> > |
> > |   tests: avoid mkdir/selinux failure when mknod is a shell built-in
> > |   * tests/mkdir/selinux: Skip the mknod test if it's a built-in.
> >
> > Couldn't you try to defeat the shell builtin by using a subshell and exec
> > to force the PATH lookup?  For example, on bash:
> >
> > $ printf --version | head -n1
> > bash: printf: --: invalid option
> > printf: usage: printf [-v var] format [arguments]
> > $ (exec printf --version) | head -n1
> > printf (GNU coreutils) 6.10
> 
> My first reaction was "great! that looks much better".
> Unfortunately, the technique doesn't work with that shell:
> 
>   openbsd$ ./mknod --version|head -1
>   mknod (GNU coreutils) 6.10.188-7cb24
>   openbsd$ PATH=. /bin/sh -c 'mknod --version'|head -1

                                ^ exec?


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]