Re: [PATCH] policycoreutils: Using vendor defined directories for configuration files

Johannes Segitz <[email protected]> Wed, 29 Jul 2026 11:33:54 +0200
Newsgroups org.kernel.vger.selinux
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 11:00:25AM -0400, Stephen Smalley wrote:
> On Tue, Jul 28, 2026 at 5:27 AM Johannes Segitz <[email protected]> wrote:
> > +       error = econf_getKeys(key_file, SECTIONPROCS, &key_number, &keys);
> > +       if (error != ECONF_SUCCESS) {
> > +               printf("\nCannot read group %s: %s\n",
> > +                      SECTIONPROCS,
> > +                      econf_errString( error ));
> 
> Do you want to print this message even for ECONF_NOKEY?
> Previously we ignored missing sections silently.

I think it would be benefitial, but I don't feel strongly about this. If
you prefer ECONF_NOKEY can also be excluded

> >  static void load_checks(char *pc[], int *npc, char *fc[], int *nfc)
> >  {
> > +#ifdef VENDORDIR
> > +       load_checks_with_vendor_settings(pc, npc, fc, nfc);
> > +       return;
> > +#endif
> >         FILE *fp = fopen(CONF, "r");
> >         char buf[255], *bufp;
> >         int buf_len, section = -1;
> 
> This code doesn't pass make check-format; can fix on merge if desired.

Depending on the decision on ECONF_NOKEY I'll do it if I need to resend a
v2

> > diff --git a/policycoreutils/sestatus/sestatus.conf.5 b/policycoreutils/sestatus/sestatus.conf.5
> > index acfedf6f..01f8051d 100644
> > --- a/policycoreutils/sestatus/sestatus.conf.5
> > +++ b/policycoreutils/sestatus/sestatus.conf.5
> > @@ -8,7 +8,7 @@ The \fIsestatus.conf\fR file is used by the \fBsestatus\fR(8) command with the \
> >  .sp
> >  The fully qualified path name of the configuration file is:
> >  .RS
> > -\fI/etc/sestatus.conf\fR
> > +\fI/etc/sestatus.conf\fR or \fI<vendordir>/sestatus.conf\fR if it is not available
> 
> This says "or" but econf_readDirs() will merge the two - should say layered.

I talked to Stefan and he intentionally used or here because of
https://github.com/uapi-group/specifications/blob/main/specs/configuration_files_specification.md#masking

Johannes
-- 
GPG Key                EE16 6BCE AD56 E034 BFB3  3ADD 7BF7 29D5 E7C8 1FA0
Subkey fingerprint:    250F 43F5 F7CE 6F1E 9C59  4F95 BC27 DD9D 2CC4 FD66
SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg, Germany
www.suse.com, Geschäftsführer: Jochen Jaser, Andrew McDonald, Abhinav Puri, (HRB 36809, AG Nürnberg)
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJPBAEBCgA5FiEEJQ9D9ffObx6cWU+VvCfdnSzE/WYFAmppyQEbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJELwn3Z0sxP1m8TwQAK1XnJ9UVqNhvDL4cpRo
hVIi4beUJdXry4Z781Xky68wd2GgaD5JGgmE4KccYGOZf7h1nuw111XZV2aBxjcc
MNNp/8fKw19tM3mBTxXIm/Jc0Z8b/jA8mXERZ0M1Z1Fgr40R5P4NYjc5V66Ldiue
qjeCMAaFlmIwO2hNwyFdwIVh3cK7EOwZEuObXJTjsa/6zCoj8Q4V+VV01hsfVott
z6TQe2/Fo1nkBP2UmPJJl4aKyDVF1W2PihHDWyUnqMO6LWCrEb1RvEdEIVhmBhBI
uJ0ArPX6DlnT3sjbgSlcr0aQeQzgniMI+A/GbliKVb06m2qatLKMYhFmRwmgXscb
/ejj4ZGL/05TfY8EbiWZjJhEiPzgAVmoGbdg7dPdYk+pUpjwxDJGmwm8j/Yy5Y3a
iwzUPetlms/hmeAyrzeFMlhFZLSVd41S6c1vgOhUbCF+16RM5/vzWad8aIZQ3mn3
AW1bjXPXcwLAhabNOKvaBr7hn+qNBZ5r5N2TwmTKIaRJ5FaIjc0TU4Pa+r/3XrzE
DaODx1Gef3RV7ojnAonY2WDebezSeHhxCf59SJTnkVWLmRwdg9ronGwow1G2seY8
c9IRx3dl1w/wRA5mtGvybf1keqWanuhz+ymuL4pvz9f3otbzXF2S1czBe9jpdBx6
x6zj7uT4BRMCCjhr5TCX9YNt
=mD2G
-----END PGP SIGNATURE-----