* my_getid was leaking file descriptors, causing 'ls -l' on long
authorEric Andersen <andersen@codepoet.org>
Thu, 9 Dec 1999 01:15:52 +0000 (01:15 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 9 Dec 1999 01:15:52 +0000 (01:15 -0000)
    directories to fail
 -Erik

Changelog
utility.c

index 59895a07c31776eccc4738fb52c3b36c728a1d41..7c21c6cd2f0f5ed4ce56268a0d6f29b3b35ef382 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -9,6 +9,8 @@
            integration with the about-to-be-released tinylogin.)
        * kill now behaves itself properly, added 'kill -l' to list signals
        * Began to add tail, butit doesn't work yet.
+       * my_getid was leaking file descriptors, causing 'ls -l' on long
+           directories to fail
 
        -Erik Andrsen
 
index 1f0e381e32303334941dc7c421162ba266a41a1a..469275f2d6884f524023aaaabdc063fc5ba450bb 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -645,11 +645,14 @@ my_getid(const char *filename, char *name, uid_t id)
                        continue;
 
                if (name) {
-                   if (0 == strcmp(rname, name))
+                   if (0 == strcmp(rname, name)) {
+                       fclose( file);
                        return( rid);
+                   }
                 }
                if ( id != -1 && id == rid ) {
                    strncpy(name, rname, 8);
+                   fclose( file);
                    return( TRUE);
                }
        }