summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-18 01:57:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:33:29 -0500
commit3f260e2efe416a05571c29d8edb81ae0385a00c9 (patch)
treee7d3df9d98760dcc5af2b5cf0013696b5dbf270f
parentec96a742f7b6ce4cbb4f649dd8aba92ef80f0ff0 (diff)
downloadsamba-3f260e2efe416a05571c29d8edb81ae0385a00c9.tar.gz
samba-3f260e2efe416a05571c29d8edb81ae0385a00c9.tar.bz2
samba-3f260e2efe416a05571c29d8edb81ae0385a00c9.zip
r9374: HPUX is also missing setegid()
(This used to be commit 57e6bd61395e82064c72510dcc326b11b7bdf7fd)
-rw-r--r--source4/lib/replace/config.m43
-rw-r--r--source4/lib/replace/replace.c11
2 files changed, 13 insertions, 1 deletions
diff --git a/source4/lib/replace/config.m4 b/source4/lib/replace/config.m4
index a912675d0f..4dfeb5647a 100644
--- a/source4/lib/replace/config.m4
+++ b/source4/lib/replace/config.m4
@@ -15,4 +15,5 @@ if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
fi
-AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq seteuid setresuid)
+AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
+AC_CHECK_FUNCS(seteuid setresuid setegid setresgid)
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c
index ae70634215..ef8e053257 100644
--- a/source4/lib/replace/replace.c
+++ b/source4/lib/replace/replace.c
@@ -515,3 +515,14 @@ int sys_waitpid(pid_t pid,int *status,int options)
#endif
}
#endif
+
+#ifndef HAVE_SETEGID
+ int setegid(gid_t egid)
+{
+#ifdef HAVE_SETRESGID
+ return setresgid(-1, egid, -1);
+#else
+# error "You need a setegid function"
+#endif
+}
+#endif