]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
enosys: add the missing arguments of -s and -i to the usage text
authorBenno Schulenberg <bensberg@telfort.nl>
Mon, 31 Mar 2025 09:44:34 +0000 (11:44 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Apr 2025 11:04:50 +0000 (13:04 +0200)
Also, add a docstring, drop the redundant double dash from the synopsis,
add the missing -m option, and add a missing word to an error message.

CC: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
misc-utils/enosys.c

index 1410676dd3c5f4dd2bcb93bf54b9eb3b45c15829..b7469c6bf76f452c9647a77d65426ab772b3008a 100644 (file)
@@ -78,13 +78,17 @@ static void __attribute__((__noreturn__)) usage(void)
        FILE *out = stdout;
 
        fputs(USAGE_HEADER, out);
-       fprintf(out, _(" %s [options] -- <command>\n"), program_invocation_short_name);
+       fprintf(out, _(" %s [options] <command>\n"), program_invocation_short_name);
+
+       fputs(USAGE_SEPARATOR, out);
+       fputs(_("Block certain system calls while running a command.\n"), out);
 
        fputs(USAGE_OPTIONS, out);
-       fputs(_(" -s, --syscall           syscall to block\n"), out);
-       fputs(_(" -i, --ioctl             ioctl to block\n"), out);
-       fputs(_(" -l, --list              list known syscalls\n"), out);
-       fputs(_(" -d, --dump[=<file>]     dump seccomp bytecode\n"), out);
+       fputs(_(" -s, --syscall <name>|<nr>    system call to block\n"), out);
+       fputs(_(" -i, --ioctl <name>|<nr>      ioctl to block\n"), out);
+       fputs(_(" -l, --list                   list known system calls\n"), out);
+       fputs(_(" -m, --list-ioctl             list known ioctls\n"), out);
+       fputs(_(" -d, --dump[=<file>]          dump bytecode of seccomp filter\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
        fprintf(out, USAGE_HELP_OPTIONS(25));
@@ -297,7 +301,7 @@ int main(int argc, char **argv)
                err_nosys(EXIT_FAILURE, _("Could not run prctl(PR_SET_NO_NEW_PRIVS)"));
 
        if (ul_set_seccomp_filter_spec_allow(&prog))
-               err_nosys(EXIT_FAILURE, _("Could not seccomp filter"));
+               err_nosys(EXIT_FAILURE, _("Could not set seccomp filter"));
 
        if (execvp(argv[optind], argv + optind))
                err(EXIT_NOTSUPP, _("Could not exec"));