Your message dated Sat, 14 Nov 2009 18:32:06 +0000
with message-id <[email protected]>
and subject line Bug#556227: fixed in debianutils 3.2.2
has caused the Debian Bug report #556227,
regarding savelog breaks when target file does not exist
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 [email protected]
immediately.)


-- 
556227: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=556227
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: debianutils
Version: 2.30


Hi,

The version of savelog shipped with lenny does not correctly handle
the target file not existing, which is a common case when /var/log is
a tmpfs. In this situation, /etc/init.d/bootmisc.sh uses savelog to
rotate /var/log/dmesg on boot, which does not exist, producing the
errors below on every boot and creating the spurious file
/var/log/dmesg.new.

To reproduce, run:
/usr/bin/savelog -q -p foo

where foo is a file that does not exist.

Expected behaviour:

The command completes with no output, and the empty files 'foo' and
'foo.0' are created (-p implies touch the target file which creates
'foo', and the default is to rotate even if the file does not exist,
producing 'foo.0').

Actual behaviour; The following error messages are printed:

chown: failed to get attributes of `foo': No such file or directory
chmod: failed to get attributes of `foo': No such file or directory

and the empty files 'foo.0' and 'foo.new' are created.

The attached patch fixes this bug.

Cheers,

Patrick


-- 
http://www.labyrinthdata.net.au - WA Backup, Web and VPS Hosting
--- /usr/bin/savelog	2009-02-17 06:27:53.000000000 +0900
+++ savelog	2009-11-14 23:36:12.000000000 +0800
@@ -185,9 +185,9 @@
 		continue
 	fi
 
-	# if not a file or empty, do nothing major
-	# (in the Debian version, we rotate even if empty by default)
-	if [ ! -s "$filename" ] && [ "$rotateifempty" != "yes" ]; then
+	# if file does not exist or is empty, and we've been told to not rotate
+	# empty files, create if requested and skip to the next file.
+	if [ ! -s "$filename" ] && [ "$rotateifempty" = "no" ]; then
 		# if -t was given and it does not exist, create it
 		if test -n "$touch" && [ ! -f "$filename" ]; then 
 			touch -- "$filename"
@@ -199,6 +199,16 @@
 			fixfile "$filename"
 		fi
 		continue
+	# otherwise if the file does not exist and we've been told to rotate it
+	# anyway, create an empty file to rotate.
+	elif [ ! -e "$filename" ]; then
+		touch -- "$filename"
+		if [ "$?" -ne 0 ]; then
+			echo "$prog: could not touch $filename" 1>&2
+			exitcode=4
+			continue
+		fi
+		fixfile "$filename"
 	fi
 
  	# be sure that the savedir exists and is writable

--- End Message ---
--- Begin Message ---
Source: debianutils
Source-Version: 3.2.2

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

debianutils_3.2.2.dsc
  to main/d/debianutils/debianutils_3.2.2.dsc
debianutils_3.2.2.tar.gz
  to main/d/debianutils/debianutils_3.2.2.tar.gz
debianutils_3.2.2_amd64.deb
  to main/d/debianutils/debianutils_3.2.2_amd64.deb



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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Clint Adams <[email protected]> (supplier of updated debianutils 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 [email protected])


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

Format: 1.8
Date: Sat, 14 Nov 2009 13:16:01 -0500
Source: debianutils
Binary: debianutils
Architecture: source amd64
Version: 3.2.2
Distribution: unstable
Urgency: low
Maintainer: Clint Adams <[email protected]>
Changed-By: Clint Adams <[email protected]>
Description: 
 debianutils - Miscellaneous utilities specific to Debian
Closes: 556227
Changes: 
 debianutils (3.2.2) unstable; urgency=low
 .
   * savelog: patch from Patrick Coleman to fix breakage when target file
     does not exist.  closes: #556227.
   * Bump to Standards-Version 3.8.3.
Checksums-Sha1: 
 d481b13632600ca3c65fc13c0805fd66e4627c7a 1523 debianutils_3.2.2.dsc
 9863143364459ba2496548836e3f68230e1c3036 138154 debianutils_3.2.2.tar.gz
 59589b76bc20620a6c2a1a9c99131ee280a1954a 49128 debianutils_3.2.2_amd64.deb
Checksums-Sha256: 
 8fc46e28543b7a1a3a7cbd76fca7c15e0c5633ad265017dd714261ac82a7fb90 1523 
debianutils_3.2.2.dsc
 03d73b5f621aa432f683eb96b1080844fcc6135e6b64f43b9c34f82e74175e7e 138154 
debianutils_3.2.2.tar.gz
 a39c2d04004bce73b75c39355fe0d9a918da2d51fda442ce392d31f462816a28 49128 
debianutils_3.2.2_amd64.deb
Files: 
 c4e46b84cf61b79e6c873a0ced5dbdbb 1523 utils required debianutils_3.2.2.dsc
 1f53745f649f6428159f0bcc9263a8b1 138154 utils required debianutils_3.2.2.tar.gz
 772132c6cc278b46663ad93a6a95268b 49128 utils required 
debianutils_3.2.2_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Debian!

iQIcBAEBCgAGBQJK/vWJAAoJEFWSMx4ZnTioU00P/iei/dYcgFoRcP1MxWTxD6HH
LR4+V8YFO4IsJEfCmUPurKMfovaqFPeZY/H5gQrX32GljSSJWmYeeaz/b3wp6Awc
eo1Fnv3gfpRePp4LOKDBMMDtjWQNjEBdaN5nprswLdGV4t+KFilsJfilbDn/X6QV
XtlOuL96+1/6eBtLTVxP8Mr3ohhEYJaQwqzav0unRNQYajAQFyhm2SrcTd7T+E30
zVbojdN9JbZy87Be5gwQidVUp9fPf6AcBWVt49eVASaofOcaM3KoY2JDRX3ZwCHT
Qf0NZjJiJB+dNn6pp6Pm/VmBY5iTVO7BMPtsNFOz44CvJETCOkxH7sjTxBZQhi6s
JF4yGg3a21Es6ihkmiJifJ6Ah/HJR9LeXF6cLpncVNmwmRxBWTFDh+DWe16Q7gpB
AG1uM3nC+gjAXUhfmh3iml/eEcXqnF8SzDIgP2bzM4h2JRSbilbVVT3Eba6P5P4d
YXS8u0J+U9HIGHCpJptMgZsiq7AOh+drqejVczQuMj60ySDm76xpauDBEKiAn3De
MM+NErZv8TL3QudFx5+yOcS9Zkd998qlk/j8fh3MTHNM99RYonoZhUUnRyvOLQHD
fOWJ11fFwnM8MOmGlMWQ0MGwbgcctkxm2JNfM1DD+ENH/reAxj+Tkx/xBjo02wMB
Sd3bkHqdLWE5ERwcffe9
=e0SK
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to