yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-build-rename-CONFIG_LIBCAP-to-CONFIG_LIBCAP_NG.patch

902636
From f756c1c4590a37c533ec0429644a7034ba35dada Mon Sep 17 00:00:00 2001
902636
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
902636
Date: Mon, 27 Jan 2020 19:00:38 +0100
902636
Subject: [PATCH 007/116] build: rename CONFIG_LIBCAP to CONFIG_LIBCAP_NG
902636
MIME-Version: 1.0
902636
Content-Type: text/plain; charset=UTF-8
902636
Content-Transfer-Encoding: 8bit
902636
902636
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
Message-id: <20200127190227.40942-4-dgilbert@redhat.com>
902636
Patchwork-id: 93459
902636
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 003/112] build: rename CONFIG_LIBCAP to CONFIG_LIBCAP_NG
902636
Bugzilla: 1694164
902636
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
902636
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
902636
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
902636
902636
From: Paolo Bonzini <pbonzini@redhat.com>
902636
902636
Since we are actually testing for the newer capng library, rename the
902636
symbol to match.
902636
902636
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
902636
(cherry picked from commit a358bca24026a377e0804e137a4499e4e041918d)
902636
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
902636
---
902636
 configure             |  2 +-
902636
 qemu-bridge-helper.c  |  6 +++---
902636
 scsi/qemu-pr-helper.c | 12 ++++++------
902636
 3 files changed, 10 insertions(+), 10 deletions(-)
902636
902636
diff --git a/configure b/configure
902636
index 16564f8..7831618 100755
902636
--- a/configure
902636
+++ b/configure
902636
@@ -6760,7 +6760,7 @@ if test "$l2tpv3" = "yes" ; then
902636
   echo "CONFIG_L2TPV3=y" >> $config_host_mak
902636
 fi
902636
 if test "$cap_ng" = "yes" ; then
902636
-  echo "CONFIG_LIBCAP=y" >> $config_host_mak
902636
+  echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak
902636
 fi
902636
 echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
902636
 for drv in $audio_drv_list; do
902636
diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c
902636
index 3d50ec0..88b2674 100644
902636
--- a/qemu-bridge-helper.c
902636
+++ b/qemu-bridge-helper.c
902636
@@ -43,7 +43,7 @@
902636
 
902636
 #include "net/tap-linux.h"
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
 #include <cap-ng.h>
902636
 #endif
902636
 
902636
@@ -207,7 +207,7 @@ static int send_fd(int c, int fd)
902636
     return sendmsg(c, &msg, 0);
902636
 }
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
 static int drop_privileges(void)
902636
 {
902636
     /* clear all capabilities */
902636
@@ -246,7 +246,7 @@ int main(int argc, char **argv)
902636
     int access_allowed, access_denied;
902636
     int ret = EXIT_SUCCESS;
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
     /* if we're run from an suid binary, immediately drop privileges preserving
902636
      * cap_net_admin */
902636
     if (geteuid() == 0 && getuid() != geteuid()) {
902636
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
902636
index debb18f..0659cee 100644
902636
--- a/scsi/qemu-pr-helper.c
902636
+++ b/scsi/qemu-pr-helper.c
902636
@@ -24,7 +24,7 @@
902636
 #include <linux/dm-ioctl.h>
902636
 #include <scsi/sg.h>
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
 #include <cap-ng.h>
902636
 #endif
902636
 #include <pwd.h>
902636
@@ -70,7 +70,7 @@ static int num_active_sockets = 1;
902636
 static int noisy;
902636
 static int verbose;
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
 static int uid = -1;
902636
 static int gid = -1;
902636
 #endif
902636
@@ -97,7 +97,7 @@ static void usage(const char *name)
902636
 "                            (default '%s')\n"
902636
 "  -T, --trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
902636
 "                            specify tracing options\n"
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
 "  -u, --user=USER           user to drop privileges to\n"
902636
 "  -g, --group=GROUP         group to drop privileges to\n"
902636
 #endif
902636
@@ -827,7 +827,7 @@ static void close_server_socket(void)
902636
     num_active_sockets--;
902636
 }
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
 static int drop_privileges(void)
902636
 {
902636
     /* clear all capabilities */
902636
@@ -920,7 +920,7 @@ int main(int argc, char **argv)
902636
             pidfile = g_strdup(optarg);
902636
             pidfile_specified = true;
902636
             break;
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
         case 'u': {
902636
             unsigned long res;
902636
             struct passwd *userinfo = getpwnam(optarg);
902636
@@ -1056,7 +1056,7 @@ int main(int argc, char **argv)
902636
         exit(EXIT_FAILURE);
902636
     }
902636
 
902636
-#ifdef CONFIG_LIBCAP
902636
+#ifdef CONFIG_LIBCAP_NG
902636
     if (drop_privileges() < 0) {
902636
         error_report("Failed to drop privileges: %s", strerror(errno));
902636
         exit(EXIT_FAILURE);
902636
-- 
902636
1.8.3.1
902636