AshleyPinner / libmcrypt

GNU Lesser General Public License v2.1
0 stars 0 forks source link

Force option depends on positon in command line #2

Open AshleyPinner opened 8 years ago

AshleyPinner commented 8 years ago

Port of issue #10 from Sourceforge - http://sourceforge.net/p/mcrypt/bugs/10/

I attempted to crypt [decrypt] a group of files from
the command line:
for i in *.nc
done
mcrypt [-d] --key KEY filename $i
done
This gave me a complaint about not accepting input from
stdin [stdout], even though I was giving mcrypt a file
name and it worked outside a loop.
Eventually I managed to get encryption to work if I
added "-F" to the command line.
I could not get decryption to work using -F, until I
put the -F option as the last option before the file name.
What I'm seeing are two unexpected behaviors:
(1) That using mcrypt in a loop seems to have a
different action than using mcrypt on the command line
by itself. I see this when I use the construct above,
when I use a construct such as "ls | while read; do
mcrypt -d $REPLY; done" as well. If I use -F then I can
force it to work.
(2) That the -F construct must be the final option in
the above situation in order to get mcrypt to work.
Please let me know if I can be of any further assistance.
Mcrypt v.2.6.4 (i686-pc-linux-gnu)
Linked against libmcrypt v.2.5.7