diff options
author | Ted Gould <ted@gould.cx> | 2012-08-30 11:55:41 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-08-30 11:55:41 -0500 |
commit | 3058f050cdb8f65f176281a82def12804ae85d05 (patch) | |
tree | fccef5c133a4c67b2d93f2902d8813966a7749eb /src | |
parent | 58bca1e60eaccd13b99cfcba93a6ad7ab6d93f75 (diff) | |
download | libpam-freerdp2-3058f050cdb8f65f176281a82def12804ae85d05.tar.gz libpam-freerdp2-3058f050cdb8f65f176281a82def12804ae85d05.tar.bz2 libpam-freerdp2-3058f050cdb8f65f176281a82def12804ae85d05.zip |
Make sure to clear the environments
Diffstat (limited to 'src')
-rw-r--r-- | src/pam-freerdp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index 43b16d5..ed83402 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -238,6 +238,10 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, const char **argv) _exit(EXIT_FAILURE); } + if (clearenv() != 0) { + _exit(EXIT_FAILURE); + } + setenv("HOME", pwdent->pw_dir, 1); execvp(args[0], args); @@ -301,6 +305,11 @@ session_socket_handler (struct passwd * pwdent, int readypipe, const char * ruse return EXIT_FAILURE; } + if (clearenv() != 0) { + /* Don't need to clean up yet */ + return EXIT_FAILURE; + } + /* Build this up as a buffer so we can just write it and see that very, very clearly */ buffer_len += strlen(ruser) + 1; /* Add one for the space */ |