[pkg-cryptsetup-devel] Bug#597583: Bug#597583: initramfs-tools

Jonas Meurer jonas at freesources.org
Mon May 23 17:39:07 UTC 2011


Hey Ian,

On 20/05/2011 Ian Jackson wrote:
> Jonas Meurer writes ("Re: [pkg-cryptsetup-devel] Bug#597583: initramfs-tools"):
> > On 21/09/2010 Ian Jackson wrote:
> > > This could be done by replacing this test
> > >         if [ -n "$cryptkeyscript" ] && [ ! -x "$cryptkeyscript" ]; then
> > > with something like
> > > 	if ! type "$cryptkeyscript >/dev/null; then
> > > with the added benefit of getting a slightly better error message too.
> > 
> > While I like your idea, it doesn't work. $cryptkeyscript might contain a
> > whole commandline, with arguments and options as well. Actually the
> > initramfs cryproot script even does it that way. See line 270 of the
> > script:
> > 
> > cryptkeyscript="plymouth ask-for-password --prompt"
> 
> It's been a while since I looked at this, and I don't have the code in
> front of me, but I'm puzzled, because if
>   cryptkeyscript="plymouth ask-for-password --prompt"
> then
>   if [ -n "$cryptkeyscript" ] && [ ! -x "$cryptkeyscript" ]; then
> would be true, just like my proposed test
>   if ! type "$cryptkeyscript" >/dev/null; then
> (err, with the syntax fixed...)
> 
> $ cryptkeyscript="plymouth ask-for-password --prompt"
> $ if [ -n "$cryptkeyscript" ] && [ ! -x "$cryptkeyscript" ]; then echo
> y; fi
> y
> $ if ! type "$cryptkeyscript" >/dev/null; then echo y; fi
> bash: type: plymouth ask-for-password --prompt: not found
> y
> $
> 
> > That one clearly doesn't work with type, as type checks for all
> > arguments, and errors out for the second and third one.
> 
> The same is true for test -x.

you're perfectly right. guess it was a little late, when I wrote the
last mail. I now tried to implement support for keyfiles inside $PATH
everywhere necessary. unfortunately I'm rather busy at the moment, and
don't have time to test the patch within the next weeks. thus it would
be great, if you could give it a first try, and report back whether it
does the trick for you. for sure I'll test it as well, before actually
uploading new packages.

greetings,
 jonas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyscript_type.diff
Type: text/x-diff
Size: 1632 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20110523/b0a6d0d9/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20110523/b0a6d0d9/attachment.pgp>


More information about the pkg-cryptsetup-devel mailing list