ckolivas / lrzip

Long Range Zip
http://lrzip.kolivas.org
GNU General Public License v2.0
618 stars 76 forks source link

Encrypt option not working in lrztar #192

Closed ghost closed 3 years ago

ghost commented 3 years ago

If I use the encrypt option with lrzip it works

lrzip --encrypt=1234 ~/.gnupg/gpg.conf Output filename is: ~/.gnupg/gpg.conf.lrz ~/.gnupg/gpg.conf - Compression Ratio: 0.149. Average Compression Speed: 0.000MB/s.

But trying to use it in lrztar results in

lrztar --encrypt=1234 ~/.gnupg /usr/bin/lrztar: illegal option -- - /usr/bin/lrztar: line 66: ((: v_?=1: syntax error: operand expected (error token is "=1") /usr/bin/lrztar: illegal option -- e /usr/bin/lrztar: line 66: ((: v_?=2: syntax error: operand expected (error token is "=2") /usr/bin/lrztar: illegal option -- r /usr/bin/lrztar: line 66: ((: v_?=5: syntax error: operand expected (error token is "=5") /usr/bin/lrztar: illegal option -- y /usr/bin/lrztar: line 66: ((: v_?=6: syntax error: operand expected (error token is "=6") tar: Removing leading /' from member names Unable to work from STDIO while reading password Fatal error - exiting

And the -e option results in a similar error in line 66 /usr/bin/lrztar: illegal option -- e /usr/bin/lrztar: line 66: ((: v_?=1: syntax error: operand expected (error token is "=1")

Since lrztar is a bash script i taken a look in line 66 and it shows the importation of lrzip arguments ((v_$x=${#vopt[@]}))

But from here and where that function goes... i can't see the "-e" argument. Is it missing or it was supposed to be passed automatically to lrzip?

local p=("${@:1:$(($#-1))}") s="${!#}" vopt=("lrz") \ v_w=0 v_S=0 v_D=0 v_p=0 v_q=0 v_L=0 \ v_n=0 v_l=0 v_b=0 v_g=0 v_z=0 v_U=0 \ v_T=0 v_N=0 v_v=0 v_f=0 v_d=0 v_h=0 \ v_H=0 v_c=0 v_k=0 v_o=0 v_O=0 v_m=0 x= i="$(pwd)"

while getopts w:O:S:DqL:nlbgzUm:TN:p:vfo:d:tVhHck x; do [[ $x == [tV] ]] && { printf "lrztar: invalid option for lrztar: %s\n" "$x"; return 1;

EDIT: My excuses in advance for the lack of spaces, github is completely weird at text formatting.

ckolivas commented 3 years ago

No, encryption is not supported with lrztar because of the way it works. It's a braindead convenience wrapper and only using lrzip directly will give you access to all the features.

ghost commented 3 years ago

@ckolivas I tried to pipe it with tar cf, but lrzip says the following Unable to work from STDIO while reading password Is it a protection mechanism, just like lrztar not accepting this option? How can I bypass it?

ckolivas commented 3 years ago

Unfortunately it's the same issue since lrztar uses stdio and stdio is the problem. It should be possible to pass the password on the command line though. I'll look into that. Otherwise you'll have to do it in two steps for now.