diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-06-14 22:21:51 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-06-15 21:06:18 -0400 |
commit | 2666d441c2d8107b1987b869714189af64b954c6 (patch) | |
tree | c7b8877d691db280202b4c7655907a1165ec84fc /nss/nss_files/files-service.c | |
parent | 9ee76b5ae861ff9891e5586fc6906c94c447a9e0 (diff) | |
download | glibc-2666d441c2d8107b1987b869714189af64b954c6.tar.gz glibc-2666d441c2d8107b1987b869714189af64b954c6.tar.xz glibc-2666d441c2d8107b1987b869714189af64b954c6.zip |
Reenable nss_db with a completely new implementation
No longer is Berkeley db used. Instead a simple hash function is used. The database files are not updated once they are created and therefore no complicated database is needed.
Diffstat (limited to 'nss/nss_files/files-service.c')
-rw-r--r-- | nss/nss_files/files-service.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c index 13532ddc9b..6f2b0e64a6 100644 --- a/nss/nss_files/files-service.c +++ b/nss/nss_files/files-service.c @@ -1,5 +1,5 @@ /* Services file parser in nss_files module. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,8 +39,9 @@ LINE_PARSER #include GENERIC -DB_LOOKUP (servbyname, 2 + strlen (name) + (proto ? strlen (proto) : 0), - (".%s/%s", name, proto ?: ""), +DB_LOOKUP (servbyname, ':', + strlen (name) + 2 + (proto == NULL ? 0 : strlen (proto)), + ("%s/%s", name, proto ?: ""), { /* Must match both protocol (if specified) and name. */ if (proto != NULL && strcmp (result->s_proto, proto)) @@ -49,8 +50,8 @@ DB_LOOKUP (servbyname, 2 + strlen (name) + (proto ? strlen (proto) : 0), }, const char *name, const char *proto) -DB_LOOKUP (servbyport, 21 + (proto ? strlen (proto) : 0), - ("=%d/%s", ntohs (port), proto ?: ""), +DB_LOOKUP (servbyport, '=', 21 + (proto ? strlen (proto) : 0), + ("%zd/%s", (ssize_t) ntohs (port), proto ?: ""), { /* Must match both port and protocol. */ if (result->s_port == port |