pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/53896: mksandbox doesn't fully support relative pathnames



>Number:         53896
>Category:       pkg
>Synopsis:       mksandbox doesn't fully support relative pathnames
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 20 00:30:00 +0000 2019
>Originator:     silas%nocafe.net@localhost
>Release:        NetBSD 7.0.1
>Organization:
	
>Environment:
	
	
System: NetBSD hope 7.0.1 NetBSD 7.0.1 (GENERIC.201605221355Z) amd64
Architecture: x86_64
Machine: amd64
>Description:
pkgtools/mksandbox doesn't support handling relative pathnames that would
indicate the future chroot path.  The script stucks in line 301 or 302
creating sandbox/etc recursivelly in host's (not chroot) /etc.

Changing lines 301 and 302 could work, but what about canonizing the sandbox
path at the beginning?  See patch below.

>How-To-Repeat:
As root, do:

	# cd /tmp
	# mksandbox --without-pkgsrc --without-src --without-xsrc sandbox

But this works:

	# mksandbox --without-pkgsrc --without-src --without-xsrc /tmp/sandbox
>Fix:

--- mksandbox.orig	2019-01-19 21:04:11.000000000 -0200
+++ mksandbox	2019-01-19 21:10:22.000000000 -0200
@@ -246,6 +246,7 @@
 fi
 
 $mkdirprog $sandbox
+sandbox="$(cd $sandbox && pwd)"
 cat > $sandbox_script <<EOS
 #! /bin/sh -
 mounthost=$mounthost

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index