| Summary: | semodule doesn't support input from stdin | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Dominik 'Rathann' Mierzejewski <dominik> |
| Component: | policycoreutils | Assignee: | Petr Lautrbach <plautrba> |
| Status: | CLOSED CANTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | dwalsh, mgrepl, plautrba, pmoore, vmojzis |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-10-25 07:12:12 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
'semodule -i' uses a filename as a module name and for detection if the module uses pp or cil language. In your case, 'semodule -i -' would create a module called '-' and wouldn't know what if it's cil or pp. Well, how about adding command line options to set the module name and the "language" together with stdin input support? Please send your ideas and rationale to upstream mailing list at selinux.gov When it's accepted we can backport it to Fedora. |
Description of problem: semodule -i doesn't support input from stdin Version-Release number of selected component (if applicable): policycoreutils-2.5-13.fc24.x86_64 How reproducible: Always. Steps to Reproduce: # echo '(allow psad_t psad_var_log_t(file (read rename unlink write)))' | semodule -i semodule: option requires an argument -- 'i' usage: semodule [options]... MODE [MODES]... [...] # echo '(allow psad_t psad_var_log_t(file (read rename unlink write)))' | semodule -i - libsemanage.map_file: Unable to open - (No such file or directory). libsemanage.semanage_direct_install_file: Unable to read file - (No such file or directory). semodule: Failed on -! Expected results: Successful policy import. Additional info: This would be useful in rpm scriptlets while avoiding temporary file creation. For now, I'm using this: TMPDIR=$(%{_bindir}/mktemp -d) cat >> $TMPDIR/psad-rpm.cil << __EOF__ (allow psad_t psad_var_log_t(file (read rename unlink write))) __EOF__ %{_sbindir}/semodule -i $TMPDIR/psad-rpm.cil rm $TMPDIR/psad-rpm.cil && rmdir $TMPDIR