summaryrefslogtreecommitdiff
path: root/src/selinux.c
AgeCommit message (Collapse)Author
2013-11-28build: fix selinux.c build failure on 32 bitPádraig Brady
* src/selinux.c: Don't include the system "fts.h" as that disallows _FILE_OFFSET_BITS=64 which gnulib auto enables to support large files on 32 bit systems. Instead include our "xfts.h" which includes the less limited gnulib replacement, and also a checked version of xfts_open(). (restorecon): Use the checked xfts_open() rather than the standard fts_open(). Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/6934169
2013-11-27build: avoid more selinux build failuresPádraig Brady
Handle both newer selinux libraries with mode_to_security_class(), and systems without selinux at all. We could easily adjust gnulib to provide the necessary stubs for use by this module, but it's more efficient to just stub out the module completely, when not using selinux. * src/selinux.h: Define stubs for the two module functions, when SELinux is not available. * src/selinux.c: Exclude all logic in preference for the stubs when selinux isn't used. Also when newer selinux libs are used, don't use our conflicting static version of mode_to_security_class(). m4/jm-macros.m4: Check for the system mode_to_security_class().
2013-11-27build: avoid build failure on non selinux systemsPádraig Brady
* src/selinux.c: This module introduced in commit v8.21-159-gd8e27ab doesn't need to include <selinux/flask.h>. That header file isn't catered for by gnulib, but is not needed as we're not explicitly referencing any class IDs. Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/6920020
2013-11-27selinux: a new module implementing "restorecon" functionalityDaniel J Walsh
* src/selinux.c: A new module implementing "restorecon" functionality. There are two main functions to adjust the type of the referenced file system item. defaultcon() will setup the process context so that new items will have the required context without races. This is the preferred method. For existing files, the equivalent restorecon() is available which has two modes. With the "local" parameter set to false, restorecon() will adjust the type according to the system configuration for that file, and set to true will update the context as per the context for the current process (disregarding type). * src/selinux.h: Likewise. * po/POTFILES.in: Reference the new module.