From: Todd C. Miller Date: Tue, 24 May 1994 21:44:50 +0000 (+0000) Subject: ok, the getcwd() is now *really* done as the user X-Git-Tag: SUDO_1_3_1~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d0f470073889b7c6532f60076864cdcdbd64cc4;p=sudo ok, the getcwd() is now *really* done as the user --- diff --git a/sudo.c b/sudo.c index 78a634670..42dfee7f6 100644 --- a/sudo.c +++ b/sudo.c @@ -145,17 +145,10 @@ main(argc, argv) (void) close(rtn); #endif /* HAVE_SYSCONF */ - load_globals(); /* load the user host cmnd and uid variables */ - - /* - * We only want to be root when we absolutely need it. - * This will effectively do setreuid(0, uid) but for portability... - */ - be_root(); - be_user(); - clean_env(environ); /* clean up the environment (no LD_*) */ + load_globals(); /* load the user host cmnd and uid variables */ + rtn = validate(); switch (rtn) { @@ -203,6 +196,13 @@ static void load_globals() uid = getuid(); /* we need to tuck this away for safe keeping */ + /* + * We only want to be root when we absolutely need it. + * This will effectively do setreuid(0, uid) but for portability... + */ + be_root(); + be_user(); + #ifdef UMASK (void) umask((mode_t)UMASK); #endif /* UMASK */