[Buildd-tools-devel] Bug#279408: dchroot still does not work well with spaces in arguments

Timo Juhani Lindfors timo.lindfors at iki.fi
Mon Sep 11 18:57:11 UTC 2006


Hi,

although dchroot does not use su(1) anymore I think this bug is still
present.

Steps to reproduce:
1) cat > printargs.c <<EOF
#include <stdio.h>
int main(int argc, char *argv[]) {
        int i;
        for (i=0; i<argc; i++)
                printf("argv[%d] = \"%s\"\n", i, argv[i]);
        return 0;
}
EOF
2) gcc printargs.c -o printargs
3) Make sure /etc/dchroot.conf defaults to a debian unstable chroot.
4) dchroot -q -- ./printargs normal a spaces "b c" dash - dashletter -v dashes -- normalagain ee

Expected results:
4) The output of printargs should be the same as when used without dchroot
(./printargs normal a spaces "b c" dash - dashletter -v dashes -- normalagain ee):
argv[0] = "./printargs"
argv[1] = "normal"
argv[2] = "a"
argv[3] = "spaces"
argv[4] = "b c"
argv[5] = "dash"
argv[6] = "-"
argv[7] = "dashletter"
argv[8] = "-v"
argv[9] = "dashes"
argv[10] = "--"
argv[11] = "normalagain"
argv[12] = "ee"


Actual results:
4) The output from printargs differes because spaces inside arguments
are not handled properly:
argv[0] = "./printargs"
argv[1] = "normal"
argv[2] = "a"
argv[3] = "spaces"
argv[4] = "b"
argv[5] = "c"
argv[6] = "dash"
argv[7] = "-"
argv[8] = "dashletter"
argv[9] = "-v"
argv[10] = "dashes"
argv[11] = "--"
argv[12] = "normalagain"
argv[13] = "ee"

Please let me know if you can't reproduce this bug.

best regards,
Timo Lindfors
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20060911/609aafb8/attachment.pgp


More information about the Buildd-tools-devel mailing list