search for: have_libselinux

Displaying 20 results from an estimated 39 matches for "have_libselinux".

2013 May 16
1
[PATCH] Fix compiler warning when libselinux is not present
static function selinux_warning() isn't used if HAVE_LIBSELINUX isn't defined, which results in a warning. --- src/launch-libvirt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 4588602..10a4d2c 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -138,7 +138,10 @@ static int make_driv...
2009 Aug 14
1
[PATCH libguestfs] build: avoid "make sytnax-check" failure
...aemon/configure.ac b/daemon/configure.ac index 62c28ee..b0c7f26 100644 --- a/daemon/configure.ac +++ b/daemon/configure.ac @@ -68,7 +68,7 @@ dnl Check for libselinux (optional). AC_CHECK_HEADERS([selinux/selinux.h]) AC_CHECK_LIB([selinux],[setexeccon],[ LIBS="-lselinux $LIBS" - have_libselinux="$ac_cv_header_selinux_selinux_h" + have_libselinux="$ac_cv_header_selinux_selinux_h" AC_CHECK_FUNCS([setcon getcon]) ],[have_libselinux=no]) if test "x$have_libselinux" = "xyes"; then -- 1.6.4.357.gfd68c
2009 Aug 13
7
[PATCHx7] Misc patches
...daemon/selinux.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/daemon/selinux.c b/daemon/selinux.c index ad5eaa1..575baf5 100644 --- a/daemon/selinux.c +++ b/daemon/selinux.c @@ -30,8 +30,6 @@ #include "daemon.h" #include "actions.h" -#ifdef HAVE_LIBSELINUX - /* setcon is only valid under the following circumstances: * - single threaded * - enforcing=0 @@ -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_wit...
2012 Feb 14
1
[PATCH RFC] blkid: start using libblkid directly instead
...liance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */ #ifdef DEBIAN diff --git a/configure.ac b/configure.ac index cc11b2f..0beef28 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,16 @@ if test "x$have_libselinux" = "xyes"; then AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) fi AC_SUBST([SELINUX_LIB]) +AC_CHECK_HEADERS([blkid/blkid.h]) +AC_CHECK_LIB([blkid],[blkid_new_probe],[ + have_libblkid="$ac_cv_header_blkid_blkid_h" + LIBBLKID=&q...
2012 Oct 24
1
[PATCH] NEW API: add a new api restorecon
...diff --git a/daemon/selinux.c b/daemon/selinux.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; +...
2019 Nov 27
5
[v2v PATCH v2 0/5] Various build cleanups
Brought to you by the "I haven't rebuilt the libguestfs universe in a while" saga -- now with working test suite. Pino Toscano (5): build: remove extra gnulib submodule build: remove extra checks and submodules build: stop using gnulib in test-harness build: remove unused gnulib modules Remove extra entries from podfiles .gitmodules | 3 -- Makefile.am
2019 Nov 27
6
[v2v PATCH 0/5] Various build cleanups
Brought to you by the "I haven't rebuilt the libguestfs universe in a while" saga. Pino Toscano (5): build: remove extra gnulib submodule build: remove extra checks and submodules build: stop using gnulib in test-harness build: remove unused gnulib modules Remove extra entries from podfiles .gitmodules | 3 -- Makefile.am | 2 - bootstrap
2015 Sep 10
1
[PATCH] launch: libvirt: Better error when bridge / virbr0 doesn't exist (RHBZ#1262127).
...+181,7 @@ static int is_blk (const char *path); static void ignore_errors (void *ignore, virErrorPtr ignore2); static void set_socket_create_context (guestfs_h *g); static void clear_socket_create_context (guestfs_h *g); +static int check_bridge_exists (guestfs_h *g, const char *brname); #if HAVE_LIBSELINUX static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data); @@ -393,6 +394,9 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri) } guestfs_pop_error_handler (g); + if (g->enable_network && check_bridge_exists (g, da...
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
From: "Richard W.M. Jones" <rjones at redhat.com> Callers are supposed to use the availability API to check for functions that may not be available in particular builds of libguestfs. If they don't do this, currently they tend to get obscure error messages, eg: libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory This commit changes the error
2019 May 24
0
[PATCH 2/2] launch: libvirt: fix custom hypervisor check
...truct backend_libvirt_data *data) { + if (g->hv && STRNEQ (g->hv, data->default_qemu)) + return 1; #ifdef QEMU - return g->hv && STRNEQ (g->hv, QEMU); -#else - return 1; + if (STRNEQ (data->default_qemu, QEMU)) + return 1; #endif + return 0; } #if HAVE_LIBSELINUX @@ -1265,7 +1267,7 @@ construct_libvirt_xml_devices (guestfs_h *g, /* Path to hypervisor. Only write this if the user has changed the * default, otherwise allow libvirt to choose the best one. */ - if (is_custom_hv (g)) + if (is_custom_hv (g, params->data)) single_...
2019 May 30
0
[PATCH nbdkit 2/2] server: Disable Nagle's algorithm.
...o.h> +#include <assert.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> +#include <netinet/in.h> +#include <netinet/tcp.h> #include <netdb.h> -#include <poll.h> -#include <errno.h> -#include <assert.h> #ifdef HAVE_LIBSELINUX #include <selinux/selinux.h> @@ -273,6 +275,7 @@ accept_connection (int listen_sock) pthread_t thread; struct thread_data *thread_data; static size_t instance_num = 1; + const int flag = 1; thread_data = malloc (sizeof *thread_data); if (!thread_data) { @@ -293,6 +296,11 @@...
2019 May 30
2
[PATCH nbdkit 1/2] nbd: Fix -Werror=maybe-uninitialized warning.
GCC is concerned that if we never go round the loop then fd will be uninitialized. By asserting that getaddrinfo set result != NULL we can avoid this. nbd.c: In function ‘nbd_open_handle’: nbd.c:974:5: error: ‘fd’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 974 | close (fd); | ^~~~~~~~~~ nbd.c:954:7: note: ‘fd’ was declared here 954 | int fd;
2014 May 26
2
[PATCH 2/2] Use setfiles from the appliance for the SELinux relabel (RHBZ#1089100).
...#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> #ifdef HAVE_SELINUX_SELINUX_H #include <selinux/selinux.h> @@ -31,6 +33,8 @@ #include "actions.h" #include "optgroups.h" +GUESTFSD_EXT_CMD(str_setfiles, setfiles); + #if defined(HAVE_LIBSELINUX) int @@ -92,28 +96,188 @@ OPTGROUP_SELINUX_NOT_AVAILABLE #endif /* !HAVE_LIBSELINUX */ int -do_selinux_relabel (const char *root) +optgroup_selinuxtools_available (void) +{ + return prog_exists (str_setfiles); +} + +#define SELINUXTYPE "SELINUXTYPE" + +static int +has_selinux_moun...
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
2019 May 24
3
[PATCH 0/2] libvirt: fix check of custom QEMU
In case you configure libguestfs with a custom QEMU, e.g.: $ ./configure [...] QEMU=/path/to/qemu then the libvirt backend did not use to override it, launching the appliance with the default QEMU for libvirt. This does not change the manual emulator overriding using set-hv. Pino Toscano (2): launch: libvirt: get default QEMU from domcapabilities launch: libvirt: fix custom hypervisor
2018 Dec 06
0
[PATCH v2] Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
...+166,6 @@ static int is_blk (const char *path); static void ignore_errors (void *ignore, virErrorPtr ignore2); static void set_socket_create_context (guestfs_h *g); static void clear_socket_create_context (guestfs_h *g); -static int check_bridge_exists (guestfs_h *g, const char *brname); #if HAVE_LIBSELINUX static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data); @@ -448,17 +446,8 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri) guestfs_get_backend_setting (g, "internal_libvirt_imagelabel"); data->selinux_norela...
2018 Dec 06
2
[PATCH v2] Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
Let's actually compile and test the patch this time, rather than trusting the RHEL 7.6 patch to apply directly to head ... Rich.
2014 Jan 01
0
[PATCH] Allow ./configure --without-qemu.
...d51 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -622,7 +622,11 @@ parse_capabilities (guestfs_h *g, const char *capabilities_xml, static int is_custom_hv (guestfs_h *g) { +#ifdef QEMU return g->hv && STRNEQ (g->hv, QEMU); +#else + return 1; +#endif } #if HAVE_LIBSELINUX diff --git a/tests/regressions/rhbz501893.c b/tests/regressions/rhbz501893.c index fdd49c8..f4091bf 100644 --- a/tests/regressions/rhbz501893.c +++ b/tests/regressions/rhbz501893.c @@ -50,7 +50,9 @@ main (int argc, char *argv[]) assert (guestfs_set_path (g, NULL) == 0); assert (guestfs_set_...
2019 Oct 18
0
[PATCH nbdkit] Add support for AF_VSOCK.
...include <stdbool.h> +#include <inttypes.h> #include <string.h> #include <unistd.h> #include <poll.h> @@ -47,6 +48,10 @@ #include <netinet/tcp.h> #include <netdb.h> +#ifdef HAVE_LINUX_VM_SOCKETS_H +#include <linux/vm_sockets.h> +#endif + #ifdef HAVE_LIBSELINUX #include <selinux/selinux.h> #endif @@ -247,6 +252,74 @@ bind_tcpip_socket (size_t *nr_socks) return socks; } +int * +bind_vsock (size_t *nr_socks) +{ +#ifdef AF_VSOCK + uint32_t vsock_port; + int sock; + int *ret; + struct sockaddr_vm addr; + + if (port == NULL) + vsock_port...
2019 Oct 18
1
[PATCH nbdkit v2] Add support for AF_VSOCK.
v1 was discussed here: https://www.redhat.com/archives/libguestfs/2019-October/thread.html#00100 v2: - Bind to VMADDR_CID_ANY (instead of HOST) and update the documentation accordingly. - Don't bother with SOCK_CLOEXEC fallback path that can never be used. Rich.