mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
misc-progs: Fix passing argument list
The run() function expects all arguments without the basename of the
program.
This regression was introduced in a609195a26.
Fixes: #12886
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
df9ebc6bbe
commit
49471f05d5
@@ -11,5 +11,5 @@ int main(int argc, char** argv) {
|
||||
if (!initsetuid())
|
||||
exit(1);
|
||||
|
||||
return run("/var/ipfire/backup/bin/backup.pl", argv);
|
||||
return run("/var/ipfire/backup/bin/backup.pl", argv + 1);
|
||||
}
|
||||
|
||||
@@ -11,5 +11,5 @@ int main(int argc, char** argv) {
|
||||
if (!initsetuid())
|
||||
exit(1);
|
||||
|
||||
return run("/var/ipfire/extrahd/bin/extrahd.pl", argv);
|
||||
return run("/var/ipfire/extrahd/bin/extrahd.pl", argv + 1);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ int main(int argc, char** argv)
|
||||
// but /sbin/iptables is actually a symlink to /sbin/xtables-legacy-multi hence that program is executed
|
||||
// however without the notion that it was called as "iptables". So we have to pass "iptables" as first
|
||||
// argument.
|
||||
char *args[10] = {"iptables", "--list", "--verbose", "--numeric", "--wait", "5", NULL, NULL, NULL, NULL};
|
||||
char *args[] = {"--list", "--verbose", "--numeric", "--wait", "5", NULL, NULL, NULL, NULL};
|
||||
char *usage = "getipstat [-x][-f|-n|-m]";
|
||||
unsigned int pcount = 6;
|
||||
unsigned int table_set = 0;
|
||||
|
||||
@@ -11,5 +11,5 @@ int main(int argc, char** argv) {
|
||||
if (!initsetuid())
|
||||
exit(1);
|
||||
|
||||
return run("/var/ipfire/mpfire/bin/mpfire.pl", argv);
|
||||
return run("/var/ipfire/mpfire/bin/mpfire.pl", argv + 1);
|
||||
}
|
||||
|
||||
@@ -11,5 +11,5 @@ int main(int argc, char** argv) {
|
||||
if (!initsetuid())
|
||||
exit(1);
|
||||
|
||||
return run("/opt/pakfire/pakfire", argv);
|
||||
return run("/opt/pakfire/pakfire", argv + 1);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) {
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/sbin/useradd -c 'Samba User' -m -g sambauser -s /bin/false %s >/dev/null", argv[2]);
|
||||
safe_system(command);
|
||||
|
||||
run("/usr/sbin/samba-change-password", argv + 1);
|
||||
run("/usr/sbin/samba-change-password", argv + 2);
|
||||
|
||||
} else if (strcmp(argv[1], "smbchangepw") == 0) {
|
||||
if (!is_valid_argument_alnum(argv[2])) {
|
||||
@@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
|
||||
exit(2);
|
||||
}
|
||||
|
||||
run("/usr/sbin/samba-change-password", argv + 1);
|
||||
run("/usr/sbin/samba-change-password", argv + 2);
|
||||
|
||||
} else if (strcmp(argv[1], "readsmbpasswd") == 0) {
|
||||
safe_system("/bin/chown root:nobody /var/ipfire/samba/private >/dev/null");
|
||||
|
||||
Reference in New Issue
Block a user