summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2012-09-11 21:20:14 +0000
committerespie <espie@openbsd.org>2012-09-11 21:20:14 +0000
commitf6b064166fd0695e4587ec42fc60705005c6a03f (patch)
treecb88795353a9699e1c6774c69b1a9ea45506aa47
parent- simplify scheduler_compute_schedule by making it a quadratic delaying. (diff)
downloadwireguard-openbsd-f6b064166fd0695e4587ec42fc60705005c6a03f.tar.xz
wireguard-openbsd-f6b064166fd0695e4587ec42fc60705005c6a03f.zip
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@
-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;