Message ID | 20170818203044.GB15188@gmail.com |
---|---|
State | New |
Headers | show |
* H. J. Lu: > extern service_user *__nss_group_database attribute_hidden; > -service_user *__nss_initgroups_database; > +service_user *__nss_initgroups_database attribute_hidden; > static bool use_initgroups_entry; Please use DEFINE_DATABASE in nsswitch.h instead to generate all __nss_*_database declarations (and remove the declaration from nss/XXX-lookup.c). > diff --git a/nss/getXXent.c b/nss/getXXent.c > index aad374197f..31bd24b924 100644 > --- a/nss/getXXent.c > +++ b/nss/getXXent.c > @@ -56,7 +56,7 @@ > /* Prototype of the reentrant version. */ > extern int INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, > size_t buflen, LOOKUP_TYPE **result > - H_ERRNO_PARM); > + H_ERRNO_PARM) attribute_hidden; Ideally, we should have a full complement of prototypes in include/, so that we get some type safety here. But until that, this part looks fine. > /* Flags whether custom rules for database is set. */ > -extern bool __nss_database_custom[NSS_DBSIDX_max]; > +extern bool __nss_database_custom[NSS_DBSIDX_max] attribute_hidden; The entire declaration should probably be guarded with #ifndef USE_NSCD because if the symbol is used from nscd, it would give wrong results.
diff --git a/grp/initgroups.c b/grp/initgroups.c index 0d5b841796..39fb29f43f 100644 --- a/grp/initgroups.c +++ b/grp/initgroups.c @@ -37,7 +37,7 @@ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t, gid_t **, long int, int *); extern service_user *__nss_group_database attribute_hidden; -service_user *__nss_initgroups_database; +service_user *__nss_initgroups_database attribute_hidden; static bool use_initgroups_entry; diff --git a/nss/getXXent.c b/nss/getXXent.c index aad374197f..31bd24b924 100644 --- a/nss/getXXent.c +++ b/nss/getXXent.c @@ -56,7 +56,7 @@ /* Prototype of the reentrant version. */ extern int INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen, LOOKUP_TYPE **result - H_ERRNO_PARM); + H_ERRNO_PARM) attribute_hidden; /* We need to protect the dynamic buffer handling. */ __libc_lock_define_initialized (static, lock); diff --git a/nss/nsswitch.h b/nss/nsswitch.h index 2b86d63ddb..342f6f75d2 100644 --- a/nss/nsswitch.h +++ b/nss/nsswitch.h @@ -106,7 +106,7 @@ enum }; /* Flags whether custom rules for database is set. */ -extern bool __nss_database_custom[NSS_DBSIDX_max]; +extern bool __nss_database_custom[NSS_DBSIDX_max] attribute_hidden; /* Warning for NSS functions, which don't require dlopen if glibc was built with --enable-static-nss. */