summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-12-09 01:15:52 +0000
committerEric Andersen <andersen@codepoet.org>1999-12-09 01:15:52 +0000
commit48091fb3d3e5ec35506ef434bf8712bb5696c3fc (patch)
tree22597bae89a7b7c5f2153947767e384884effa77
parentabc0f4f8f97b36f2865986374405d091cefea107 (diff)
* my_getid was leaking file descriptors, causing 'ls -l' on long
directories to fail -Erik
-rw-r--r--Changelog2
-rw-r--r--utility.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/Changelog b/Changelog
index 59895a07c..7c21c6cd2 100644
--- 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
diff --git a/utility.c b/utility.c
index 1f0e381e3..469275f2d 100644
--- 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);
}
}