Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#5 Character issue

open
nobody
None
5
2014-11-30
2010-05-23
Robin
No

If special characters are used in the password, there is a problem. I have to look at the code and test.

I have a password that has @ ( ) & ! in it.

sh: -c: line 0: syntax error near unexpected token `('

sh: -c: line 0: `7z t -y -p8( test_special.7z 2>&1'
sh: -c: line 0: syntax error near unexpected token `)'
sh: -c: line 0: `7z t -y -p8) test_special.7z 2>&1'

Error is created in rarcrack.h in this line
const char* CMD[] = {"unrar t -y -p%s %s 2>&1", "7z t -y -p%s %s 2>&1", "unzip -P%s -t %s 2>&1", ""};

I see that in order to pass "special characters" in bash, a single quote needs to be used for the command. This would require building the CMD instead of just using a variable.

I will have to do some testing of this and get back to you.

I need more booze.

Discussion


  • Anonymous
    2011-06-26

    In bash you can surround parameter with char '. And for any ' in the name of the file, you have to backslash \ the char. Backslash also must be backslashed.

     
  • Robin
    Robin
    2011-08-23

    rarcrack test file with extended characters.

     
    Attachments