On Thu, 2008-01-31 at 20:32 +0000, Roy Marples wrote:
> On Thu, 2008-01-31 at 18:17 +0000, Roy Marples wrote:
> > Ah yes, it's because there is no helper installed for ext4dev. Ensuring
> > that all helpers exist fixes the error. So it's not handling exec errors
> > correctly. I'll see if I can fix fsck now.
> 
> The execute function does not return when pid is <1, so it stores -1 as
> a pid to kill, which kills quite a bit really :)

Attached is a new patch that free's any malloced memory correctly. BTW,
this behaviour should match upstream as if the don't find a helper then
they free the instance and return even if noexecute is set. As the spawn
function does that as well, we just need to check if pid is less than 1.

Thanks

Roy
diff -ur busybox-1.9.0.orig/e2fsprogs/fsck.c busybox-1.9.0/e2fsprogs/fsck.c
--- busybox-1.9.0.orig/e2fsprogs/fsck.c	2007-12-21 22:00:31.000000000 +0000
+++ busybox-1.9.0/e2fsprogs/fsck.c	2008-02-01 11:34:32.000000000 +0000
@@ -665,6 +665,12 @@
 	for (i = num_args+1; i < argc; i++)
 		free(argv[i]);
 
+	/* No pid, so don't record an instance */
+	if (pid < 0) {
+		free (inst);
+		return;
+	}
+
 	inst->pid = pid;
 	inst->prog = argv[0];
 	inst->type = xstrdup(type);
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to