diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-06-10 11:25:15 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-06-14 16:54:43 -0400 |
commit | 9079944823dd6ef1e9dd046fd28c82884859ce81 (patch) | |
tree | 17761f1bd3570a92c43491f4f7297020fa8b75c3 /src/util | |
parent | 51420d01e19549c202af9a4ed20ea120bd27c010 (diff) | |
download | sssd-9079944823dd6ef1e9dd046fd28c82884859ce81.tar.gz sssd-9079944823dd6ef1e9dd046fd28c82884859ce81.tar.xz sssd-9079944823dd6ef1e9dd046fd28c82884859ce81.zip |
Check closedir call in find_uid
Fixes: #503
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/find_uid.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/util/find_uid.c b/src/util/find_uid.c index 6f43ac388..02d668636 100644 --- a/src/util/find_uid.c +++ b/src/util/find_uid.c @@ -197,7 +197,7 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid) { DIR *proc_dir = NULL; struct dirent *dirent; - int ret; + int ret, err; pid_t pid = -1; uid_t uid; @@ -250,14 +250,14 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid) } if (errno != 0 && dirent == NULL) { ret = errno; - DEBUG(1 ,("readdir failed.\n")); + DEBUG(1, ("readdir failed.\n")); goto done; } ret = closedir(proc_dir); proc_dir = NULL; if (ret == -1) { - DEBUG(1 ,("closedir failed, watch out.\n")); + DEBUG(1, ("closedir failed, watch out.\n")); } if (table != NULL) { @@ -267,7 +267,12 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid) } done: - if (proc_dir != NULL) closedir(proc_dir); + if (proc_dir != NULL) { + err = closedir(proc_dir); + if (err) { + DEBUG(1, ("closedir failed, bad dirp?\n")); + } + } return ret; } |