| 1 |
--- src/trrntzip.c-orig Mon May 2 08:38:40 2005
|
| 2 |
+++ src/trrntzip.c Sat May 7 02:51:55 2005
|
| 3 |
@@ -716,7 +716,7 @@
|
| 4 |
|
| 5 |
if (dirp)
|
| 6 |
{
|
| 7 |
- // First set all the files to read-only. This is so we can skip
|
| 8 |
+ // First set the sticky bit on all files. This is so we can skip
|
| 9 |
// our new zipfiles if they are returned by readdir() a second time.
|
| 10 |
while (direntp = readdir (dirp))
|
| 11 |
{
|
| 12 |
@@ -732,7 +732,7 @@
|
| 13 |
|
| 14 |
if (strstr (szTmpBuf, ".zip\0"))
|
| 15 |
{
|
| 16 |
- chmod (direntp->d_name, S_IRUSR);
|
| 17 |
+ chmod (direntp->d_name, istat.st_mode | S_ISUID);
|
| 18 |
}
|
| 19 |
}
|
| 20 |
// Zip file is actually a dir
|
| 21 |
@@ -780,9 +780,9 @@
|
| 22 |
sprintf (szTmpBuf, "%s", direntp->d_name);
|
| 23 |
strlwr (szTmpBuf);
|
| 24 |
|
| 25 |
- if (strstr (szTmpBuf, ".zip\0") && !(istat.st_mode & S_IWUSR))
|
| 26 |
+ if (strstr (szTmpBuf, ".zip\0") && (istat.st_mode & S_ISUID))
|
| 27 |
{
|
| 28 |
- chmod (direntp->d_name, S_IWUSR);
|
| 29 |
+ chmod (direntp->d_name, istat.st_mode & ~S_ISUID);
|
| 30 |
mig.cEncounteredZips++;
|
| 31 |
|
| 32 |
if (!mig.fProcessLog)
|
| 33 |
|
| 34 |
|