mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-24 11:47:20 +00:00
ipfw: Fix ipfw/dnctl detection
Running "dnctl" vs "/sbin/dnctl" gave different results, because we looked at the entire argv[0] string, rather than the basename. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D37431
This commit is contained in:
parent
b8a0dfb17e
commit
3599da158e
|
@ -30,6 +30,7 @@
|
|||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
|
||||
#include "ipfw2.h"
|
||||
|
||||
|
@ -682,7 +683,7 @@ main(int ac, char *av[])
|
|||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(av[0], "dnctl") == 0)
|
||||
if (strcmp("dnctl", basename(av[0])) == 0)
|
||||
g_co.prog = cmdline_prog_dnctl;
|
||||
else
|
||||
g_co.prog = cmdline_prog_ipfw;
|
||||
|
|
Loading…
Reference in a new issue