Skip to content
Snippets Groups Projects
Commit 0da4a150 authored by deuce's avatar deuce
Browse files

Set USER/HOME/GROUP environment variables when changing uid/gids

(fixes problems with at least some dosemu setups)
parent 766475db
No related branches found
No related tags found
No related merge requests found
......@@ -1564,6 +1564,19 @@ int main(int argc, char** argv)
else {
char str[256];
struct passwd *pwent;
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);
}
if(new_gid_name[0]) {
sprintf(str,"GROUP=%s",new_gid_name);
putenv(str);
}
sprintf(str,"Successfully changed user_id to %s", new_uid_name);
bbs_lputs(NULL,LOG_INFO,str);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment