Skip to contentSkip to conversation

checkpolicy: Add -S option to manpage

PATCH In review Vit Mojzis 2 participants 5 messages Feb 5, 2019 – Feb 10, 2019 SELinux security module

lore
Share & tools
lore

Vit Mojzis

author
#0 lore raw

PATCH 1/1 checkpolicy: Add -S option to manpage

---
 checkpolicy/checkpolicy.8 | 3 +++
 1 file changed, 3 insertions(+)
checkpolicy/checkpolicy.8 +3 -0
index 1c8805d5..a3e4acc0 100644
@@ -39,6 +39,9 @@ Write a binary policy file to the specified filename.
 .B \-c policyvers
 Specify the policy version, defaults to the latest.
 .TP
+.B \-S,\-\-sort
+Sort ocontexts before writing out the binary policy. This option makes output of checkpolicy consistent with binary policies created by semanage and secilc.
+.TP
 .B \-t,\-\-target
 Specify the target platform (selinux or xen).
 .TP
Signature · 1 line
2.17.2
#1 lore raw
Quoted 2 lines · Vit Mojzis

Thanks for your patch. Nevertheless the synopsis of the command in the man page is still incomplete. Could you please update it too, and while at it add the missing flags that are already documented in the manpage too?

Nicolas

Quoted 21 lines
---
 checkpolicy/checkpolicy.8 | 3 +++
 1 file changed, 3 insertions(+)
checkpolicy/checkpolicy.8 +3 -1
index 1c8805d5..a3e4acc0 100644
@@ -39,6 +39,9 @@ Write a binary policy file to the specified filename.
 .B \-c policyvers
 Specify the policy version, defaults to the latest.
 .TP
+.B \-S,\-\-sort
+Sort ocontexts before writing out the binary policy. This option makes output of checkpolicy consistent with binary policies created by semanage and secilc.
+.TP
 .B \-t,\-\-target
 Specify the target platform (selinux or xen).
 .TP
--

2.17.2

author
#2 lore raw

PATCH 1/1 checkpolicy: Update manpage

- Add description of -S option
- Sort the option descriptions based on the synopsis
- Add missing options to synopsis

---
 checkpolicy/checkpolicy.8 | 19 +++++++++++--------
 checkpolicy/checkpolicy.c |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)
checkpolicy/checkpolicy.8 +11 -8
index 1c8805d5..8f7dad41 100644
@@ -3,7 +3,7 @@
 checkpolicy \- SELinux policy compiler
 .SH SYNOPSIS
 .B checkpolicy
-.I "[\-b[F]] [\-C] [\-d] [\-M] [\-c policyvers] [\-o output_file] [input_file]"
+.I "[\-b[F]] [\-C] [\-d] [\-U handle_unknown (allow,deny,reject)] [\-M] [\-c policyvers] [\-o output_file] [\-S] [\-t target_platform (selinux,xen)] [\-V] [input_file]"
 .br
 .SH "DESCRIPTION"
 This manual page describes the
@@ -21,30 +21,33 @@ policy.conf or policy, depending on whether the \-b flag is specified.
 .B \-b,\-\-binary
 Read an existing binary policy file rather than a source policy.conf file.
 .TP
+.B \-F,\-\-conf
+Write policy.conf file rather than binary policy file. Can only be used with binary policy file.
+.TP
 .B \-C,\-\-cil
 Write CIL policy file rather than binary policy file.
 .TP
 .B \-d,\-\-debug
 Enter debug mode after loading the policy.
 .TP
-.B \-F,\-\-conf
-Write policy.conf file rather than binary policy file. Can only be used with binary policy file.
+.B \-U,\-\-handle-unknown <action>
+Specify how the kernel should handle unknown classes or permissions (deny, allow or reject).
 .TP
 .B \-M,\-\-mls
 Enable the MLS policy when checking and compiling the policy.
 .TP
+.B \-c policyvers
+Specify the policy version, defaults to the latest.
+.TP
 .B \-o,\-\-output filename
 Write a binary policy file to the specified filename.
 .TP
-.B \-c policyvers
-Specify the policy version, defaults to the latest.
+.B \-S,\-\-sort
+Sort ocontexts before writing out the binary policy. This option makes output of checkpolicy consistent with binary policies created by semanage and secilc.
 .TP
 .B \-t,\-\-target
 Specify the target platform (selinux or xen).
 .TP
-.B \-U,\-\-handle-unknown <action>
-Specify how the kernel should handle unknown classes or permissions (deny, allow or reject).
-.TP
 .B \-V,\-\-version
 Show version information.
 .TP
checkpolicy/checkpolicy.c +1 -1
index 14dc91a3..e0a00f7c 100644
@@ -113,7 +113,7 @@ static __attribute__((__noreturn__)) void usage(const char *progname)
 	printf
 	    ("usage:  %s [-b[F]] [-C] [-d] [-U handle_unknown (allow,deny,reject)] [-M] "
 	     "[-c policyvers (%d-%d)] [-o output_file] [-S] "
-	     "[-t target_platform (selinux,xen)] [input_file]\n",
+	     "[-t target_platform (selinux,xen)] [-V] [input_file]\n",
 	     progname, POLICYDB_VERSION_MIN, POLICYDB_VERSION_MAX);
 	exit(1);
 }
Signature · 1 line
2.17.2
Acked-by on v1 1/1
#3 lore raw

Re: [PATCH] checkpolicy: Update manpage

Quoted 6 lines · Vit Mojzis

- Add description of -S option
- Sort the option descriptions based on the synopsis
- Add missing options to synopsis

Quoted 75 lines
---
 checkpolicy/checkpolicy.8 | 19 +++++++++++--------
 checkpolicy/checkpolicy.c |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)
checkpolicy/checkpolicy.8 +11 -8
index 1c8805d5..8f7dad41 100644
@@ -3,7 +3,7 @@
 checkpolicy \- SELinux policy compiler
 .SH SYNOPSIS
 .B checkpolicy
-.I "[\-b[F]] [\-C] [\-d] [\-M] [\-c policyvers] [\-o output_file] [input_file]"
+.I "[\-b[F]] [\-C] [\-d] [\-U handle_unknown (allow,deny,reject)] [\-M] [\-c policyvers] [\-o output_file] [\-S] [\-t target_platform (selinux,xen)] [\-V] [input_file]"
 .br
 .SH "DESCRIPTION"
 This manual page describes the
@@ -21,30 +21,33 @@ policy.conf or policy, depending on whether the \-b flag is specified.
 .B \-b,\-\-binary
 Read an existing binary policy file rather than a source policy.conf file.
 .TP
+.B \-F,\-\-conf
+Write policy.conf file rather than binary policy file. Can only be used with binary policy file.
+.TP
 .B \-C,\-\-cil
 Write CIL policy file rather than binary policy file.
 .TP
 .B \-d,\-\-debug
 Enter debug mode after loading the policy.
 .TP
-.B \-F,\-\-conf
-Write policy.conf file rather than binary policy file. Can only be used with binary policy file.
+.B \-U,\-\-handle-unknown <action>
+Specify how the kernel should handle unknown classes or permissions (deny, allow or reject).
 .TP
 .B \-M,\-\-mls
 Enable the MLS policy when checking and compiling the policy.
 .TP
+.B \-c policyvers
+Specify the policy version, defaults to the latest.
+.TP
 .B \-o,\-\-output filename
 Write a binary policy file to the specified filename.
 .TP
-.B \-c policyvers
-Specify the policy version, defaults to the latest.
+.B \-S,\-\-sort
+Sort ocontexts before writing out the binary policy. This option makes output of checkpolicy consistent with binary policies created by semanage and secilc.
 .TP
 .B \-t,\-\-target
 Specify the target platform (selinux or xen).
 .TP
-.B \-U,\-\-handle-unknown <action>
-Specify how the kernel should handle unknown classes or permissions (deny, allow or reject).
-.TP
 .B \-V,\-\-version
 Show version information.
 .TP
checkpolicy/checkpolicy.c +1 -2
index 14dc91a3..e0a00f7c 100644
@@ -113,7 +113,7 @@ static __attribute__((__noreturn__)) void usage(const char *progname)
        printf
            ("usage:  %s [-b[F]] [-C] [-d] [-U handle_unknown (allow,deny,reject)] [-M] "
             "[-c policyvers (%d-%d)] [-o output_file] [-S] "
-            "[-t target_platform (selinux,xen)] [input_file]\n",
+            "[-t target_platform (selinux,xen)] [-V] [input_file]\n",
             progname, POLICYDB_VERSION_MIN, POLICYDB_VERSION_MAX);
        exit(1);
 }
--

2.17.2

#4 lore raw

Re: [PATCH] checkpolicy: Update manpage

Quoted 10 lines · Nicolas Iooss
Quoted 6 lines · Vit Mojzis

- Add description of -S option
- Sort the option descriptions based on the synopsis
- Add missing options to synopsis

Merged.

Nicolas

Quoted 75 lines
Quoted 75 lines
---
 checkpolicy/checkpolicy.8 | 19 +++++++++++--------
 checkpolicy/checkpolicy.c |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)
checkpolicy/checkpolicy.8 +11 -8
index 1c8805d5..8f7dad41 100644
@@ -3,7 +3,7 @@
 checkpolicy \- SELinux policy compiler
 .SH SYNOPSIS
 .B checkpolicy
-.I "[\-b[F]] [\-C] [\-d] [\-M] [\-c policyvers] [\-o output_file] [input_file]"
+.I "[\-b[F]] [\-C] [\-d] [\-U handle_unknown (allow,deny,reject)] [\-M] [\-c policyvers] [\-o output_file] [\-S] [\-t target_platform (selinux,xen)] [\-V] [input_file]"
 .br
 .SH "DESCRIPTION"
 This manual page describes the
@@ -21,30 +21,33 @@ policy.conf or policy, depending on whether the \-b flag is specified.
 .B \-b,\-\-binary
 Read an existing binary policy file rather than a source policy.conf file.
 .TP
+.B \-F,\-\-conf
+Write policy.conf file rather than binary policy file. Can only be used with binary policy file.
+.TP
 .B \-C,\-\-cil
 Write CIL policy file rather than binary policy file.
 .TP
 .B \-d,\-\-debug
 Enter debug mode after loading the policy.
 .TP
-.B \-F,\-\-conf
-Write policy.conf file rather than binary policy file. Can only be used with binary policy file.
+.B \-U,\-\-handle-unknown <action>
+Specify how the kernel should handle unknown classes or permissions (deny, allow or reject).
 .TP
 .B \-M,\-\-mls
 Enable the MLS policy when checking and compiling the policy.
 .TP
+.B \-c policyvers
+Specify the policy version, defaults to the latest.
+.TP
 .B \-o,\-\-output filename
 Write a binary policy file to the specified filename.
 .TP
-.B \-c policyvers
-Specify the policy version, defaults to the latest.
+.B \-S,\-\-sort
+Sort ocontexts before writing out the binary policy. This option makes output of checkpolicy consistent with binary policies created by semanage and secilc.
 .TP
 .B \-t,\-\-target
 Specify the target platform (selinux or xen).
 .TP
-.B \-U,\-\-handle-unknown <action>
-Specify how the kernel should handle unknown classes or permissions (deny, allow or reject).
-.TP
 .B \-V,\-\-version
 Show version information.
 .TP
checkpolicy/checkpolicy.c +1 -2
index 14dc91a3..e0a00f7c 100644
@@ -113,7 +113,7 @@ static __attribute__((__noreturn__)) void usage(const char *progname)
        printf
            ("usage:  %s [-b[F]] [-C] [-d] [-U handle_unknown (allow,deny,reject)] [-M] "
             "[-c policyvers (%d-%d)] [-o output_file] [-S] "
-            "[-t target_platform (selinux,xen)] [input_file]\n",
+            "[-t target_platform (selinux,xen)] [-V] [input_file]\n",
             progname, POLICYDB_VERSION_MIN, POLICYDB_VERSION_MAX);
        exit(1);
 }
--

2.17.2