diff options
author | Amarnath Valluri <amarnath.valluri@intel.com> | 2015-08-05 15:16:51 +0200 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2015-08-05 15:16:51 +0200 |
commit | bb506282825923b89d61e96e76e2f67c67374284 (patch) | |
tree | ec26e25b152f9f0e9cb319e96d12cc3e79cf8bcd /modules/pam_timestamp/hmacsha1.c | |
parent | e89d4c97385ff8180e6e81e84c5aa745daf28a79 (diff) | |
download | pam-bb506282825923b89d61e96e76e2f67c67374284.tar.gz pam-bb506282825923b89d61e96e76e2f67c67374284.tar.bz2 pam-bb506282825923b89d61e96e76e2f67c67374284.zip |
pam_timestamp: Avoid leaking file descriptor.
* modules/pam_timestamp/hmacsha1.c(hmac_key_create):
close 'keyfd' when failed to own it.
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Diffstat (limited to 'modules/pam_timestamp/hmacsha1.c')
-rw-r--r-- | modules/pam_timestamp/hmacsha1.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/pam_timestamp/hmacsha1.c b/modules/pam_timestamp/hmacsha1.c index 573ecf3b..3f411061 100644 --- a/modules/pam_timestamp/hmacsha1.c +++ b/modules/pam_timestamp/hmacsha1.c @@ -73,6 +73,7 @@ hmac_key_create(pam_handle_t *pamh, const char *filename, size_t key_size, if (fchown(keyfd, owner, group) == -1) { pam_syslog(pamh, LOG_ERR, "Cannot chown %s: %m", filename); + close(keyfd); return; } |