qrexec: start process in a login shell

Prepend "-" to shell name, to instruct it being a login shell. This way
shell will initialize environment, load /etc/profile etc.

Fixes QubesOS/qubes-issues#2903
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-11 23:50:35 +02:00
parent 22f74641da
commit 89cb419d9c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -211,7 +211,7 @@ void do_exec(const char *cmd)
setsid(); setsid();
/* This is a copy but don't care to free as we exec later anyways. */ /* This is a copy but don't care to free as we exec later anyways. */
env = pam_getenvlist (pamh); env = pam_getenvlist (pamh);
execle("/bin/sh", "sh", "-c", realcmd, (char*)NULL, env); execle("/bin/sh", "-sh", "-c", realcmd, (char*)NULL, env);
exit(127); exit(127);
default: default:
/* parent */ /* parent */