summaryrefslogtreecommitdiff
path: root/lib/fstree/selinux.c
AgeCommit message (Collapse)Author
2019-07-30Add propper copyright headers to all source filesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-07-24Enable largefile supportMatt Turner
Requires that config.h be included before other headers, since the macro _FILE_OFFSET_BITS changes the definitions of things like 'struct stat'. I chose to simply include it at the top of every C file and at immediately after the double-inclusion guards of every header. Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-07-01Fix uninitialize return status in fstree_relabel_selinuxDavid Oberhollenzer
Should the inode table theoretically be empty, the function returns an undefined value. This commit fixes that case by initializing the return status to 0, so it returns success status in that case. Bug found using scan-build. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-06-22simplify SELinux labelingDavid Oberhollenzer
This commit moves the SELinux label code after the tree is sorted and the inode table is generated. Sorting helps to make sure that the tree will always be traversed in a defined, deterministic order and likewise the creation of xattrs happens in a defined, deterministic order. Second, we can now use the inode table instead of having to implement a recursive tree traversal yet again. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-06-10Add generic function to produce a full path from an fstree nodeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-05-19Add SELinux labeling to fstree codeDavid Oberhollenzer
Use libselinux to lookup the context attributes from a file. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>