summaryrefslogtreecommitdiffstats
path: root/gl/idpriv-droptemp.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2022-08-23 17:42:51 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2022-08-23 17:42:51 (GMT)
commitc0f1bce31151ed43120bcda3cf919c81b2873641 (patch)
treedd6e4c46c66f79cf771f60880756361a11459279 /gl/idpriv-droptemp.c
parent3ad5fe9d84138da1451429bfac3b9b4024393d25 (diff)
downloadmonitoring-plugins-c0f1bce31151ed43120bcda3cf919c81b2873641.tar.gz
Sync with the latest Gnulib code (d27c820595)
Diffstat (limited to 'gl/idpriv-droptemp.c')
-rw-r--r--gl/idpriv-droptemp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gl/idpriv-droptemp.c b/gl/idpriv-droptemp.c
index 13d1064..f327236 100644
--- a/gl/idpriv-droptemp.c
+++ b/gl/idpriv-droptemp.c
@@ -1,9 +1,9 @@
1/* Dropping uid/gid privileges of the current process temporarily. 1/* Dropping uid/gid privileges of the current process temporarily.
2 Copyright (C) 2009-2013 Free Software Foundation, Inc. 2 Copyright (C) 2009-2022 Free Software Foundation, Inc.
3 3
4 This program is free software: you can redistribute it and/or modify 4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or 6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version. 7 (at your option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
@@ -12,7 +12,7 @@
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16 16
17#include <config.h> 17#include <config.h>
18 18
@@ -58,7 +58,9 @@ idpriv_temp_drop (void)
58 58
59 /* This is for executables that have the setuid bit set. */ 59 /* This is for executables that have the setuid bit set. */
60# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */ 60# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
61 /* See <http://www.usenix.org/events/sec02/full_papers/chen/chen.pdf> 61 /* See
62 Hao Chen, David Wagner, Drew Dean: Setuid Demystified
63 <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
62 figure 14. */ 64 figure 14. */
63 if (setresuid (-1, uid, saved_uid) < 0) 65 if (setresuid (-1, uid, saved_uid) < 0)
64 return -1; 66 return -1;
@@ -134,7 +136,9 @@ idpriv_temp_restore (void)
134 136
135 /* This is for executables that have the setuid bit set. */ 137 /* This is for executables that have the setuid bit set. */
136# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */ 138# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
137 /* See <http://www.usenix.org/events/sec02/full_papers/chen/chen.pdf> 139 /* See
140 Hao Chen, David Wagner, Drew Dean: Setuid Demystified
141 <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
138 figure 14. */ 142 figure 14. */
139 if (setresuid (-1, saved_uid, -1) < 0) 143 if (setresuid (-1, saved_uid, -1) < 0)
140 return -1; 144 return -1;