Skip to content
Snippets Groups Projects
Commit 3632eb3d authored by deuce's avatar deuce
Browse files

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

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