summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-06-28 11:59:51 -0700
committerJeremy Allison <jra@samba.org>2012-06-28 17:15:16 -0700
commit821bd95156e8cc6d843aecb0a27d4a08761b7dac (patch)
treea35f1f0059005555bc3fe548760a9cf01e896d55 /source3/web
parent7630fe50bd7d0783d1f6b253cbee46cccca3f774 (diff)
downloadsamba-821bd95156e8cc6d843aecb0a27d4a08761b7dac.tar.gz
samba-821bd95156e8cc6d843aecb0a27d4a08761b7dac.tar.bz2
samba-821bd95156e8cc6d843aecb0a27d4a08761b7dac.zip
Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.
Will allow thread-specific credentials to be added by modifying the central definitions. Deliberately left the setXX[ug]id() call in popt as this is not used in Samba.
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/cgi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index b861b2d780..b97ed2578c 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -24,6 +24,7 @@
#include "intl/lang_tdb.h"
#include "auth.h"
#include "secrets.h"
+#include "../lib/util/setid.h"
#define MAX_VARIABLES 10000
@@ -328,7 +329,7 @@ static void cgi_web_auth(void)
C_user = SMB_STRDUP(user);
- if (!setuid(0)) {
+ if (!samba_setuid(0)) {
C_pass = secrets_fetch_generic("root", "SWAT");
if (C_pass == NULL) {
char *tmp_pass = NULL;
@@ -344,7 +345,7 @@ static void cgi_web_auth(void)
TALLOC_FREE(tmp_pass);
}
}
- setuid(pwd->pw_uid);
+ samba_setuid(pwd->pw_uid);
if (geteuid() != pwd->pw_uid || getuid() != pwd->pw_uid) {
printf("%sFailed to become user %s - uid=%d/%d<br>%s\n",
head, user, (int)geteuid(), (int)getuid(), tail);