diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-08-20 19:50:45 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-08-20 19:50:45 +0200 |
commit | 4dd9e35bfd35d3138bc44169baba098005bad51e (patch) | |
tree | a4939c43a9c3fe00eb27f023e14acc5e1fe8808c /nss/nss_db | |
parent | bd42a4599d1b6f77bcfe1e4f67b7cbd9e1cb2dfd (diff) | |
parent | f76453c31593957fec1a99b986bfa5506618b79c (diff) |
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'nss/nss_db')
-rw-r--r-- | nss/nss_db/db-XXX.c | 11 | ||||
-rw-r--r-- | nss/nss_db/db-init.c | 30 | ||||
-rw-r--r-- | nss/nss_db/db-initgroups.c | 2 | ||||
-rw-r--r-- | nss/nss_db/db-netgrp.c | 2 | ||||
-rw-r--r-- | nss/nss_db/db-open.c | 3 | ||||
-rw-r--r-- | nss/nss_db/nss_db.h | 2 |
6 files changed, 21 insertions, 29 deletions
diff --git a/nss/nss_db/db-XXX.c b/nss/nss_db/db-XXX.c index 89b1a126c2..4a0766ab52 100644 --- a/nss/nss_db/db-XXX.c +++ b/nss/nss_db/db-XXX.c @@ -1,5 +1,5 @@ /* Common code for DB-based databases in nss_db module. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 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 @@ -191,6 +191,12 @@ enum nss_status \ char *p = memcpy (buffer, valstr, len); \ \ int err = parse_line (p, result, data, buflen, errnop EXTRA_ARGS); \ + \ + /* Advance before break_if_match, lest it uses continue to skip + to the next entry. */ \ + if ((hidx += hval2) >= header->dbs[i].hashsize) \ + hidx -= header->dbs[i].hashsize; \ + \ if (err > 0) \ { \ status = NSS_STATUS_SUCCESS; \ @@ -203,9 +209,6 @@ enum nss_status \ status = NSS_STATUS_TRYAGAIN; \ break; \ } \ - \ - if ((hidx += hval2) >= header->dbs[i].hashsize) \ - hidx -= header->dbs[i].hashsize; \ } \ \ if (status == NSS_STATUS_NOTFOUND) \ diff --git a/nss/nss_db/db-init.c b/nss/nss_db/db-init.c index 521c452665..099d89b1f8 100644 --- a/nss/nss_db/db-init.c +++ b/nss/nss_db/db-init.c @@ -1,5 +1,5 @@ /* Initialization in nss_db module. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 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 @@ -22,35 +22,25 @@ #include <nscd/nscd.h> #include <string.h> -static union -{ - struct traced_file file; - char buf[sizeof (struct traced_file) + sizeof (_PATH_VARDB "passwd.db")]; -} pwd_traced_file; - -static union -{ - struct traced_file file; - char buf[sizeof (struct traced_file) + sizeof (_PATH_VARDB "group.db")]; -} grp_traced_file; +#define PWD_FILENAME (_PATH_VARDB "passwd.db") +define_traced_file (pwd, PWD_FILENAME); -static union -{ - struct traced_file file; - char buf[sizeof (struct traced_file) + sizeof (_PATH_VARDB "services.db")]; -} serv_traced_file; +#define GRP_FILENAME (_PATH_VARDB "group.db") +define_traced_file (grp, GRP_FILENAME); +#define SERV_FILENAME (_PATH_VARDB "services.db") +define_traced_file (serv, SERV_FILENAME); void _nss_db_init (void (*cb) (size_t, struct traced_file *)) { - strcpy (pwd_traced_file.file.fname,_PATH_VARDB "passwd.db"); + init_traced_file (&pwd_traced_file.file, PWD_FILENAME, 0); cb (pwddb, &pwd_traced_file.file); - strcpy (grp_traced_file.file.fname, _PATH_VARDB "group.db"); + init_traced_file (&grp_traced_file.file, GRP_FILENAME, 0); cb (grpdb, &grp_traced_file.file); - strcpy (serv_traced_file.file.fname, _PATH_VARDB "services.db"); + init_traced_file (&serv_traced_file.file, SERV_FILENAME, 0); cb (servdb, &serv_traced_file.file); } diff --git a/nss/nss_db/db-initgroups.c b/nss/nss_db/db-initgroups.c index fb130f9dd6..d182fc4f42 100644 --- a/nss/nss_db/db-initgroups.c +++ b/nss/nss_db/db-initgroups.c @@ -1,5 +1,5 @@ /* Initgroups handling in nss_db module. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>. diff --git a/nss/nss_db/db-netgrp.c b/nss/nss_db/db-netgrp.c index 8c8fbd8180..94d6adac68 100644 --- a/nss/nss_db/db-netgrp.c +++ b/nss/nss_db/db-netgrp.c @@ -1,5 +1,5 @@ /* Netgroup file parser in nss_db modules. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. diff --git a/nss/nss_db/db-open.c b/nss/nss_db/db-open.c index ea867a7a7f..c482232b3c 100644 --- a/nss/nss_db/db-open.c +++ b/nss/nss_db/db-open.c @@ -1,5 +1,5 @@ /* Common database routines for nss_db. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 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 @@ -25,7 +25,6 @@ #include <sys/mman.h> #include <not-cancel.h> -#include <kernel-features.h> #include "nss_db.h" /* Open the database stored in FILE. If succesful, store either a diff --git a/nss/nss_db/nss_db.h b/nss/nss_db/nss_db.h index 5c6b46b47c..4af2229ac1 100644 --- a/nss/nss_db/nss_db.h +++ b/nss/nss_db/nss_db.h @@ -1,5 +1,5 @@ /* Common database open/close routines for nss_db. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 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 |