Package: multistrap
Version: 2.1.16
Severity: normal
multistrap sometimes fails to recognise FAKEROOT environents, and the
reaosn is this weird method to test for it:
my $e=`LC_ALL=C printenv`;
if ($e !~ /\nFAKEROOTKEY=[0-9]+\n/) {
if (($e =~ /\nUSER=root\n/)) {
This is sensitive to the order printenv prints the env variables (no \n if
its the first env var).
A better (and much faster) way to test env variables would be to check %ENV
directly, I would think:
if (exists $ENV{FAKEROOTKEY}) {
if ($ENV{USER} eq "root") {
...
This applies to all other places where it checks using printenv.
Looking through the code, there are other weird constructs:
$retval = system ("$str $env chroot $dir dpkg --configure -a");
$retval /= 256;
if ($retval != 0) {
=> dividing by 256 does nothing here, probbaly what was meant was >>= 8?
(but I guess testing for the original retval != 0 is best).
This /= 256 or -256 code shows up a number of times too, all likely not
having the intended effect of removing the lower 8 bits.
There is also weird code saving and restoring the current directory,
often by inefficiently calling "pwd". Many of these are unecessary and
convoluted, for example:
chdir ("$dir/bin");
symlink ("dash", "sh");
chdir ("$old");
Which more succinctly should be:
symlink "dash", "$dir/bin/sh";
There is also generally _no quoting_ whatever done to arguments passed to
shell code, and generally, the less safe non-list form is used - having
paths with spaces in them, or other "funny" characters will wreak havoc.
Somehow I got sad and stopped reading the code at this point :)
-- System Information:
Debian Release: 6.0.3
APT prefers stable
APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing'), (1,
'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages multistrap depends on:
ii apt 0.8.15.9 Advanced front-end for dpkg
ii libconfig-auto-perl 0.20-2 Magical config file parser
ii libparse-debian-packag 0.01-2 parse the data from a Debian Packa
ii perl 5.10.1-17squeeze2 Larry Wall's Practical Extraction
Versions of packages multistrap recommends:
ii emdebian-archive-keyring 2.0.1 GnuPG archive keys for the emdebia
Versions of packages multistrap suggests:
ii fakeroot 1.14.4-1 Gives a fake root environment
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]