diff options
author | green <green@FreeBSD.org> | 2000-11-25 02:00:35 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-11-25 02:00:35 +0000 |
commit | 163406c6e5ec2a713bffd07f189837b6c444c773 (patch) | |
tree | d070a1610f02cea0697cb4ea85d15f9f0a0f52dc /lib/libpam | |
parent | de5ab7abc178ea26bb11eac870bcaa717aa4e673 (diff) | |
download | FreeBSD-src-163406c6e5ec2a713bffd07f189837b6c444c773.zip FreeBSD-src-163406c6e5ec2a713bffd07f189837b6c444c773.tar.gz |
In env_destroy(), it is a bad idea to env_swap(self, 0) to switch
back to the original environ unconditionally. The setting of the
variable to save the previous environ is conditional; it happens when
ENV.e_committed is set. Therefore, don't try to swap the env back
unless the previous env has been initialized.
PR: bin/22670
Submitted by: Takanori Saneto <sanewo@ba2.so-net.ne.jp>
Diffstat (limited to 'lib/libpam')
-rw-r--r-- | lib/libpam/modules/pam_ssh/pam_ssh.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.c b/lib/libpam/modules/pam_ssh/pam_ssh.c index 13e5c44..424496d 100644 --- a/lib/libpam/modules/pam_ssh/pam_ssh.c +++ b/lib/libpam/modules/pam_ssh/pam_ssh.c @@ -176,6 +176,8 @@ env_destroy(ENV *self) { struct env_entry *p; + if (self->e_committed) + env_swap(self, 0); env_swap(self, 0); SLIST_FOREACH(p, &self->e_head, ee_entries) { free(p->ee_env); |