When learning SELinux, I executed
semanage fcontext -l > fcontext.txt under
/root directory to dump massive fcontext information to a file. The funny result is:
fcontext.txt was created, but the size of it is 0.
I asked in #fedora-selinux IRC channel, a Fedora QA told me try change the type of SELinux context of
semanage_tmp_t. It works finally.
But what still confusing me is:
Which process/program create/write the standard output to the redirected file ? (so that SELinux targetd policy should applied to that process/program)
- The bash shell ?
- or semanage (it's a python script) ?
- or the interpreter - python ?
I thought it should be the bash shell, because I/O redirection is controlled by shell (right?), not the program itself. so semanage/python didn't create the file directly.