-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] selinux is not updating the fcontext when execute using salt-call #64625
Comments
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
This seems to be caused by #63336. |
is there any way to check this, as the issue is not random like in #63336 |
@tzarskigss it would be good to see what the contents of files salt://files/resolv_conf-2.j2 and eric/demo-6 in order to ensure correct duplication of the error. If the files contain private information, please strip them down such that the issue is repeatable, otherwise I can guess at the contents but may not cover the exact conditions you are encountering. |
@tzarskigss Btw: prsuming you have a typo since the example at the start needs a leading '/' otherwise
Also presuming the example is eric/demo state, able to reproduce the issue with an empty |
I assume #64950 didn't fix it then? |
@OrangeDog no something else is going on, following the read crumbs in the debugger as we speak :) |
Problem is due to file's fcontext existing and the command generated by Salt is
|
Closing since associated PR #65003 is merged |
Description
When testing the states using salt-call, there is an issue with update the file context using selinux if the file was modified.
Setup
the was found in the RHEL9 and CentOS Stream release 9
State files:
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
touch /root/test-one.txt
check the file properties
Run the state using salt-call
File was updated properly, now check the file
ls -lZ /root/test-one.txt
-rw-r--r--. 1 root root system_u:object_r:net_conf_t:s0 176 Jul 12 04:07 /root/test-one.txt
semanage fcontext -C -l
SELinux fcontext type Context
/root/test-one.txt all files system_u:object_r:net_conf_t:s0
Now update the file
echo "hello" >> /root/test-one.txt
Check the file again
Now trying to update the file again and getting error
Checking the file
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
minion
SALT MASTER
Salt Version:
Salt: 3005.1
Dependency Versions:
cffi: 1.15.1
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.2
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 0.5.6
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.21
pycrypto: 2.6.1
pycryptodome: 3.18.0
pygit2: Not Installed
Python: 3.7.5 (default, Mar 22 2023, 17:31:55)
python-gnupg: Not Installed
PyYAML: 5.4.1
PyZMQ: 19.0.2
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
Salt Extensions:
SSEAPE: 8.12.0.7
System Versions:
dist: photon 3.0 Photon
locale: utf-8
machine: x86_64
release: 4.19.277-1.ph3
system: Linux
version: VMware Photon OS 3.0 Photon
Additional context
The problem does not exist when do the same steps and run the state file form salt-master like
salt centos9 state.apply eric/demo-6
Checked with other minion/ OS combination.
The salt master is 3005.1
RHEL 7 minion is 3005.1
RHEL 8 minion is 3005.1
RHEL 9 minion is 3006.1
The issue is present on both RHEL 8 and RHEL 9, both on 3005.1 and 3006.1.
The text was updated successfully, but these errors were encountered: