[BusyBox] [PATCH] Minor bug in start_stop_daemon.c

Stewart Brodie stewart at metahusky.net
Wed Jan 21 16:11:30 UTC 2004


The code which detects whether or not you have used exactly one of -K or -S
options is broken: it fails to detect both options being used.  This is
probably a fault caused by changes to the option parsing.  With the scheme
in place right now, "start" will be 0 or 1 and "stop" will be 0 or *2* (not
1 as the code assumes).  The following patch fixes the problem by inverting
the two values before comparison - it may be worth investigating whether the
same fault affects the debianutils package.



Index: debianutils/start_stop_daemon.c
===================================================================
RCS file: /var/cvs/busybox/debianutils/start_stop_daemon.c,v
retrieving revision 1.10
diff -b -w -u -r1.10 start_stop_daemon.c
--- debianutils/start_stop_daemon.c     30 Jul 2003 08:29:56 -0000      1.10
+++ debianutils/start_stop_daemon.c     21 Jan 2004 16:02:01 -0000
@@ -214,7 +214,7 @@
                signal_nr = bb_xgetlarg(signame, 10, 0, NSIG);
        }

-       if (start == stop)
+       if (!start == !stop)
                bb_error_msg_and_die ("need exactly one of -S or -K");

        if (!execname && !userspec)


-- 
Stewart Brodie



More information about the busybox mailing list