mount: recognize "dirsync" (closes bug 835)

mount: sanitize environ if called by non-root
*: adjust for slightly different sanitize routine
This commit is contained in:
Denis Vlasenko
2008-02-18 11:08:33 +00:00
parent 56244736ec
commit c9ca0a3274
7 changed files with 37 additions and 26 deletions

View File

@ -116,12 +116,19 @@ static const char forbid[] ALIGN1 =
"LD_NOWARN" "\0"
"LD_KEEPDIR" "\0";
void sanitize_env_for_suid(void)
int sanitize_env_if_suid(void)
{
const char *p = forbid;
const char *p;
if (getuid() == geteuid())
return 0;
p = forbid;
do {
unsetenv(p);
p += strlen(p) + 1;
} while (*p);
putenv((char*)bb_PATH_root_path);
return 1; /* we indeed were run by different user! */
}