Your message dated Mon, 02 Jun 2008 23:32:10 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#483605: fixed in jailer 0.4-15
has caused the Debian Bug report #483605,
regarding updatejail deletes entire home dir if config filename is mistyped
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.)


-- 
483605: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=483605
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: jailer
Version: 0.4-9
Severity: normal
Tags: patch

As subject line.  Since updatejail is normally run as root, this can be
a bit of an unfortunate side effect of what would otherwise be a trivial
accident !

Attached is a patch which fixes the issue, as well as adding other safety
and efficiency fixes such as fewer 'find's and clearer prompts/errors.
More could undoubtedly be done but I feel this will do for now !

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (600, 'stable'), (480, 'proposed-updates'), (80, 'testing'), (3, 
'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-k7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages jailer depends on:
ii  cpio                      2.6-18.1+etch1 GNU cpio -- a program to manage ar
ii  perl [perl5]              5.8.8-7etch3   Larry Wall's Practical Extraction 

jailer recommends no packages.

-- no debconf information
--- updatejail.orig	2006-11-03 02:07:10.000000000 +0000
+++ updatejail	2008-05-29 22:48:48.000000000 +0100
@@ -7,39 +7,47 @@
 "
 
 
-if [ Q$1 == "Q" -o Q$2 == "Q" ]
+if [ "Q$1" == "Q" -o "Q$2" == "Q" ]
 then
-	echo "Usage: upratejail <config.file> <jail identifier>"
+	echo "Usage: updatejail <config.file> <jail identifier>"
 else
 
-	JAIL=`cat $1 | grep Root: | grep $2 | awk '{print $2}'`
-	echo "jail: " $JAIL
+	if [ ! -f "$1" ]; then
+		echo "$1: file not found"
+		exit 1
+	fi
+	JAIL=`cat "$1" | grep Root: | grep "$2" | awk '{print $2}'`
+	echo "jail: $JAIL"
 	echo "config: " $1
-	read
+	read -p "Press ENTER to continue"
+
+	echo "$KEEP" > /tmp/$$.updatejail.keep
 
-	
-	if test -d $JAIL
+	if test -d "$JAIL"
 	then
-		cd $JAIL
+		set -e
+
+		cd "$JAIL"
+
+		find "$JAIL" \( -type b \
+		             -o -type c \
+		             -o -type p \
+		             -o -type f \
+		             -o -type l \
+		             -o -type s \) -print > /tmp/$$.updatejail
 
-		find $JAIL -type b > /tmp/$$.updatejail
-		find $JAIL -type c >> /tmp/$$.updatejail
-		find $JAIL -type p >> /tmp/$$.updatejail
-		find $JAIL -type f >> /tmp/$$.updatejail
-		find $JAIL -type l >> /tmp/$$.updatejail
-		find $JAIL -type s >> /tmp/$$.updatejail
 		for i in `echo $KEEP`
 		do
-			cat /tmp/$$.updatejail | grep -v $JAIL$i > /tmp/$$.updatejail.tmp
+			grep -v "^$JAIL$i\$" /tmp/$$.updatejail > /tmp/$$.updatejail.tmp
 			mv /tmp/$$.updatejail.tmp /tmp/$$.updatejail
 		done
-		for i in `cat /tmp/$$.updatejail`
-		do
-			rm $i
-		done
+
+		cat /tmp/$$.updatejail | xargs -r rm
+
 		rm /tmp/$$.updatejail
-		/usr/sbin/jailer $1 $2
+
+		/usr/sbin/jailer "$1" "$2"
 	else
-		echo "This jail does not exist!"
+		echo "Jail directory '$JAIL' does not exist!"
 	fi
 fi

--- End Message ---
--- Begin Message ---
Source: jailer
Source-Version: 0.4-15

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

jailer_0.4-15.diff.gz
  to pool/main/j/jailer/jailer_0.4-15.diff.gz
jailer_0.4-15.dsc
  to pool/main/j/jailer/jailer_0.4-15.dsc
jailer_0.4-15_all.deb
  to pool/main/j/jailer/jailer_0.4-15_all.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.
Javier Fernandez-Sanguino Pen~a <[EMAIL PROTECTED]> (supplier of updated jailer 
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: SHA1

Format: 1.8
Date: Tue, 03 Jun 2008 01:17:35 +0200
Source: jailer
Binary: jailer
Architecture: source all
Version: 0.4-15
Distribution: unstable
Urgency: low
Maintainer: Javier Fernandez-Sanguino Pen~a <[EMAIL PROTECTED]>
Changed-By: Javier Fernandez-Sanguino Pen~a <[EMAIL PROTECTED]>
Description: 
 jailer     - Builds and maintains chrooted environments
Closes: 483605
Changes: 
 jailer (0.4-15) unstable; urgency=low
 .
   * Improvements to the updatejail script based on patch provided by
     Nick Leverton (Closes: 483605)
Checksums-Sha1: 
 275ec7a1f2aa07676c0e6de0efd9b4ba53ab8610 953 jailer_0.4-15.dsc
 ed1791468197ffb58bacef24b5aeb3bcfb4bd2b1 31003 jailer_0.4-15.diff.gz
 8b42528d6293c701d3386ddfbeb1288eb94c0888 12536 jailer_0.4-15_all.deb
Checksums-Sha256: 
 1fa4f712d6efbe123a934a0b25da30b53377f7dc59fad7d159fa0eaf6489b522 953 
jailer_0.4-15.dsc
 3a3c012ae9b76519ad3961fb85a9dc78700c37db718a231c2e472a77ff5969af 31003 
jailer_0.4-15.diff.gz
 daee33b774b844bbe6c55b6431ed97de90fc32cc45b340d9d9699ed9d533eef4 12536 
jailer_0.4-15_all.deb
Files: 
 cd87d0169d529380b764db22726bf165 953 admin optional jailer_0.4-15.dsc
 740ec3f74311bddb23d2ea2ba01588d5 31003 admin optional jailer_0.4-15.diff.gz
 d0c4cd1891b99d73cee53c8d83539908 12536 admin optional jailer_0.4-15_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIRH/JsandgtyBSwkRAmbkAKCDMdKrcwyehTd/Ak+Z6Xe3D5ih2ACggci4
TUaBKp+tCzLPekKtHw4g8x8=
=A9qc
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to