Displaying 1 result from an estimated 1 matches for "do_restorecon".
2012 Oct 24
1
[PATCH] NEW API: add a new api restorecon
...+ b/daemon/selinux.c
@@ -31,6 +31,10 @@
#include "actions.h"
#include "optgroups.h"
+#define MAX_ARGS 128
+
+GUESTFSD_EXT_CMD(str_restorecon, restorecon);
+
#if defined(HAVE_LIBSELINUX)
int
@@ -106,3 +110,68 @@ do_getcon (void)
}
#endif /* !HAVE_LIBSELINUX */
+
+int
+do_restorecon (const char *pathname,
+ const char *excludedir,
+ const char *labelprefix,
+ int recursion,
+ int force)
+{
+ int r;
+ size_t i = 0;
+ char *buf;
+ char *exdir;
+ char *err;
+ const char *argv[MAX_ARGS];
+
+ buf = sysroot_path (pathnam...