X-Git-Url: https://ruderich.org/simon/gitweb/?p=ptyas%2Fptyas.git;a=blobdiff_plain;f=ptyas.c;fp=ptyas.c;h=9ffe998a7f51c25deedfae106ddb166c68b676ba;hp=c21c6ae35036af64b627aebf583d5980518ae5a7;hb=db05939cd070914c210343a5b2ae609d8fdc3f93;hpb=7b101456491c5fcaa5b7f275bef98fe8fe012273 diff --git a/ptyas.c b/ptyas.c index c21c6ae..9ffe998 100644 --- a/ptyas.c +++ b/ptyas.c @@ -376,6 +376,12 @@ int main(int argc, char **argv) { } const char *home = passwd->pw_dir; + // Ignore errors here as we don't want to die on non-existent home + // directories to allow running as any user (think "/nonexistent" + // as home) and an error message will be annoying to ignore when + // running this command in scripts. + chdir(home); + char envp_user[strlen("USER=") + strlen(user) + 1]; char envp_home[strlen("HOME=") + strlen(home) + 1]; char envp_term[strlen("TERM=") + strlen(term) + 1];