[Forensics-changes] [fcrackzip] 37/93: debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch: new

Giovani Augusto Ferreira giovani-guest at moszumanska.debian.org
Wed Dec 28 03:06:41 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 750474b9738650e58c6537128c3310afa678adfd
Author: Jari Aalto <jari.aalto at cante.net>
Date:   Tue Jan 5 20:09:00 2010 +0200

    debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch: new
---
 ...0387-cannot-deal-files-with-special-chars.patch | 90 ++++++++++++++++++++++
 1 file changed, 90 insertions(+)

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
new file mode 100644
index 0000000..0ca2432
--- /dev/null
+++ b/debian/patches/20-bug-430387-cannot-deal-files-with-special-chars.patch
@@ -0,0 +1,90 @@
+From f681ef1c9feee2833f4e62aa7b9d8c74595a14d8 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
+
+Signed-off-by: Jari Aalto <jari.aalto at cante.net>
+---
+ main.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 59 insertions(+), 1 deletions(-)
+
+diff --git a/main.c b/main.c
+index f632241..1de75e6 100644
+--- a/main.c
++++ b/main.c
+@@ -44,13 +44,71 @@ static int modul = 1;
+ 
+ static FILE *dict_file;
+ 
++char *
++path_for_shell (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 '#':
++    case '$':
++    case '&':
++    case 0x27: /* single quote */
++    case '(':
++    case ')':
++    case '*':
++    case '+':
++    case 0x2C:
++    case ':':
++    case ';':
++    case '<':
++    case '>':
++    case '?':
++    case '[':
++    case '\\':
++    case ']':
++    case '^':
++    case '`':
++    case '{':
++    case '|':
++    case '}':
++      /* backslash special characters */
++      *p++ = '\\';
++      *p++ = ch;
++      break;
++    default:
++      *p++ = ch;
++    }
++  }
++
++  /* terminate string */
++  *p = '\0';
++
++  return dest;
++}
++
+ int REGPARAM
+ check_unzip (const char *pw)
+ {
+   char buff[1024];
++  char path[1024];
+   int status;
+ 
+-  sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, file_path[0]);
++  path_for_shell (path, file_path[0]);
++
++  sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, path);
+   status = system (buff);
+ 
+ #undef REDIR
+-- 
+1.6.5
+

-- 
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