summaryrefslogtreecommitdiffstats
path: root/source/web/cgi.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-09-20 13:15:35 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-09-20 13:15:35 +0000
commit2c2317c56ee13abdbdbc866363c3b52dab826e3c (patch)
tree77384e33fa51e9f052cb4da7645fb8112fe2a8bd /source/web/cgi.c
parentbf81f0021328da97afe58cc17317b15ec1b3cc96 (diff)
downloadsamba-2c2317c56ee13abdbdbc866363c3b52dab826e3c.tar.gz
samba-2c2317c56ee13abdbdbc866363c3b52dab826e3c.tar.xz
samba-2c2317c56ee13abdbdbc866363c3b52dab826e3c.zip
Move pass_check.c over to NTSTATUS, allowing full NTSTATUS from PAM to wire!
Add the ability for swat to run in non-root-mode (ie non-root from inetd). - we still need some of the am_root() calls fixed however.
Diffstat (limited to 'source/web/cgi.c')
-rw-r--r--source/web/cgi.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/web/cgi.c b/source/web/cgi.c
index b4356af46e8..a8af9b27221 100644
--- a/source/web/cgi.c
+++ b/source/web/cgi.c
@@ -390,7 +390,7 @@ static BOOL cgi_handle_authorization(char *line)
* Validate the password they have given.
*/
- if (pass_check(pass, user, user_pass,
+ if NT_STATUS_IS_OK(pass_check(pass, user, user_pass,
strlen(user_pass), NULL, False)) {
if (pass) {
@@ -398,13 +398,7 @@ static BOOL cgi_handle_authorization(char *line)
* Password was ok.
*/
- if(pass->pw_uid != 0) {
- /*
- * We have not authenticated as root,
- * become the user *permanently*.
- */
- become_user_permanently(pass->pw_uid, pass->pw_gid);
- }
+ become_user_permanently(pass->pw_uid, pass->pw_gid);
/* Save the users name */
C_user = strdup(user);
@@ -508,6 +502,9 @@ void cgi_setup(char *rootdir, int auth_required)
"chdir failed - the server is not configured correctly");
}
+ /* Handle the possability we might be running as non-root */
+ sec_init();
+
/* maybe we are running under a web server */
if (getenv("CONTENT_LENGTH") || getenv("REQUEST_METHOD")) {
if (auth_required) {