[Forensics-changes] [fcrackzip] 54/93: debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch: refresh. Thanks Richard Corner LP#35064

Giovani Augusto Ferreira giovani-guest at moszumanska.debian.org
Wed Dec 28 03:06:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

giovani-guest pushed a commit to branch debian
in repository fcrackzip.

commit ed991c71463793517653d04978a7f21d36996854
Author: Jari Aalto <jari.aalto at cante.net>
Date:   Mon Oct 25 17:09:14 2010 +0300

    debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch: refresh. Thanks  Richard Corner LP#35064
---
 ...0387-cannot-deal-files-with-special-chars.patch | 64 ++++++++++++++++++----
 1 file changed, 54 insertions(+), 10 deletions(-)

diff --git a/debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch b/debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch
index 0ca2432..99aced0 100644
--- a/debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch
+++ b/debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch
@@ -1,18 +1,21 @@
-From f681ef1c9feee2833f4e62aa7b9d8c74595a14d8 Mon Sep 17 00:00:00 2001
+From 0fe92dade96e4ad947da308c028b407125867738 Mon Sep 17 00:00:00 2001
 From: Jari Aalto <jari.aalto at cante.net>
-Date: Tue, 5 Jan 2010 20:06:17 +0200
-Subject: [PATCH] main.c: (path_for_shell): handle special file names
+Date: Mon, 25 Oct 2010 17:07:08 +0300
+Subject: [PATCH] handle special file names and passwords
+Organization: Private
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
 
 Signed-off-by: Jari Aalto <jari.aalto at cante.net>
 ---
- main.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 59 insertions(+), 1 deletions(-)
+ main.c |  101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 100 insertions(+), 1 deletions(-)
 
 diff --git a/main.c b/main.c
-index f632241..1de75e6 100644
+index f632241..d18c482 100644
 --- a/main.c
 +++ b/main.c
-@@ -44,13 +44,71 @@ static int modul = 1;
+@@ -44,13 +44,112 @@ static int modul = 1;
  
  static FILE *dict_file;
  
@@ -32,6 +35,7 @@ index f632241..1de75e6 100644
 +    switch (ch)
 +    {
 +    /* ASCII table order */
++    case 0x20: /* space */
 +    case '!':
 +    case '"':
 +    case '#':
@@ -42,7 +46,7 @@ index f632241..1de75e6 100644
 +    case ')':
 +    case '*':
 +    case '+':
-+    case 0x2C:
++    case 0x2C: /* comma */
 +    case ':':
 +    case ';':
 +    case '<':
@@ -56,6 +60,43 @@ index f632241..1de75e6 100644
 +    case '{':
 +    case '|':
 +    case '}':
++    case '~':
++      /* backslash special characters */
++      *p++ = '\\';
++      *p++ = ch;
++      break;
++    default:
++      *p++ = ch;
++    }
++  }
++
++  /* terminate string */
++  *p = '\0';
++
++  return dest;
++}
++
++char *
++escape_pw (char *dest, const char *str)
++{
++  /* backslash shell special charatcers */
++
++  char ch, *p = dest;
++  size_t len = strlen(str);
++  int i;
++
++  for (i = 0; i < len; i++)
++  {
++    ch = str[i];
++
++    switch (ch)
++    {
++    /* ASCII table order */
++    case '"':
++    case '$':
++    case 0x27: /* single quote */
++    case '\\':
++    case '`':
 +      /* backslash special characters */
 +      *p++ = '\\';
 +      *p++ = ch;
@@ -76,15 +117,18 @@ index f632241..1de75e6 100644
  {
    char buff[1024];
 +  char path[1024];
++  char escpw[256];
    int status;
  
 -  sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, file_path[0]);
++  escape_pw (escpw, pw);
 +  path_for_shell (path, file_path[0]);
 +
-+  sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, path);
++  sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, escpw, path); 
++
    status = system (buff);
  
  #undef REDIR
 -- 
-1.6.5
+1.7.1
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/fcrackzip.git



More information about the forensics-changes mailing list