summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-09-11 21:20:15 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-09-11 21:20:15 +0000
commit3f5e478b8fa0c35fcec4a56904b27111309cbc15 (patch)
treebca97b31f48d8f26932cc742f7081c36b4111e1f /libexec
parent34a98fa33a98cb3cccb0012e71886df99b4c51f1 (diff)
prevent detection of bogus libraries
problem initially noticed by deraadt@, exchanged various patches with kettenis@ decided to fix the bug now, even though ldconfig could probably use a larger rewrite. okay matthew@
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/ldconfig/ldconfig.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libexec/ld.so/ldconfig/ldconfig.c b/libexec/ld.so/ldconfig/ldconfig.c
index 5ad412d8ee9..aee5f500901 100644
--- a/libexec/ld.so/ldconfig/ldconfig.c
+++ b/libexec/ld.so/ldconfig/ldconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldconfig.c,v 1.28 2010/12/13 20:51:33 espie Exp $ */
+/* $OpenBSD: ldconfig.c,v 1.29 2012/09/11 21:20:14 espie Exp $ */
/*
* Copyright (c) 1993,1995 Paul Kranenburg
@@ -240,12 +240,11 @@ dodir(char *dir, int silent)
continue;
*cp = '\0';
- if (!isdigit(*(cp+4)))
- continue;
bzero((caddr_t)dewey, sizeof(dewey));
- ndewey = getdewey(dewey, cp + 4);
- enter(dir, dp->d_name, name, dewey, ndewey);
+ ndewey = getdewey(dewey, cp + 3);
+ if (ndewey > 0)
+ enter(dir, dp->d_name, name, dewey, ndewey);
}
closedir(dd);
return 0;