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