Ignore:
Timestamp:
Aug 2, 2011, 10:40:58 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.10

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/web/cgi.c

    r596 r617  
    2020#include "includes.h"
    2121#include "web/swat_proto.h"
     22
     23
    2224
    2325#define MAX_VARIABLES 10000
     
    4345static char *pathinfo;
    4446static char *C_user;
     47
    4548static bool inetd_server;
    4649static bool got_request;
     
    323326        }
    324327
    325         setuid(0);
     328        C_user = SMB_STRDUP(user);
     329
     330        if (!setuid(0)) {
     331                C_pass = secrets_fetch_generic("root", "SWAT");
     332                if (C_pass == NULL) {
     333                        char *tmp_pass = NULL;
     334                        tmp_pass = generate_random_str(talloc_tos(), 16);
     335                        if (tmp_pass == NULL) {
     336                                printf("%sFailed to create random nonce for "
     337                                       "SWAT session\n<br>%s\n", head, tail);
     338                                exit(0);
     339                        }
     340                        secrets_store_generic("root", "SWAT", tmp_pass);
     341                        C_pass = SMB_STRDUP(tmp_pass);
     342                        TALLOC_FREE(tmp_pass);
     343                }
     344        }
    326345        setuid(pwd->pw_uid);
    327346        if (geteuid() != pwd->pw_uid || getuid() != pwd->pw_uid) {
     
    392411                        /* Save the users name */
    393412                        C_user = SMB_STRDUP(user);
     413
    394414                        TALLOC_FREE(pass);
    395415                        return True;
     
    426446}
    427447
     448
     449
     450
     451
     452
     453
     454
    428455
    429456/***************************************************************************
Note: See TracChangeset for help on using the changeset viewer.