search for: do_getcon

Displaying 4 results from an estimated 4 matches for "do_getcon".

2009 Aug 13
7
[PATCHx7] Misc patches
...-39,7 +37,7 @@ int do_setcon (const char *context) { -#ifdef HAVE_SETCON +#if defined(HAVE_LIBSELINUX) && defined(HAVE_SETCON) if (setcon ((char *) context) == -1) { reply_with_perror ("setcon"); return -1; @@ -55,7 +53,7 @@ do_setcon (const char *context) char * do_getcon (void) { -#ifdef HAVE_GETCON +#if defined(HAVE_LIBSELINUX) && defined(HAVE_GETCON) security_context_t context; char *r; @@ -77,5 +75,3 @@ do_getcon (void) return -1; #endif } - -#endif /* HAVE_LIBSELINUX */ -- 1.6.2.5 -------------- next part -------------- >From 715f3083...
2012 Oct 24
1
[PATCH] NEW API: add a new api restorecon
...nux.c index 40590e1..14bc666 100644 --- a/daemon/selinux.c +++ 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...
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
...This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ do_setcon (const char *context) return 0; #else - NOT_AVAILABLE (-1); + NOT_AVAILABLE (selinux, -1); #endif } @@ -85,6 +85,6 @@ do_getcon (void) return r; /* caller frees */ #else - NOT_AVAILABLE (NULL); + NOT_AVAILABLE (selinux, NULL); #endif } diff --git a/daemon/swap.c b/daemon/swap.c index 51dbbe4..4891470 100644 --- a/daemon/swap.c +++ b/daemon/swap.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd da...
2014 May 24
9
SELinux relabel API
[ I realized that we were discussing adding this feature, in various private email, IRC, and this long bugzilla thread: https://bugzilla.redhat.com/show_bug.cgi?id=1060423 That's not how we should do things. Let's discuss it on the mailing list. ] One thing that virt-customize/virt-sysprep/virt-builder have to do is relabel SELinux guests. What we do at the moment