All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpolicy/test: Show all options for dispol and dismod in -h
@ 2026-04-20 12:41 Vit Mojzis
  2026-05-13 15:03 ` James Carter
  0 siblings, 1 reply; 3+ messages in thread
From: Vit Mojzis @ 2026-04-20 12:41 UTC (permalink / raw)
  To: selinux

Show the following options, which were hidden in the usage message,
because they require additional input:

dispol:
  7    change a boolean value
  f    set output file
  m    display menu
  q    quit

dismod:
  l    Link in a module
  f    set output file
  m    display menu
  q    quit

Fixes:
  $dispol -h
  Usage:
   sedispol [OPTIONS] binary_pol_file

  Options:
   -h, --help   print this help message
   -a, --actions ACTIONS   run non-interactively

  Actions:
    1    display unconditional AVTAB
    2    display conditional AVTAB (entirely)
    3    display conditional AVTAB (only ENABLED rules)
    4    display conditional AVTAB (only DISABLED rules)
    5    display booleans
    6    display conditional expressions
    8    display role transitions
    c    display policy capabilities
    C    display classes
    u    display users
    r    display roles
    t    display types
    a    display type attributes
    p    display the list of permissive types
    U    display unknown handling setting
    F    display filename_trans rules

  With the patch:

  Actions:
    1    display unconditional AVTAB
    2    display conditional AVTAB (entirely)
    3    display conditional AVTAB (only ENABLED rules)
    4    display conditional AVTAB (only DISABLED rules)
    5    display booleans
    6    display conditional expressions
    7    change a boolean value
    8    display role transitions
    c    display policy capabilities
    C    display classes
    u    display users
    r    display roles
    t    display types
    a    display type attributes
    p    display the list of permissive types
    U    display unknown handling setting
    F    display filename_trans rules
    f    set output file
    m    display menu
    q    quit

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
---
 checkpolicy/test/dismod.c | 3 +--
 checkpolicy/test/dispol.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/checkpolicy/test/dismod.c b/checkpolicy/test/dismod.c
index 4868190f..ed5aaa45 100644
--- a/checkpolicy/test/dismod.c
+++ b/checkpolicy/test/dismod.c
@@ -106,8 +106,7 @@ static __attribute__((__noreturn__)) void usage(const char *progname)
 	puts("");
 	puts("Actions:");
 	for (unsigned int i = 0; commands[i].meta != EOL; i++) {
-		if (commands[i].meta == HEADER
-		    || commands[i].meta & NOOPT)
+		if (!(commands[i].meta & CMD))
 			continue;
 		printf("  %c    %s\n", commands[i].cmd, commands[i].desc);
 	}
diff --git a/checkpolicy/test/dispol.c b/checkpolicy/test/dispol.c
index 3f80c1a2..c3339b88 100644
--- a/checkpolicy/test/dispol.c
+++ b/checkpolicy/test/dispol.c
@@ -79,8 +79,7 @@ static __attribute__((__noreturn__)) void usage(const char *progname)
 	puts("");
 	puts("Actions:");
 	for (unsigned int i = 0; commands[i].meta != EOL; i++) {
-		if (commands[i].meta == HEADER
-		    || commands[i].meta & NOOPT)
+		if (!(commands[i].meta & CMD))
 			continue;
 		printf("  %c    %s\n", commands[i].cmd, commands[i].desc);
 	}
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-15 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 12:41 [PATCH] checkpolicy/test: Show all options for dispol and dismod in -h Vit Mojzis
2026-05-13 15:03 ` James Carter
2026-05-15 14:06   ` Petr Lautrbach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.