Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 182628
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo net-p2p team <net-p2p@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Kai <gentoo@altkai.ml1.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 182628 depends on: Show dependency tree
Bug 182628 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-06-20 01:27 0000
Hello, this is a known problem upstream, where torrentzip will change
permissions of the file it compresses, even locking itself out of being able to
write a file.

Currently I must use wine + torrentzip, which is less than ideal. I'm not a C
programmer, so would someone please look over this patch, taken from FreeBSD,
and see if it fixes the problem? tyvm!

Also see:
https://sourceforge.net/tracker/index.php?func=detail&aid=1415549&group_id=135285&atid=732451

and:

File permissions on Linux have different names: rename all
instances of 'S_ISTXT' in the patch to 'S_ISVTX' and
trrntzip will then compile.

--- src/trrntzip.c-orig Mon May  2 08:38:40 2005
+++ src/trrntzip.c      Sat May  7 02:51:55 2005
@@ -716,7 +716,7 @@

     if (dirp)
     {
-      // First set all the files to read-only. This is so we can skip
+      // First set the sticky bit on all files. This is so we can skip
       // our new zipfiles if they are returned by readdir() a second time.
       while (direntp = readdir (dirp))
       {
@@ -732,7 +732,7 @@

           if (strstr (szTmpBuf, ".zip\0"))
           {
-            chmod (direntp->d_name, S_IRUSR);
+            chmod (direntp->d_name, istat.st_mode | S_ISTXT);
           }
         }
         // Zip file is actually a dir
@@ -780,9 +780,9 @@
           sprintf (szTmpBuf, "%s", direntp->d_name);
           strlwr (szTmpBuf);

-          if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR))
+          if (strstr (szTmpBuf, ".zip\0") && (istat.st_mode & S_ISTXT))
           {            
-            chmod (direntp->d_name, S_IWUSR);
+            chmod (direntp->d_name, istat.st_mode & ~S_ISTXT);
             mig.cEncounteredZips++;

             if (!mig.fProcessLog)


Reproducible: Always

------- Comment #1 From Jonathan Adamczewski 2007-06-27 10:43:12 0000 -------
The provided patch does not compile.

Try this - it seems to work for me :

--- src/trrntzip.c-orig Mon May  2 08:38:40 2005
+++ src/trrntzip.c      Sat May  7 02:51:55 2005
@@ -780,9 +780,9 @@
           sprintf (szTmpBuf, "%s", direntp->d_name);
           strlwr (szTmpBuf);

           if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR))
           {            
-            chmod (direntp->d_name, S_IWUSR);
+            chmod (direntp->d_name, S_IWUSR | S_IRUSR);
             mig.cEncounteredZips++;

             if (!mig.fProcessLog)

------- Comment #2 From Kai 2007-06-27 20:17:01 0000 -------
Thank you, that seems to do the trick! I'll continue testing.

The patch that applies neatly is:

--- src/trrntzip.c
+++ src/trrntzip.c
@@ -782,7 +782,7 @@

           if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR))
           {            
-            chmod (direntp->d_name, S_IWUSR);
+            chmod (direntp->d_name, S_IWUSR | S_IRUSR);
             mig.cEncounteredZips++;

             if (!mig.fProcessLog)

------- Comment #3 From Raúl Porcel 2007-07-23 13:48:42 0000 -------
Fixed, thanks

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug