libselinux: 0/2 Refactor Handling of /proc/pid/attr/*
PATCH 1/1 libselinux: 0/2 Refactor Handling of /proc/pid/attr/*
The follow patch set will rework libselinux to now include generic get and set functions for reading and writing contexts to the interfaces found in /proc/pid/addr/ The individual libselinux calls will tell the generic function the path to the attr along with the current context information.
Patch 1/2: Introduce {get,set}procattrcon - These are the 2 functions that will actually do the work of reading a writing
Patch 2/2: Convert old users to new generic function -{get,set}fscreatecon()
-{get,set}execcon()
-{get,set}con() - the old setcon() had a special check for attempting to write null and would fail with -1; From my testing this is the same thing that happens if you actually try to write null to the pid file so special casing this was not needed. getcon_raw() was also used elsewhere in libselinux, so it is left. The other caller could be made to pass a path directly to the generic call, or be made to not use the _raw interfaces in the future.....
-getpidcon()
-getprevcon() - again there were other users of getprevcon_raw inside selinux, so it was left
Eric
--
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.