severity 360604 grave
tag 360600 + patch
merge 360600 360604
thanks

Hi,

These two bugs are actually the same, so the patch applies here. Both 
bugs being open for more than 10 days, and this bug is very annoying, as
it prevents me to develop easily for Debian. I suppose it is the same
for other persons.

Therefore I propose to do an NMU. The patch is attached. I will upload 
the package if I don't get any answer in the next two days.

Bye,
Aurelien


-- 
  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [EMAIL PROTECTED]         | [EMAIL PROTECTED]
   `-    people.debian.org/~aurel32 | www.aurel32.net
diff -Nru /tmp/gsJfuyp27O/dchroot-0.12/dchroot.c 
/tmp/voOMZUloxz/dchroot-0.12.1/dchroot.c
--- /tmp/gsJfuyp27O/dchroot-0.12/dchroot.c      2006-01-15 02:08:25.000000000 
+0100
+++ /tmp/voOMZUloxz/dchroot-0.12.1/dchroot.c    2006-04-14 22:29:52.000000000 
+0200
@@ -253,39 +253,44 @@
                         * new chroot. 
                         */
 
-                       int argc = 0;
-                       int i = 0, j = 0;
+                       int command_len = 0;
+                       char *command = NULL;
+                       int i = 0;
                        
-                       while (argv[i++] != NULL) {
-                               argc++;
+                       while (argv[i] != NULL) {
+                               command_len += strlen(argv[i++])+1;
                        }
                        
-                       cmd = malloc(sizeof(char *) * (argc + 5));
+                       cmd = malloc(sizeof(char *) * 6);
+                       command = malloc(sizeof(char) * command_len);
                        
-                       if (!cmd) {
+                       if (!cmd || !command) {
                                dchroot_perror("malloc");
                                exit(EXIT_FAILURE);
                        }
-               
+                       
+                       command[0] = '\0';
+                       for (i=0; argv[i] != NULL; i++) {
+                               if (command[0] != '\0') {
+                                       strcat(command, " ");
+                               }
+                               strcat(command, argv[i]);
+                       }
+                       
                        i = 0;
                        cmd[i++] = "/bin/su";
                        
                        if (opts.dir[0] == '\0') {
-                               /* /bin/su - username argv[0] argv[1] ... */
+                               /* /bin/su - username -c "argv[0] argv[1] ..." 
*/
                                cmd[i++] = "-";
                        } else {
-                               /* /bin/su -p username argv[0] argv[1] ... */
+                               /* /bin/su -p username -c "argv[0] argv[1] ..." 
*/
                                cmd[i++] = "-p";
                        }
                        
                        cmd[i++] = username;
-                       cmd[i++] = "--";
-
-                       while (argv[j] != NULL) {
-                               cmd[i++] = argv[j];
-                               j++;
-                       }
-
+                       cmd[i++] = "-c";
+                       cmd[i++] = command;
                        cmd[i] = NULL;
 
                        if (!opts.quiet) {
diff -Nru /tmp/gsJfuyp27O/dchroot-0.12/debian/changelog 
/tmp/voOMZUloxz/dchroot-0.12.1/debian/changelog
--- /tmp/gsJfuyp27O/dchroot-0.12/debian/changelog       2006-01-15 
02:51:41.000000000 +0100
+++ /tmp/voOMZUloxz/dchroot-0.12.1/debian/changelog     2006-04-14 
22:39:26.000000000 +0200
@@ -1,3 +1,11 @@
+dchroot (0.12.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Apply a patch from Nicolas François to use the new su behaviour.
+    (closes: #276598, #360604, #360600)
+
+ -- Aurelien Jarno <[EMAIL PROTECTED]>  Fri, 14 Apr 2006 22:30:14 +0200
+
 dchroot (0.12) unstable; urgency=low
 
   * Exit with an error if /etc/dchroot.conf is writable by all.

Attachment: signature.asc
Description: Digital signature

Reply via email to