aboutsummaryrefslogtreecommitdiff
path: root/src/rc/checkpath.c
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2015-03-25 00:57:05 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2015-03-25 01:01:38 -0500
commita4cf61e8bf827dc405a547c314e840dab11fc979 (patch)
tree7a9d9c900ec5dd0940159e7e9a13bb22148f800a /src/rc/checkpath.c
parentd38cc8f2210e839c4935208917138e4809ece758 (diff)
selinux: unconditionally include the header and provide stub methods
If selinux is disabled, then stub methods will be provided instead of calling the real methods. This removes some warnings about unused parameters which used to be covered up with #ifdef HAVE_SELINUX. Signed-off-by: Jason Zaman <jason@perfinion.com>
Diffstat (limited to 'src/rc/checkpath.c')
-rw-r--r--src/rc/checkpath.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 034cb4d2..3acb0406 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -45,10 +45,7 @@
#include "builtins.h"
#include "einfo.h"
#include "rc-misc.h"
-
-#ifdef HAVE_SELINUX
#include "rc-selinux.h"
-#endif
typedef enum {
inode_unknown = 0,
@@ -164,8 +161,10 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
}
}
+#ifdef HAVE_SELINUX
if (selinux_on)
selinux_util_label(path);
+#endif
return 0;
}
@@ -294,10 +293,8 @@ int checkpath(int argc, char **argv)
if (gr)
gid = gr->gr_gid;
-#ifdef HAVE_SELINUX
if (selinux_util_open() == 1)
selinux_on = true;
-#endif
while (optind < argc) {
if (writable)
@@ -307,10 +304,8 @@ int checkpath(int argc, char **argv)
optind++;
}
-#ifdef HAVE_SELINUX
if (selinux_on)
selinux_util_close();
-#endif
return retval;
}