Bug 1412819 - no output when sepolicy interface -l -f missing-file
Summary: no output when sepolicy interface -l -f missing-file
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Vit Mojzis
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-12 21:38 UTC by Milos Malik
Modified: 2019-02-27 12:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-27 12:33:21 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Milos Malik 2017-01-12 21:38:44 UTC
Description of problem:
* sepolicy does not produce any error message or error code if the file does not exist
* the -f option is not described in sepolicy-interface man page
* there is a typo error in the sepolicy-interface man page: desctiprion vs. description

Version-Release number of selected component (if applicable):
policycoreutils-python-2.5-10.2.el7_3.x86_64
policycoreutils-2.5-10.2.el7_3.x86_64
policycoreutils-newrole-2.5-10.2.el7_3.x86_64
policycoreutils-sandbox-2.5-10.2.el7_3.x86_64
policycoreutils-devel-2.5-10.2.el7_3.x86_64

How reproducible:
* always

Steps to Reproduce:
# ls -l /usr/share/selinux/devel/include/system/setrans.if
-rw-r--r--. 1 root root 1331 Jan  4 22:14 /usr/share/selinux/devel/include/system/setrans.if
# ls -l /usr/share/selinux/devel/include/system/xyz.if 
ls: cannot access /usr/share/selinux/devel/include/system/xyz.if: No such file or directory
# sepolicy interface -v -f /usr/share/selinux/devel/include/system/setrans.if -l
setrans_translate_context(domain)  Allow a domain to translate contexts. 
setrans_translate_context
setrans_initrc_domtrans(domain)  Execute setrans server in the setrans domain. 
setrans_initrc_domtrans
setrans_manage_pid_files(domain)  Allow a domain to manage pid files 
setrans_manage_pid_files
# sepolicy interface -v -f /usr/share/selinux/devel/include/system/xyz.if -l
# echo $?
0
#

Expected results:
* the -f option is described in the sepolicy-interface man page
* sepolicy interface produces an error message / code if there is something wrong with the input file
* there are no typo errors in the sepolicy-interface man page

Comment 3 Milos Malik 2017-01-17 10:43:22 UTC
The strace output contains some hints:

# strace -o output.txt sepolicy interface -v -f /usr/share/selinux/devel/include/system/xyz.if -l
# grep "cannot open" output.txt stat("/usr/share/selinux/devel/include/support/segenxml.py: warning: cannot open file /usr/share/selinux/devel/include/system/xyz for read, skipping\n", 0x7ffea6cf3ef0) = -1 ENOENT (No such file or directory)
#

Comment 4 Milos Malik 2017-01-17 10:48:00 UTC
Complete copy&paste from the terminal:

# strace -o output.txt sepolicy interface -v -f /usr/share/selinux/devel/include/system/xyz.if -l
# grep "cannot open" output.txt
stat("/usr/share/selinux/devel/include/support/segenxml.py: warning: cannot open file /usr/share/selinux/devel/include/system/xyz for read, skipping\n", 0x7ffea6cf3ef0) = -1 ENOENT (No such file or directory)
#

Comment 5 Zdenek Pytela 2019-02-27 12:33:21 UTC
This issue was not selected to be included in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small number of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available.

We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise, we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.


Note You need to log in before you can comment on or make changes to this bug.