summaryrefslogtreecommitdiffstats
path: root/gl/idpriv-droptemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/idpriv-droptemp.c')
-rw-r--r--gl/idpriv-droptemp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gl/idpriv-droptemp.c b/gl/idpriv-droptemp.c
index eb882dea..ecaab836 100644
--- a/gl/idpriv-droptemp.c
+++ b/gl/idpriv-droptemp.c
@@ -1,5 +1,5 @@
1/* Dropping uid/gid privileges of the current process temporarily. 1/* Dropping uid/gid privileges of the current process temporarily.
2 Copyright (C) 2009-2024 Free Software Foundation, Inc. 2 Copyright (C) 2009-2025 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
@@ -25,18 +25,18 @@
25 25
26/* The privileged uid and gid that the process had earlier. */ 26/* The privileged uid and gid that the process had earlier. */
27#if HAVE_GETUID 27#if HAVE_GETUID
28static int saved_uid = -1; 28static uid_t saved_uid = -1;
29#endif 29#endif
30#if HAVE_GETGID 30#if HAVE_GETGID
31static int saved_gid = -1; 31static gid_t saved_gid = -1;
32#endif 32#endif
33 33
34int 34int
35idpriv_temp_drop (void) 35idpriv_temp_drop (void)
36{ 36{
37#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID) 37#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
38 int uid = getuid (); 38 uid_t uid = getuid ();
39 int gid = getgid (); 39 gid_t gid = getgid ();
40 40
41 /* Find out about the privileged uid and gid at the first call. */ 41 /* Find out about the privileged uid and gid at the first call. */
42 if (saved_uid == -1) 42 if (saved_uid == -1)
@@ -124,8 +124,8 @@ int
124idpriv_temp_restore (void) 124idpriv_temp_restore (void)
125{ 125{
126#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID) 126#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
127 int uid = getuid (); 127 uid_t uid = getuid ();
128 int gid = getgid (); 128 gid_t gid = getgid ();
129 129
130 if (saved_uid == -1 || saved_gid == -1) 130 if (saved_uid == -1 || saved_gid == -1)
131 /* Caller error: idpriv_temp_drop was never invoked. */ 131 /* Caller error: idpriv_temp_drop was never invoked. */