summaryrefslogtreecommitdiffstats
path: root/system/trrntzip/trrntzip_permission_fix.diff
diff options
context:
space:
mode:
author Erik Hanson2010-05-13 00:42:04 +0200
committer David Somero2010-05-13 00:42:04 +0200
commit029b5ff2bed77697e10b190106b7fc38096d7f76 (patch)
tree21ab926f2be1e2cd27739bad05caeb4a80248aba /system/trrntzip/trrntzip_permission_fix.diff
parentd5372ffc271e83b2d37fbe2177afa3d7f30c1bc7 (diff)
downloadslackbuilds-029b5ff2bed77697e10b190106b7fc38096d7f76.tar.gz
system/trrntzip: Updated for version v02
Diffstat (limited to 'system/trrntzip/trrntzip_permission_fix.diff')
-rw-r--r--system/trrntzip/trrntzip_permission_fix.diff47
1 files changed, 47 insertions, 0 deletions
diff --git a/system/trrntzip/trrntzip_permission_fix.diff b/system/trrntzip/trrntzip_permission_fix.diff
new file mode 100644
index 0000000000..6e6f93929e
--- /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)
+