It's not really dchroot at fault, it's su(1) brokenness.  su gets the
arguments seperately, but blats them all out for sh.  Here's a patch for
dchroot to work around that behavior.  No special work required, 
dchroot ls "a b" "c d" correctly passes it on and looks up "a b" and 
"c d".  This "breaks" wildcard expansion, but in fact the previous 
behavior was an artifact.  You'd have to run something like ls "*"
to get it to expand on the chroot rather then the local side.

Really, we need to fix su(1).  That's not likely, though, I'm
sure it'd blow away compatability.  Suck in the relevant source
to dchroot and skip the call to su(1) entirely?

--- dchroot.c.orig      2005-04-09 15:51:31.000000000 -0400
+++ dchroot.c   2005-05-01 02:12:25.000000000 -0400
@@ -261,7 +261,10 @@
                        cmd[i++] = "--";
 
                        while (argv[j] != NULL) {
-                               cmd[i++] = argv[j];
+                               int l=strlen(argv[j]);
+                               cmd[i] = malloc(l+3);
+                               snprintf(cmd[i], l+3, "\"%s\"", argv[j]);
+                               i++;
                                j++;
                        }
 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to