Commit 3632eb3d authored by deuce's avatar deuce
Browse files

Non-BSD systems don't copy the environment string.

parent 0da4a150
......@@ -1568,14 +1568,17 @@ int main(int argc, char** argv)
pwent=getpwnam(new_uid_name);
if(pwent != NULL) {
sprintf(str,"USER=%s",pwent->pw_name);
putenv(str);
sprintf(str,"HOME=%s",pwent->pw_dir);
putenv(str);
char uenv[128];
char henv[MAX_PATH+6];
sprintf(uenv,"USER=%s",pwent->pw_name);
putenv(uenv);
sprintf(henv,"HOME=%s",pwent->pw_dir);
putenv(henv);
}
if(new_gid_name[0]) {
sprintf(str,"GROUP=%s",new_gid_name);
putenv(str);
char genv[128];
sprintf(genv,"GROUP=%s",new_gid_name);
putenv(genv);
}
sprintf(str,"Successfully changed user_id to %s", new_uid_name);
bbs_lputs(NULL,LOG_INFO,str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment