X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fidcache.c;h=4951873d1d50e7259e1c84085fad74e2d23eae4a;hb=671c9011cb6944a63f0d15f60252c31bf0ee8e9b;hp=0398b69f1ae7511fdb3d73f5466efb74205720da;hpb=611fb5fc426cff563944cc44c637c8dbb5eb39a6;p=gnulib.git diff --git a/lib/idcache.c b/lib/idcache.c index 0398b69f1..4951873d1 100644 --- a/lib/idcache.c +++ b/lib/idcache.c @@ -1,12 +1,12 @@ /* idcache.c -- map user and group IDs, cached for speed - Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998, 2003, 2005, 2006 + Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998, 2003, 2005-2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,15 +14,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include +#include "idcache.h" #include #include #include -#include #include #include @@ -45,11 +44,24 @@ struct userid char name[FLEXIBLE_ARRAY_MEMBER]; }; +/* FIXME: provide a function to free any malloc'd storage and reset lists, + so that an application can use code like this just before exiting: + #ifdef lint + idcache_clear (); + #endif +*/ + static struct userid *user_alist; -/* The members of this list have names not in the local passwd file. */ +/* Each entry on list is a user name for which the first lookup failed. */ static struct userid *nouser_alist; +/* Use the same struct as for userids. */ +static struct userid *group_alist; + +/* Each entry on list is a group name for which the first lookup failed. */ +static struct userid *nogroup_alist; + /* Translate UID to a login name, with cache, or NULL if unresolved. */ char * @@ -132,10 +144,6 @@ getuidbyname (const char *user) return NULL; } -/* Use the same struct as for userids. */ -static struct userid *group_alist; -static struct userid *nogroup_alist; - /* Translate GID to a group name, with cache, or NULL if unresolved. */ char *