Debian Bug report logs - #570695
Fails with absolute symlinks

version graph

Package: makejail; Maintainer for makejail is Javier Fernandez-Sanguino Pen~a <jfs@computer.org>; Source for makejail is src:makejail.

Reported by: Goswin von Brederlow <goswin-v-b@web.de>

Date: Sat, 20 Feb 2010 19:06:02 UTC

Severity: grave

Tags: patch

Found in version makejail/0.0.5-7

Fixed in version makejail/0.0.5-9

Done: Javier Fernandez-Sanguino Pen~a <jfs@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Javier Fernandez-Sanguino Pen~a <jfs@computer.org>:
Bug#570695; Package makejail. (Sat, 20 Feb 2010 19:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Goswin von Brederlow <goswin-v-b@web.de>:
New Bug report received and forwarded. Copy sent to Javier Fernandez-Sanguino Pen~a <jfs@computer.org>. (Sat, 20 Feb 2010 19:06:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Goswin von Brederlow <goswin-v-b@web.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Fails with absolute symlinks
Date: Sat, 20 Feb 2010 20:03:00 +0100
Package: makejail
Version: 0.0.5-7
Severity: grave

Hi,

on amd64 the dynamic linker is /lib64/ld-linux-x86-64.so.2 but /lib64
is a symlink to /lib. When makejail looks for missing files it
correctly detects that /lib64/ld-linux-x86-64.so.2 is missing. It then
detects that /lib64 is a link to /lib and creates it. But then it
claims /lib64/ld-linux-x86-64.so.2 is already installed in the
chroot. I'm assuming it stats $chroot/lib64/ld-linux-x86-64.so.2 and
finds the systems /lib/ld-linux-x86-64.so.2. In any case the ld.so is
not copied into the chroot making it complelty unusable.

MfG
	Goswin

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (499, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31.6-xen-2010.02.18 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages makejail depends on:
ii  binstats                      1.08-8     Statistics tool for installed prog
ii  psmisc                        22.10-1    utilities that use the proc file s
ii  python                        2.5.4-9    An interactive high-level object-o
ii  strace                        4.5.19-1   A system call tracer

makejail recommends no packages.

makejail suggests no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Javier Fernandez-Sanguino Pen~a <jfs@computer.org>:
Bug#570695; Package makejail. (Sun, 14 Mar 2010 13:06:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daiki Ueno <ueno@unixuser.org>:
Extra info received and forwarded to list. Copy sent to Javier Fernandez-Sanguino Pen~a <jfs@computer.org>. (Sun, 14 Mar 2010 13:06:03 GMT) Full text and rfc822 format available.

Message #10 received at 570695@bugs.debian.org (full text, mbox):

From: Daiki Ueno <ueno@unixuser.org>
To: 570695@bugs.debian.org
Subject: Re: Fails with absolute symlinks
Date: Sun, 14 Mar 2010 19:54:47 +0700
[Message part 1 (text/plain, inline)]
tags 570695 +patch
thanks

Hi,

The attached patch will fix the problem (I've already sent it to the
upstream).

Sent from Thailand Mini-DebCamp 2010 BSP:
http://wiki.debian.org/DebianThailand/MiniDebCamp2010/BSP

[Message part 2 (application/pgp-signature, inline)]
[makejail-absolute-symlinks.diff (text/x-diff, inline)]
diff -u makejail-0.0.5/makejail makejail-0.0.5/makejail
--- makejail-0.0.5/makejail
+++ makejail-0.0.5/makejail
@@ -353,7 +353,14 @@
 			moveIndent(1)
 			addFileToJail(checkDir)
 			moveIndent(-1)
-	fileInChroot="%s%s" % (config.chroot,fileName)
+	# The directory part of fileName may be a symlink to an
+	# absolute pathname.  For example, fileName is
+	# "lib64/ld-linux.so.2" where "lib64" is a symlink to "/lib".
+	# In that case it should be resolved before constructing
+	# fileInChroot.  See http://bugs.debian.org/570695.
+	fileDir, baseName = os.path.split(fileName)
+	fileInChroot=os.path.join(config.chroot,os.path.realpath(fileDir)[1:],
+				  baseName)
 	if os.path.exists(fileInChroot):
 		if fileIsNewer(fileName,fileInChroot):
 			debug("   File %s is newer than the %s, overwriting" % (fileName,fileInChroot))
@@ -373,7 +380,9 @@
 			absoluteLinkTarget="%s/%s" % (fileDir,linkTarget)
 		newFiles=addFileToJail(absoluteLinkTarget)
 		missingFiles=missingFiles+newFiles
-		newWorkingDir="%s/%s" % (config.chroot,fileDir[1:])
+		# newWorkingDir may be a symlink to an absolute
+		# pathname.  See the above comment.
+		newWorkingDir="%s/%s" % (config.chroot,os.path.realpath(fileDir)[1:])
 		os.chdir(newWorkingDir)
 		debug("   Creating '%s' as a symlink to '%s' (pwd=%s)" % (fileName[1:],linkTarget,newWorkingDir))
 		os.symlink(linkTarget,os.path.split(fileName)[1])
diff -u makejail-0.0.5/debian/changelog makejail-0.0.5/debian/changelog
--- makejail-0.0.5/debian/changelog
+++ makejail-0.0.5/debian/changelog
@@ -1,3 +1,11 @@
+makejail (0.0.5-8.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix pathname handling when the directory components include absolute
+    symlink (Closes: #570695).
+
+ -- Daiki Ueno <ueno@unixuser.org>  Sun, 14 Mar 2010 18:33:38 +0700
+
 makejail (0.0.5-8) unstable; urgency=low
 
   [ Changes by  Florian Grandel <jerico.dev@gmail.com ]
[Message part 4 (text/plain, inline)]
Regards,
-- 
Daiki Ueno

Added tag(s) patch. Request was from Daiki Ueno <ueno@unixuser.org> to control@bugs.debian.org. (Sun, 14 Mar 2010 13:06:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Javier Fernandez-Sanguino Pen~a <jfs@computer.org>:
Bug#570695; Package makejail. (Sun, 14 Mar 2010 18:21:50 GMT) Full text and rfc822 format available.

Acknowledgement sent to Javier Fernández-Sanguino Peña <jfs@computer.org>:
Extra info received and forwarded to list. Copy sent to Javier Fernandez-Sanguino Pen~a <jfs@computer.org>. (Sun, 14 Mar 2010 18:21:50 GMT) Full text and rfc822 format available.

Message #17 received at 570695@bugs.debian.org (full text, mbox):

From: Javier Fernández-Sanguino Peña <jfs@computer.org>
To: Daiki Ueno <ueno@unixuser.org>, 570695@bugs.debian.org
Subject: Re: Bug#570695: Fails with absolute symlinks
Date: Sun, 14 Mar 2010 19:11:29 +0100
On Sun, Mar 14, 2010 at 07:54:47PM +0700, Daiki Ueno wrote:
> The attached patch will fix the problem (I've already sent it to the
> upstream).

Thanks for the patch, I will try to test it out soon and confirm that it
indeed fixes the issue.

Regards

Javier




Reply sent to Javier Fernandez-Sanguino Pen~a <jfs@debian.org>:
You have taken responsibility. (Sat, 20 Mar 2010 12:03:07 GMT) Full text and rfc822 format available.

Notification sent to Goswin von Brederlow <goswin-v-b@web.de>:
Bug acknowledged by developer. (Sat, 20 Mar 2010 12:03:07 GMT) Full text and rfc822 format available.

Message #22 received at 570695-close@bugs.debian.org (full text, mbox):

From: Javier Fernandez-Sanguino Pen~a <jfs@debian.org>
To: 570695-close@bugs.debian.org
Subject: Bug#570695: fixed in makejail 0.0.5-9
Date: Sat, 20 Mar 2010 12:02:08 +0000
Source: makejail
Source-Version: 0.0.5-9

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

makejail_0.0.5-9.diff.gz
  to main/m/makejail/makejail_0.0.5-9.diff.gz
makejail_0.0.5-9.dsc
  to main/m/makejail/makejail_0.0.5-9.dsc
makejail_0.0.5-9_all.deb
  to main/m/makejail/makejail_0.0.5-9_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 570695@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Javier Fernandez-Sanguino Pen~a <jfs@debian.org> (supplier of updated makejail 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 ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 20 Mar 2010 12:49:51 +0100
Source: makejail
Binary: makejail
Architecture: source all
Version: 0.0.5-9
Distribution: unstable
Urgency: low
Maintainer: Javier Fernandez-Sanguino Pen~a <jfs@computer.org>
Changed-By: Javier Fernandez-Sanguino Pen~a <jfs@debian.org>
Description: 
 makejail   - Automatically create chroot jails for programs
Closes: 570695
Changes: 
 makejail (0.0.5-9) unstable; urgency=low
 .
   * Fix pathname handling when the directory components include absolute
     symlink. Thanks to Daiki Ueno for the patch (Closes: #570695).
Checksums-Sha1: 
 e5265c6fd5586d77865701a20a6e22aa9dc54263 1068 makejail_0.0.5-9.dsc
 63da655228fb627a83ff389545d5fbb0bde8e279 14896 makejail_0.0.5-9.diff.gz
 3557ad02285cafacaa0cff7b3b6077b87ec5285c 35790 makejail_0.0.5-9_all.deb
Checksums-Sha256: 
 c57cbb6626cb7c9e6e488862aae37d8c04b412043341188f71ff22947125bafd 1068 makejail_0.0.5-9.dsc
 155ee11d8a568acf8ba5b6cdb71f13e1fe7175dc6fbdbebc799be30861158081 14896 makejail_0.0.5-9.diff.gz
 02d5c0b6b5fcfc9d2331375116b1c51fcb4eb1b1071ae9847076cdc4881ab597 35790 makejail_0.0.5-9_all.deb
Files: 
 c17647c4c384415524e4e5f8968e725d 1068 admin optional makejail_0.0.5-9.dsc
 d6438ae9e2c39acba91038a22f060274 14896 admin optional makejail_0.0.5-9.diff.gz
 8c7d68bd27ae26742f3e307d64c4ef89 35790 admin optional makejail_0.0.5-9_all.deb

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

iD8DBQFLpLbHsandgtyBSwkRAjn9AJ0bhltlUVGMawOgooVN01goUOUhfgCeJ9/9
IZTW7GGjJSkMmCNWhGa2lls=
=ZUl/
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 07 Mar 2011 10:25:57 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 23 17:39:13 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.