Re: restorecon ignoring my policy

Sam Varshavchik via selinux <[email protected]> Sat, 28 Dec 2024 08:28:01 -0500
Newsgroups gmane.linux.redhat.fedora.selinux
Message-ID <[email protected]>
This is a MIME GnuPG-signed message.  If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.

--===============6346309672590913539==
Content-Type: multipart/signed;
    boundary="=_ripper.email-scan.com-186012-1735392481-0001";
    micalg=pgp-sha1; protocol="application/pgp-signature"

This is a MIME GnuPG-signed message.  If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.

--=_ripper.email-scan.com-186012-1735392481-0001
Content-Type: text/plain; format=flowed; delsp=yes; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

> Something happened with the most recent selinux update in F41, breaking my  
> local policy.
>
> [root@jack ~]# semanage fcontext -l | grep httportmapd
> /usr/sbin/httportmapd                              regular file        
> system_u:object_r:libcxx_httportmapd_exec_t:s0
>
> This is coming from a local policy module I cobbled together and installed,  
> yet:
>
> [root@jack ~]# ls -alZ /usr/sbin/httportmapd
> -rwxr-xr-x. 1 root root system_u:object_r:bin_t:s0 318104 Sep 21  2018  
> /usr/sbin/httportmapd
>
> And restorecon -F /usr/sbin/httportmapd does not fix the context, and stays  
> silent no matter how many -v options I feed to it.
>
> Any idea why my file context is not being used?

This looks like a bigger issue, and not just with my module.

There's another explicit file context set for /usr/sbin/smartd. semanage  
says:

/usr/sbin/smartd                                   regular file       system_u:object_r:fsdaemon_exec_t:s0

However:

[root@jack ~]# ls -alZ /usr/sbin/smartd
-rwxr-xr-x. 1 root root system_u:object_r:bin_t:s0 671608 Jul 19 20:00 /usr/sbin/smartd

And restorecon thinks this is peachy.

I note that semanage fcontext lists, separately:

/usr/sbin = /usr/bin

Not sure if this is related, or not. I do see stuff in /usr/sbin with other  
labels, namely /usr/sbin/xl2tpd. I don't see how it's set, this does not  
appear in the output of semanage fcontext.


--=_ripper.email-scan.com-186012-1735392481-0001
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCZ2/84QAKCRCKYPgoojZS
4qDIAP0fpMALMhKsV0w8SQd5ocWj90N2ElZ1oPyw4WDh4/NEdwD9F6JToa7T7Z8+
DoCMRU1LA5HJhKOKBZUfeiAAIlXbLQU=
=uhHN
-----END PGP SIGNATURE-----

--=_ripper.email-scan.com-186012-1735392481-0001--

--===============6346309672590913539==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

LS0gCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCnNlbGlu
dXggbWFpbGluZyBsaXN0IC0tIHNlbGludXhAbGlzdHMuZmVkb3JhcHJvamVjdC5vcmcKVG8gdW5z
dWJzY3JpYmUgc2VuZCBhbiBlbWFpbCB0byBzZWxpbnV4LWxlYXZlQGxpc3RzLmZlZG9yYXByb2pl
Y3Qub3JnCkZlZG9yYSBDb2RlIG9mIENvbmR1Y3Q6IGh0dHBzOi8vZG9jcy5mZWRvcmFwcm9qZWN0
Lm9yZy9lbi1VUy9wcm9qZWN0L2NvZGUtb2YtY29uZHVjdC8KTGlzdCBHdWlkZWxpbmVzOiBodHRw
czovL2ZlZG9yYXByb2plY3Qub3JnL3dpa2kvTWFpbGluZ19saXN0X2d1aWRlbGluZXMKTGlzdCBB
cmNoaXZlczogaHR0cHM6Ly9saXN0cy5mZWRvcmFwcm9qZWN0Lm9yZy9hcmNoaXZlcy9saXN0L3Nl
bGludXhAbGlzdHMuZmVkb3JhcHJvamVjdC5vcmcKRG8gbm90IHJlcGx5IHRvIHNwYW0sIHJlcG9y
dCBpdDogaHR0cHM6Ly9wYWd1cmUuaW8vZmVkb3JhLWluZnJhc3RydWN0dXJlL25ld19pc3N1ZQo=

--===============6346309672590913539==--