Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semanage fcontext man page is vague #457

Open
van-de-bugger opened this issue Dec 26, 2024 · 3 comments
Open

semanage fcontext man page is vague #457

van-de-bugger opened this issue Dec 26, 2024 · 3 comments

Comments

@van-de-bugger
Copy link

$ man semanage fcontext
SYNOPSIS
       semanage  fcontext  [-h]  [-n] [-N] [-S STORE] [ 
           --add ( -t TYPE -f FTYPE -r RANGE -s SEUSER | -e EQUAL ) FILE_SPEC | 
           <...> ]
<...>
OPTIONS
<...>
       -e EQUAL, --equal EQUAL
              Substitute  target  path with sourcepath when generating default
              label. This is used with fcontext. Requires source and target
              path arguments. The context labeling for the target subtree is 
              made equivalent to that defined for the source.
<...>

The help text refers to 'target path' and 'sourcepath' arguments, but Synoposis shows 'EQUAL' and 'FILE_SPEC' placeholders. Where should I put the source path — in place of 'EQUAL' or 'FILE_SPEC'? Where should I put the target path?

@van-de-bugger
Copy link
Author

Help message is not better than man page:

$ semanage fcontext --help
usage: semanage fcontext [-h] [-n] [-N] [-S STORE] [ 
    --add ( -t TYPE -f FTYPE -r RANGE -s SEUSER | -e EQUAL ) FILE_SPEC 
    <...> ]

positional arguments:
  file_spec             Path to be labeled (may be in the form of a Perl 
                        compatible regular expression)

options:
<...>
  -e EQUAL, --equal EQUAL
                        Substitute target path with sourcepath when generating 
                        default label. This is used with fcontext. Requires 
                        source and target path arguments. The context labeling 
                        for the target subtree is made equivalent to that 
                        defined for the source.
<...>

Again, help message refers to 'sourcepath' and 'target path', while placeholders are 'EQUAL' and 'FILE_SPEC'.

BTW, Why 'target path' is spelled with a space, while 'sourcepath' is a single word?

@van-de-bugger
Copy link
Author

I guess the help message should look like:

$ semanage fcontext --help
usage: semanage fcontext [-h] [-n] [-N] [-S STORE] [ 
    --add ( -t TYPE -f FTYPE -r RANGE -s SEUSER | -e SOURCE_PATH ) TARGET_PATH 
    <...> ]

positional arguments:
  TARGET_PATH           Path to be labeled (may be in the form of a Perl 
                        compatible regular expression)

options:
<...>
  -e SOURCE_PATH, --equal SOURCE_PATH
                        Substitute TARGET_PATH with SOURCE_PATH when generating 
                        default label. This is used with fcontext. Requires 
                        SOURCE_PATH and TARGET_PATH arguments. The context labeling 
                        for the target subtree is made equivalent to that 
                        defined for the source.
<...>

I do not propose exact wording, but want to point out that help text must use placeholder names for clarity.

@cgzones
Copy link
Contributor

cgzones commented Jan 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants