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,10 @@ +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). + + -- Javier Fernandez-Sanguino Pen~a Sat, 20 Mar 2010 12:49:51 +0100 + makejail (0.0.5-8) unstable; urgency=low [ Changes by Florian Grandel