Skip to contentSkip to conversation

libselinux: sefcontext_compile.8 updates

PATCH Superseded Todd Zullinger 2 participants 15 messages Oct 15 – Oct 16 SELinux security module

lore
Share & tools
lore
#0 lore raw

cover libselinux: sefcontext_compile.8 updates

I noticed a few missing entries in sefcontext_compile.8. They are included in the usage string. These patches add them to the documentation.

Todd Zullinger (3):
libselinux: add -r option to sefcontext_compile.8
libselinux: add -i option to sefcontext_compile.8
libselinux: add -V option to sefcontext_compile.8

 libselinux/man/man8/sefcontext_compile.8 | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Signature · 1 line
2.56.0
#1 lore raw

PATCH 1/3 libselinux: add -r option to sefcontext_compile.8

The -r option was added in 50f0910c (libselinux: add support for pcre2, 2016-09-15), initially to "Include precompiled regular expressions in the output" and updated in 36df3755 (libselinux: sefcontext_compile invert semantics of "-r" flag, 2016-09-28) to exclude precompiled regular expressions.

The man page was not updated for either commit, leaving this option documented only the usage string.

---
 libselinux/man/man8/sefcontext_compile.8 | 7 +++++++
 1 file changed, 7 insertions(+)
libselinux/man/man8/sefcontext_compile.8 +7 -0
index 4eae1736..d80a7381 100644
@@ -40,6 +40,13 @@ that will be used to validate the context entries in the
 .br
 If an invalid context is found the pcre formatted file will not be written and
 an error will be returned.
+.TP
+.B \-r
+Omit precompiled regular expressions from the output.
+.br
+(PCRE2 only. Compiled PCRE2 regular expressions are not portable across
+architectures.  Use this flag if you know that you build for an incompatible
+architecture to save space.  When linked against PCRE1 this flag is ignored.)
 
 .SH "RETURN VALUE"
 On error -1 is returned.  On success 0 is returned.
Signature · 1 line
2.56.0
maintainer
#2 lore raw

Re: [PATCH 1/3] libselinux: add -r option to sefcontext_compile.8

Quoted 9 lines · Todd Zullinger

The -r option was added in 50f0910c (libselinux: add support for pcre2, 2016-09-15), initially to "Include precompiled regular expressions in the output" and updated in 36df3755 (libselinux: sefcontext_compile invert semantics of "-r" flag, 2016-09-28) to exclude precompiled regular expressions.

The man page was not updated for either commit, leaving this option documented only the usage string.

only _in_ the usage string. (missing word)

Quoted 2 lines

Your patch is correct but it would be better if it also corrected the SYNOPSIS section to show -i -r -V.
The usage() synopsis line in sefcontext_compile.c similarly only shows [-iV].

#3 lore raw

PATCH 2/3 libselinux: add -i option to sefcontext_compile.8

In reply to Todd Zullinger

The -i option was added in 487d652e (libselinux: sefcontext_compile: Add "-i" flag, 2016-09-28) but the man page was not updated accordingly.

---
 libselinux/man/man8/sefcontext_compile.8 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
libselinux/man/man8/sefcontext_compile.8 +12 -0
index d80a7381..13192e85 100644
@@ -47,6 +47,18 @@ Omit precompiled regular expressions from the output.
 (PCRE2 only. Compiled PCRE2 regular expressions are not portable across
 architectures.  Use this flag if you know that you build for an incompatible
 architecture to save space.  When linked against PCRE1 this flag is ignored.)
+.TP
+.B \-i
+Print regular expression info end exit. That is, back end version and
+architecture identifier.  Arch identifier format (PCRE2):
+.br
+.in +4n
+.EX
+<pointer width>\-<size type width>\-<endianness>
+.EE
+.br
+.in
+e.g., "8-8-el" for x86_64.
 
 .SH "RETURN VALUE"
 On error -1 is returned.  On success 0 is returned.
Signature · 1 line
2.56.0
maintainer
#4 lore raw

Re: [PATCH 2/3] libselinux: add -i option to sefcontext_compile.8

Quoted 14 lines · Todd Zullinger

The -i option was added in 487d652e (libselinux: sefcontext_compile: Add "-i" flag, 2016-09-28) but the man page was not updated accordingly.

---
 libselinux/man/man8/sefcontext_compile.8 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
libselinux/man/man8/sefcontext_compile.8 +0 -0
index d80a7381..13192e85 100644

libselinux/man/man8/sefcontext_compile.8 Omit precompiled regular expressions from the output. · line 52

Quoted 6 lines
libselinux/man/man8/sefcontext_compile.8 +3 -0
@@ -47,6 +47,18 @@ Omit precompiled regular expressions from the output.
 (PCRE2 only. Compiled PCRE2 regular expressions are not portable across
 architectures.  Use this flag if you know that you build for an incompatible
 architecture to save space.  When linked against PCRE1 this flag is ignored.)
+.TP
+.B \-i
+Print regular expression info end exit. That is, back end version and

This is a typo carried over from the usage() string - should be "info and exit" rather than "info end exit".
Please fix in both places.

#5 lore raw

PATCH 3/3 libselinux: add -V option to sefcontext_compile.8

In reply to Todd Zullinger

The -V option was added in 92306daf (libselinux: rework selabel_file(5) database, 2024-11-05), but the man page was not update accordingly.

---
 libselinux/man/man8/sefcontext_compile.8 | 3 +++
 1 file changed, 3 insertions(+)
libselinux/man/man8/sefcontext_compile.8 +3 -0
index 13192e85..e298b1da 100644
@@ -59,6 +59,9 @@ architecture identifier.  Arch identifier format (PCRE2):
 .br
 .in
 e.g., "8-8-el" for x86_64.
+.TP
+.B \-V
+Print binary output format version and exit.
 
 .SH "RETURN VALUE"
 On error -1 is returned.  On success 0 is returned.
Signature · 1 line
2.56.0
maintainer
#6 lore raw

Re: [PATCH 3/3] libselinux: add -V option to sefcontext_compile.8

Quoted 3 lines · Todd Zullinger

The -V option was added in 92306daf (libselinux: rework selabel_file(5) database, 2024-11-05), but the man page was not update accordingly.

s/update/updated/

#7 lore raw

v2 cover libselinux: sefcontext_compile.8 updates

In reply to Todd Zullinger

I noticed a few missing entries in sefcontext_compile.8. They are included in the usage string. These patches add them to the documentation.

I believe I've fixed all the issues noted with v1, but we shall see. Others may turn up still too.

Todd Zullinger (3):
libselinux: add -r option to sefcontext_compile.8
libselinux: add -i option to sefcontext_compile.8
libselinux: add -V option to sefcontext_compile.8

 libselinux/man/man8/sefcontext_compile.8 | 25 ++++++++++++++++++++++++
 libselinux/utils/sefcontext_compile.c    |  4 ++--
 2 files changed, 27 insertions(+), 2 deletions(-)

Range-diff against v1:
1: 2c228939 ! 1: f422645c libselinux: add -r option to sefcontext_compile.8
@@ Commit message
regular expressions.

The man page was not updated for either commit, leaving this option
- documented only the usage string.
+ documented only in the usage string.
+
+ Update the usage string to include "-r" as well.

## libselinux/man/man8/sefcontext_compile.8 ##
+@@ libselinux/man/man8/sefcontext_compile.8: sefcontext_compile \- compile file context regular expression files
+ .
+ .SH "SYNOPSIS"
+ .B sefcontext_compile
++.RB [ \-r ]
+ .RB [ \-o
+ .IR outputfile ]
+ .RB [ \-p
@@ libselinux/man/man8/sefcontext_compile.8: that will be used to validate the context entries in the
.br
If an invalid context is found the pcre formatted file will not be written and
@@ libselinux/man/man8/sefcontext_compile.8: that will be used to validate the cont

.SH "RETURN VALUE"
On error -1 is returned. On success 0 is returned.
+
+ ## libselinux/utils/sefcontext_compile.c ##
+@@ libselinux/utils/sefcontext_compile.c: err:
+ static __attribute__((__noreturn__)) void usage(const char *progname)
+ {
+ fprintf(stderr,
+- "usage: %s [-iV] [-o out_file] [-p policy_file] fc_file\n"
++ "usage: %s [-riV] [-o out_file] [-p policy_file] fc_file\n"
+ "Where:\n\t"
+ "-o Optional file name of the PCRE formatted binary\n\t"
+ " file to be output. If not specified the default\n\t"
2: fdce522e ! 2: b9797123 libselinux: add -i option to sefcontext_compile.8
@@ Commit message
The -i option was added in 487d652e (libselinux: sefcontext_compile: Add "-i" flag, 2016-09-28) but the man page was not updated accordingly.

+ Correct 'info end exit' to 'info and exit' in the usage string.
+

## libselinux/man/man8/sefcontext_compile.8 ##
+@@ libselinux/man/man8/sefcontext_compile.8: sefcontext_compile \- compile file context regular expression files
+ .SH "SYNOPSIS"
+ .B sefcontext_compile
+ .RB [ \-r ]
++.RB [ \-i ]
+ .RB [ \-o
+ .IR outputfile ]
+ .RB [ \-p
@@ libselinux/man/man8/sefcontext_compile.8: Omit precompiled regular expressions from the output.
(PCRE2 only. Compiled PCRE2 regular expressions are not portable across
architectures. Use this flag if you know that you build for an incompatible
architecture to save space. When linked against PCRE1 this flag is ignored.)
+.TP
+.B \-i
-+Print regular expression info end exit. That is, back end version and
++Print regular expression info and exit. That is, back end version and
+architecture identifier. Arch identifier format (PCRE2):
+.br
+.in +4n
@@ libselinux/man/man8/sefcontext_compile.8: Omit precompiled regular expressions f

.SH "RETURN VALUE"
On error -1 is returned. On success 0 is returned.
+
+ ## libselinux/utils/sefcontext_compile.c ##
+@@ libselinux/utils/sefcontext_compile.c: static __attribute__((__noreturn__)) void usage(const char *progname)
+ " if you know that you build for an incompatible\n\t"
+ " architecture to save space. When linked against\n\t"
+ " PCRE1 this flag is ignored.)\n\t"
+- "-i Print regular expression info end exit. That is, back\n\t"
++ "-i Print regular expression info and exit. That is, back\n\t"
+ " end version and architecture identifier.\n\t"
+ " Arch identifier format (PCRE2):\n\t"
+ " <pointer width>-<size type width>-<endianness>, e.g.,\n\t"
3: 738e1a7d ! 3: bbeecfb0 libselinux: add -V option to sefcontext_compile.8
@@ Commit message
libselinux: add -V option to sefcontext_compile.8

The -V option was added in 92306daf (libselinux: rework selabel_file(5)
- database, 2024-11-05), but the man page was not update accordingly.
+ database, 2024-11-05), but the man page was not updated accordingly.

## libselinux/man/man8/sefcontext_compile.8 ##
+@@ libselinux/man/man8/sefcontext_compile.8: sefcontext_compile \- compile file context regular expression files
+ .B sefcontext_compile
+ .RB [ \-r ]
+ .RB [ \-i ]
++.RB [ \-V ]
+ .RB [ \-o
+ .IR outputfile ]
+ .RB [ \-p
@@ libselinux/man/man8/sefcontext_compile.8: architecture identifier. Arch identifier format (PCRE2):
.br
.in

Signature · 1 line
2.56.0
#8 lore raw

PATCH v2 1/3 libselinux: add -r option to sefcontext_compile.8

In reply to Todd Zullinger

The -r option was added in 50f0910c (libselinux: add support for pcre2, 2016-09-15), initially to "Include precompiled regular expressions in the output" and updated in 36df3755 (libselinux: sefcontext_compile invert semantics of "-r" flag, 2016-09-28) to exclude precompiled regular expressions.

The man page was not updated for either commit, leaving this option documented only in the usage string.

Update the usage string to include "-r" as well.

---
 libselinux/man/man8/sefcontext_compile.8 | 8 ++++++++
 libselinux/utils/sefcontext_compile.c    | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
libselinux/man/man8/sefcontext_compile.8 +8 -0
index 4eae1736..11c2bbc3 100644
@@ -4,6 +4,7 @@ sefcontext_compile \- compile file context regular expression files
 .
 .SH "SYNOPSIS"
 .B sefcontext_compile
+.RB [ \-r ]
 .RB [ \-o
 .IR outputfile ]
 .RB [ \-p
@@ -40,6 +41,13 @@ that will be used to validate the context entries in the
 .br
 If an invalid context is found the pcre formatted file will not be written and
 an error will be returned.
+.TP
+.B \-r
+Omit precompiled regular expressions from the output.
+.br
+(PCRE2 only. Compiled PCRE2 regular expressions are not portable across
+architectures.  Use this flag if you know that you build for an incompatible
+architecture to save space.  When linked against PCRE1 this flag is ignored.)
 
 .SH "RETURN VALUE"
 On error -1 is returned.  On success 0 is returned.
libselinux/utils/sefcontext_compile.c +1 -1
index e504b508..02d9a2b5 100644
@@ -524,7 +524,7 @@ err:
 static __attribute__((__noreturn__)) void usage(const char *progname)
 {
 	fprintf(stderr,
-		"usage: %s [-iV] [-o out_file] [-p policy_file] fc_file\n"
+		"usage: %s [-riV] [-o out_file] [-p policy_file] fc_file\n"
 		"Where:\n\t"
 		"-o       Optional file name of the PCRE formatted binary\n\t"
 		"         file to be output. If not specified the default\n\t"
Signature · 1 line
2.56.0
maintainer Acked-by on v2 1/3
#9 lore raw

Re: [PATCH v2 1/3] libselinux: add -r option to sefcontext_compile.8

Quoted 7 lines · Todd Zullinger

The -r option was added in 50f0910c (libselinux: add support for pcre2, 2016-09-15), initially to "Include precompiled regular expressions in the output" and updated in 36df3755 (libselinux: sefcontext_compile invert semantics of "-r" flag, 2016-09-28) to exclude precompiled regular expressions.

Quoted 6 lines

The man page was not updated for either commit, leaving this option documented only in the usage string.

Update the usage string to include "-r" as well.

maintainer
#10 lore raw

Re: [PATCH v2 1/3] libselinux: add -r option to sefcontext_compile.8

Quoted 9 lines · Stephen Smalley
Quoted 7 lines · Todd Zullinger

The -r option was added in 50f0910c (libselinux: add support for pcre2, 2016-09-15), initially to "Include precompiled regular expressions in the output" and updated in 36df3755 (libselinux: sefcontext_compile invert semantics of "-r" flag, 2016-09-28) to exclude precompiled regular expressions.

Quoted 8 lines
Quoted 6 lines

The man page was not updated for either commit, leaving this option documented only in the usage string.

Update the usage string to include "-r" as well.

This series has been merged.

#11 lore raw

PATCH v2 2/3 libselinux: add -i option to sefcontext_compile.8

In reply to Todd Zullinger

The -i option was added in 487d652e (libselinux: sefcontext_compile: Add "-i" flag, 2016-09-28) but the man page was not updated accordingly.

Correct 'info end exit' to 'info and exit' in the usage string.

---
 libselinux/man/man8/sefcontext_compile.8 | 13 +++++++++++++
 libselinux/utils/sefcontext_compile.c    |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
libselinux/man/man8/sefcontext_compile.8 +13 -0
index 11c2bbc3..d5ad3f62 100644
@@ -5,6 +5,7 @@ sefcontext_compile \- compile file context regular expression files
 .SH "SYNOPSIS"
 .B sefcontext_compile
 .RB [ \-r ]
+.RB [ \-i ]
 .RB [ \-o
 .IR outputfile ]
 .RB [ \-p
@@ -48,6 +49,18 @@ Omit precompiled regular expressions from the output.
 (PCRE2 only. Compiled PCRE2 regular expressions are not portable across
 architectures.  Use this flag if you know that you build for an incompatible
 architecture to save space.  When linked against PCRE1 this flag is ignored.)
+.TP
+.B \-i
+Print regular expression info and exit. That is, back end version and
+architecture identifier.  Arch identifier format (PCRE2):
+.br
+.in +4n
+.EX
+<pointer width>\-<size type width>\-<endianness>
+.EE
+.br
+.in
+e.g., "8-8-el" for x86_64.
 
 .SH "RETURN VALUE"
 On error -1 is returned.  On success 0 is returned.
libselinux/utils/sefcontext_compile.c +1 -1
index 02d9a2b5..44728ec6 100644
@@ -537,7 +537,7 @@ static __attribute__((__noreturn__)) void usage(const char *progname)
 		"         if you know that you build for an incompatible\n\t"
 		"         architecture to save space. When linked against\n\t"
 		"         PCRE1 this flag is ignored.)\n\t"
-		"-i       Print regular expression info end exit. That is, back\n\t"
+		"-i       Print regular expression info and exit. That is, back\n\t"
 		"         end version and architecture identifier.\n\t"
 		"         Arch identifier format (PCRE2):\n\t"
 		"         <pointer width>-<size type width>-<endianness>, e.g.,\n\t"
Signature · 1 line
2.56.0
maintainer Acked-by on v2 2/3
#12 lore raw

Re: [PATCH v2 2/3] libselinux: add -i option to sefcontext_compile.8

Quoted 7 lines · Todd Zullinger

The -i option was added in 487d652e (libselinux: sefcontext_compile: Add "-i" flag, 2016-09-28) but the man page was not updated accordingly.

Correct 'info end exit' to 'info and exit' in the usage string.

#13 lore raw

PATCH v2 3/3 libselinux: add -V option to sefcontext_compile.8

In reply to Todd Zullinger

The -V option was added in 92306daf (libselinux: rework selabel_file(5) database, 2024-11-05), but the man page was not updated accordingly.

---
 libselinux/man/man8/sefcontext_compile.8 | 4 ++++
 1 file changed, 4 insertions(+)
libselinux/man/man8/sefcontext_compile.8 +4 -0
index d5ad3f62..8649d04f 100644
@@ -6,6 +6,7 @@ sefcontext_compile \- compile file context regular expression files
 .B sefcontext_compile
 .RB [ \-r ]
 .RB [ \-i ]
+.RB [ \-V ]
 .RB [ \-o
 .IR outputfile ]
 .RB [ \-p
@@ -61,6 +62,9 @@ architecture identifier.  Arch identifier format (PCRE2):
 .br
 .in
 e.g., "8-8-el" for x86_64.
+.TP
+.B \-V
+Print binary output format version and exit.
 
 .SH "RETURN VALUE"
 On error -1 is returned.  On success 0 is returned.
Signature · 1 line
2.56.0