Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37410820
en ru br
ALT Linux repos
S:6.0-alt5
5.0: 5.52-alt5
4.1: 5.52-alt5
4.0: 5.52-alt4.M40
+updates:5.52-alt4.M40
3.0: 5.52-alt1

Group :: Archiving/Compression
RPM: unzip

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: unzip-5.50-alt-ddottrav.patch
Download


--- unzip-5.50/unix/unix.c.vns	2002-01-22 01:54:42 +0300
+++ unzip-5.50/unix/unix.c	2003-07-02 13:32:02 +0400
@@ -473,7 +473,9 @@
             switch (workch) {
             case '/':             /* can assume -j flag not given */
                 *pp = '\0';
-                if (((error = checkdir(__G__ pathcomp, APPEND_DIR)) & MPN_MASK)
+		if(!uO.ddotflag && strcmp(pathcomp, "..") == 0)
+			killed_ddot = TRUE;
+		else if (((error = checkdir(__G__ pathcomp, APPEND_DIR)) & MPN_MASK)
                      > MPN_INF_TRUNC)
                     return error;
                 pp = pathcomp;    /* reset conversion buffer for next piece */
@@ -485,11 +487,6 @@
                     if (*cp == '/') {   /* don't bother appending "./" to */
                         ++cp;           /*  the path: skip behind the '/' */
                         break;
-                    } else if (!uO.ddotflag && *cp == '.' && cp[1] == '/') {
-                        /* "../" dir traversal detected */
-                        cp += 2;        /*  skip over behind the '/' */
-                        killed_ddot = TRUE; /*  set "show message" flag */
-                        break;
                     }
                 }
                 *pp++ = '.';
@@ -508,7 +505,8 @@
 #endif
 
             case '\026':          /* control-V quote for special chars */
-                quote = TRUE;     /* set flag for next character */
+		if(*cp != '/')
+                    quote = TRUE;     /* set flag for next character */
                 break;
 
 #ifdef MTS
@@ -570,6 +568,9 @@
             *lastsemi = '\0';
     }
 
+    if(!uO.ddotflag && strcmp(pathcomp, "..") == 0)
+	    *pathcomp = '\0';
+
 #ifdef ACORN_FTYPE_NFS
     /* translate Acorn filetype information if asked to do so */
     if (uO.acorn_nfs_ext &&
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin