Skip to contentSkip to conversation

dpkg helper for libselinux

PATCH Stephen Smalley 2 participants 2 messages Jan 25, 2005 1 message not in the archive SELinux security module

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 4 lines · Lorenzo Hernández García-Hierro

Attached you can find a patch that adds Debian package manager (dpkg) helper code to libselinux so It will work under the proper dpkg_t context type (as Russell defines on his policy packages for Debian). Man page updated and such.

Thanks. However, rather than adding another special purpose helper, I'd prefer to create a general function that will work for both rpm and dpkg, and any other package management software. The only aspect that is truly rpm-specific of rpm_execcon is the default type, and this could be read from a config file instead; however, changing it to use a configuration file needs to be done carefully because of the bootstrapping problem, i.e. rpm_execcon has to work even for an initial installation from scratch (and we are now also encountering an issue with getting it to work in a chroot'd environment for rpm --root). That isn't too different than the issue with having file_contexts available for matchpathcon(); the solution IIUC there was to change the installer (anaconda) to create an initial file_contexts configuration for bootstrapping; it could also create a pkghelper_context configuration file or similar. I've cc'd the list and several other people as I think this is a issue of general interest.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 6 lines · Stephen Smalley
Quoted 4 lines · Lorenzo Hernández García-Hierro

Attached you can find a patch that adds Debian package manager (dpkg) helper code to libselinux so It will work under the proper dpkg_t context type (as Russell defines on his policy packages for Debian). Man page updated and such.

Quoted 15 lines

Thanks. However, rather than adding another special purpose helper, I'd prefer to create a general function that will work for both rpm and dpkg, and any other package management software. The only aspect that is truly rpm-specific of rpm_execcon is the default type, and this could be read from a config file instead; however, changing it to use a configuration file needs to be done carefully because of the bootstrapping problem, i.e. rpm_execcon has to work even for an initial installation from scratch (and we are now also encountering an issue with getting it to work in a chroot'd environment for rpm --root). That isn't too different than the issue with having file_contexts available for matchpathcon(); the solution IIUC there was to change the installer (anaconda) to create an initial file_contexts configuration for bootstrapping; it could also create a pkghelper_context configuration file or similar. I've cc'd the list and several other people as I think this is a issue of general interest.

Right, I think that the configuration file support seems the best solution but also we may want to add a "default" configuration, compiled-in, that gets used when no "external" configuration is available, this could help to avoid unexpected errors due to bootstrapping and such.

Thanks for your interest, It was nothing more than a simple idea but seems going to be more interesting ;)

Cheers,

Signature · 2 lines
Lorenzo Hernández García-Hierro <[email protected]> 
[1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]