Your message dated Tue, 03 Aug 2021 06:18:44 +0000
with message-id <e1manle-000aqt...@fasolo.debian.org>
and subject line Bug#636459: fixed in tmpreaper 1.6.14+nmu2
has caused the Debian Bug report #636459,
regarding tmpreaper: protect on directory fails. Invalid process order.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
636459: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636459
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: tmpreaper
Version: 1.6.13+nmu1
Severity: normal
Tags: patch


What is happening with the current code:
Upon encountering a directory, the recursive subroutine to check and process
the directory is called prior to matching the directory name to the
configured protect strings. The result of this is that the contents of the
directory which matches a protect string will be removed if they themselves
do not match a protect string and are eligible to being removed by the
configured tmpreaper logic. After being returned from the recursion call,
the directory name is then checked against the configured protect strings
and is then skipped due to being positively matched. However, the contents
have already been removed.

What I expected:
Any file or directory is first matched against the configured protect
strings, and in the case of a directory, this directory is completely
skipped due to the fact that it positively matched a protect string. The
contents of that directory will never get processed and thus remain in tact.

The solution:
Put the protect match check block (if (FLAGS_PROTECT_P (flags)) {) before
the recursive directory check block (if (S_ISDIR (sb.st_mode)) {).


-- System Information:
Debian Release: 6.0.2
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-openvz-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages tmpreaper depends on:
ii  debconf [debconf-2.0]         1.5.36.1   Debian configuration management sy
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib

tmpreaper recommends no packages.

tmpreaper suggests no packages.

-- debconf information excluded
--- tmpreaper.c.orig	2011-08-03 10:01:58.530126581 +0200
+++ tmpreaper.c	2011-08-03 10:02:51.008247226 +0200
@@ -467,6 +467,21 @@
 		    continue;
 		}
 
+                if (FLAGS_PROTECT_P (flags)) {
+		    skip = i = 0;
+		    do {
+			if (sb.st_ino == protect_table[i].inode) {
+			    message (LOG_VERBOSE,
+				     "Entry matching `--protect' pattern skipped. `%s'\n",
+				     protect_table[i].name);
+			    skip = 1;
+			    break;
+			}
+		    } while (protect_table[i++].name);
+		    if (skip)
+			continue;
+		}
+
 		if (S_ISDIR (sb.st_mode)) {
                     char *dst;
 
@@ -489,21 +504,6 @@
 			     (u_int) getpid(), ent->d_name);
 		}
 
-		if (FLAGS_PROTECT_P (flags)) {
-		    skip = i = 0;
-		    do {
-			if (sb.st_ino == protect_table[i].inode) {
-			    message (LOG_VERBOSE,
-				     "Entry matching `--protect' pattern skipped. `%s'\n",
-				     protect_table[i].name);
-			    skip = 1;
-			    break;
-			}
-		    } while (protect_table[i++].name);
-		    if (skip)
-			continue;
-		}
-
 		/* Decide whether to remove the file or not */
 		/* check for mtime on directory instead of atime if requested */
 		if ( FLAGS_MTIME_P(flags) ||

--- End Message ---
--- Begin Message ---
Source: tmpreaper
Source-Version: 1.6.14+nmu2
Done: Adrian Bunk <b...@debian.org>

We believe that the bug you reported is fixed in the latest version of
tmpreaper, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 636...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Adrian Bunk <b...@debian.org> (supplier of updated tmpreaper package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 03 Aug 2021 08:35:41 +0300
Source: tmpreaper
Architecture: source
Version: 1.6.14+nmu2
Distribution: unstable
Urgency: medium
Maintainer: Paul Slootman <p...@debian.org>
Changed-By: Adrian Bunk <b...@debian.org>
Closes: 636459
Changes:
 tmpreaper (1.6.14+nmu2) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Apply patch from Mick Switser to fix protect on directory.
     (Closes: #636459)
Checksums-Sha1:
 bac28d8ee794feb9d808ccea3e6e5cbc14756930 1457 tmpreaper_1.6.14+nmu2.dsc
 fd5c349cddbc5d0a2c30e06c611dc1f07f6794ff 159298 tmpreaper_1.6.14+nmu2.tar.gz
Checksums-Sha256:
 8332cdec7cc7e8ca18778690663da9ca08727bc9192d3fd651e20d9e0debe469 1457 
tmpreaper_1.6.14+nmu2.dsc
 4f846195a3add5c4deb3648493c3d42435ca7198c76e76cc77b4099bc1bbc544 159298 
tmpreaper_1.6.14+nmu2.tar.gz
Files:
 82732dedc8ca0a388413b833ef7ebe92 1457 admin optional tmpreaper_1.6.14+nmu2.dsc
 05e4c43a7813111f9bc2df93e0366102 159298 admin optional 
tmpreaper_1.6.14+nmu2.tar.gz

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEOvp1f6xuoR0v9F3wiNJCh6LYmLEFAmEI3A4ACgkQiNJCh6LY
mLEp6Q/+NclNvOj1ccdlj0zuGuFtA/SAaYxJbFfceOs/KFOiDCm4aT9MquXKhsTY
M2AfN8fFYaUJVVvC2F2iiklGQG2lLiSU7vM48YFLcVD8aFu2Cr1EIaIJCnNtE7qz
LXjAnmRPo9FbD4rybWfo/rZ5yueukqKUVIEBAtaRk2tbtESCDnwqp6AajwG4sj2N
tAuEdSiM+eWLKlraRzSaSlSohccbQIzCQiZdW6+C8PiPNgPJwvUGnjlM6MqQDAYY
EWggWg11ja1IbBN6aLxFQoltRjLhBAA9Lclwv15P93xVPWKJmC6yAsqVc7q98Eu+
ns2/YM4S+4bzRpAYmq+r4pnI5eHOof/mkkUF9+yNR9T6bTg+NlRk6SH6tunzw0nu
AAJxXm7YN/q25Np2cmjJlPS30YccQApqDalbDO3t40rCHN2pEKdpYQnwMuVadRTC
II3L4BANI/JkhgPeu5iYpw6zavK30XdYY2tUhN5wgWjn/IMfD10bsQt8j9zZ8UmY
5KJapcEfhYG5W67Eo6FOuHn0fAn63kvQlN8wQJRs3Gt2RjfEohckkX+2PFkQ/UXd
tx22ZG3worUgMWbZlzk+I/+gdClSmv+y5uHui4C/xvMgYoCQOmJEiwtm8Rfin2+7
4+IdCvAfVtfVlO07TQeU57V5CsN77xP0T4dVvtuV0zcJ6a+NPmw=
=7k7W
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to