From 029b5ff2bed77697e10b190106b7fc38096d7f76 Mon Sep 17 00:00:00 2001 From: Erik Hanson Date: Thu, 13 May 2010 00:42:04 +0200 Subject: system/trrntzip: Updated for version v02 --- system/trrntzip/trrntzip_permission_fix.diff | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 system/trrntzip/trrntzip_permission_fix.diff (limited to 'system/trrntzip/trrntzip_permission_fix.diff') diff --git a/system/trrntzip/trrntzip_permission_fix.diff b/system/trrntzip/trrntzip_permission_fix.diff new file mode 100644 index 000000000000..6e6f93929e6b --- /dev/null +++ b/system/trrntzip/trrntzip_permission_fix.diff @@ -0,0 +1,47 @@ +diff -Nru trrntzip/src/trrntzip.c trrntzip_v2patched/src/trrntzip.c +--- trrntzip/src/trrntzip.c 2005-05-02 10:38:40.000000000 -0300 ++++ trrntzip_v2patched/src/trrntzip.c 2009-07-09 23:50:57.833279724 -0300 +@@ -732,7 +732,15 @@ + + if (strstr (szTmpBuf, ".zip\0")) + { +- chmod (direntp->d_name, S_IRUSR); ++ //chmod (direntp->d_name, S_IRUSR); ++#ifndef S_ISVTX ++ // On windows we just set the file to read-only ++ chmod (direntp->d_name, S_IRUSR); ++#else ++ // On Unix systems we use the sticky bit ++ // We also retain all other flags ++ chmod (direntp->d_name, S_ISVTX | istat.st_mode); ++#endif + } + } + // Zip file is actually a dir +@@ -780,9 +788,22 @@ + sprintf (szTmpBuf, "%s", direntp->d_name); + strlwr (szTmpBuf); + +- if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR)) +- { +- chmod (direntp->d_name, S_IWUSR); ++ //if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR)) ++ //{ ++ // chmod (direntp->d_name, S_IWUSR); ++ if (strstr (szTmpBuf, ".zip\0") && ++ ++#ifndef S_ISVTX ++ !(istat.st_mode & S_IWUSR)) ++ { ++ // Remove the read only bit we set earlier on Windows systems ++ chmod (direntp->d_name, S_IWUSR); ++#else ++ istat.st_mode & S_ISVTX) ++ { ++ // Remove the sticky bit we set earlier on Unix systems ++ chmod (direntp->d_name, istat.st_mode - S_ISVTX); ++#endif + mig.cEncounteredZips++; + + if (!mig.fProcessLog) + -- cgit v1.2.3