|
|
da9dc6 |
From 18f9a84e0e702841d6cc4d5f593de4fbd1348e83 Mon Sep 17 00:00:00 2001
|
|
|
da9dc6 |
From: Sami Kerola <kerolasa@iki.fi>
|
|
|
da9dc6 |
Date: Sat, 28 Dec 2019 17:16:27 +0000
|
|
|
da9dc6 |
Subject: [PATCH] ninfod: change variable name to avoid colliding with function
|
|
|
da9dc6 |
name
|
|
|
da9dc6 |
|
|
|
da9dc6 |
The sys/capability.h header has 'extern int cap_setuid(uid_t uid);'
|
|
|
da9dc6 |
function prototype.
|
|
|
da9dc6 |
|
|
|
da9dc6 |
Addresses: https://github.com/iputils/iputils/issues/246
|
|
|
da9dc6 |
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
|
da9dc6 |
---
|
|
|
da9dc6 |
ninfod/ninfod.c | 8 ++++----
|
|
|
da9dc6 |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
da9dc6 |
|
|
|
da9dc6 |
diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c
|
|
|
da9dc6 |
index 26112d0d..95583de4 100644
|
|
|
da9dc6 |
--- a/ninfod/ninfod.c
|
|
|
da9dc6 |
+++ b/ninfod/ninfod.c
|
|
|
da9dc6 |
@@ -455,7 +455,7 @@ static void do_daemonize(void)
|
|
|
da9dc6 |
/* --------- */
|
|
|
da9dc6 |
#ifdef HAVE_LIBCAP
|
|
|
da9dc6 |
static const cap_value_t cap_net_raw = CAP_NET_RAW;
|
|
|
da9dc6 |
-static const cap_value_t cap_setuid = CAP_SETUID;
|
|
|
da9dc6 |
+static const cap_value_t cap_setuserid = CAP_SETUID;
|
|
|
da9dc6 |
static cap_flag_value_t cap_ok;
|
|
|
da9dc6 |
#else
|
|
|
da9dc6 |
static uid_t euid;
|
|
|
da9dc6 |
@@ -487,7 +487,7 @@ static void limit_capabilities(void)
|
|
|
da9dc6 |
|
|
|
da9dc6 |
cap_get_flag(cap_cur_p, CAP_SETUID, CAP_PERMITTED, &cap_ok);
|
|
|
da9dc6 |
if (cap_ok != CAP_CLEAR)
|
|
|
da9dc6 |
- cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET);
|
|
|
da9dc6 |
+ cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET);
|
|
|
da9dc6 |
|
|
|
da9dc6 |
if (cap_set_proc(cap_p) < 0) {
|
|
|
da9dc6 |
DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));
|
|
|
da9dc6 |
@@ -520,8 +520,8 @@ static void drop_capabilities(void)
|
|
|
da9dc6 |
|
|
|
da9dc6 |
/* setuid / setuid */
|
|
|
da9dc6 |
if (cap_ok != CAP_CLEAR) {
|
|
|
da9dc6 |
- cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET);
|
|
|
da9dc6 |
- cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuid, CAP_SET);
|
|
|
da9dc6 |
+ cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET);
|
|
|
da9dc6 |
+ cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuserid, CAP_SET);
|
|
|
da9dc6 |
|
|
|
da9dc6 |
if (cap_set_proc(cap_p) < 0) {
|
|
|
da9dc6 |
DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));
|