tOnly call issetugid() on systems that have it - vaccinewars - be a doctor and try to vaccinate the world | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 10bb1c3c21b12fc3a95a4274b2107751424230dc | |
parent ec76dfa9332d4449aade6d295cf3988c5cdcfc3d | |
Author: Ben Webb | |
Date: Sun, 8 Nov 2020 12:29:40 -0800 Only call issetugid() on systems that have it Diffstat: M configure.ac | 2 +- M src/serverside.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) --- | |
diff --git a/configure.ac b/configure.ac | |
t@@ -285,7 +285,7 @@ dnl Checks for library functions. AC_FUNC_MEMCMP AC_FUNC_SETVBUF_REVERSED AC_FUNC_STRFTIME -AC_CHECK_FUNCS(strdup strstr getopt getopt_long fork) +AC_CHECK_FUNCS(strdup strstr getopt getopt_long fork issetugid) dnl Enable plugins only if we can find the dlopen function, and dnl the user does not disable them with --disable-plugins or --disable-shared | |
diff --git a/src/serverside.c b/src/serverside.c | |
t@@ -1798,7 +1798,10 @@ void CloseHighScoreFile() void DropPrivileges() { #ifndef CYGWIN + +#ifdef HAVE_ISSETUGID if (issetugid() == 0) return; +#endif /* Ignore the return from setregid; we'll check it ourselves to be sure * (this avoids problems when running under fakeroot) */ |