Date: Thu, 26 May 2005 15:20:04 GMT From: Scot Hetzel <swhetzel@gmail.com> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/81502: archivers/torrentzip removes the read flag from zip files [sw-bug]. Message-ID: <200505261520.j4QFK4I6010870@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/81502; it has been noted by GNATS. From: Scot Hetzel <swhetzel@gmail.com> To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: Re: ports/81502: archivers/torrentzip removes the read flag from zip files [sw-bug]. Date: Thu, 26 May 2005 10:12:55 -0500 ------=_Part_348_29505210.1117120375227 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Attached is the fix to the permissions problem. torrentzip now use the sticky bit, instead of the read bin, to keep track of zip files that need to be processed. This change will be in the next release of torrentzip. --=20 DISCLAIMER: No electrons were harmed while sending this message. Only slightly bruised. ------=_Part_348_29505210.1117120375227 Content-Type: text/plain; name=patch-src-trrntzip.c; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-src-trrntzip.c" --- 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) ------=_Part_348_29505210.1117120375227--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505261520.j4QFK4I6010870>