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:31 -0400 |
commit | 0d32e0dbb84de09e819911e8a5a532fbb7c1604e (patch) | |
tree | 395917b665d4ebdbeb812bcd83ccb6a6c27ad393 /src/util | |
parent | 7d2f90122754a2b0ef21671d68a9fa98fbe8d4a8 (diff) | |
download | sssd-0d32e0dbb84de09e819911e8a5a532fbb7c1604e.tar.gz sssd-0d32e0dbb84de09e819911e8a5a532fbb7c1604e.tar.bz2 sssd-0d32e0dbb84de09e819911e8a5a532fbb7c1604e.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 6f43ac38..02d66863 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; } |