NSS: Do not use internal_function for functions with hidden aliases

Such functions are called across DSO boundaries and should not
use a non-standard ABI.
This commit is contained in:
Florian Weimer 2017-08-13 21:10:56 +02:00
parent 1b0bfc6946
commit b22974092d
9 changed files with 24 additions and 25 deletions

View File

@ -1,3 +1,17 @@
2017-08-13 Florian Weimer <fweimer@redhat.com>
* grp/grp-merge.h (__copy_grp, __merge_grp): Remove
internal_function.
* grp/grp-merge.c (__copy_grp, __merge_grp): Likewise.
* inet/netgroup.h (__internal_setnetgrent)
(__internal_endnetgrent,__internal_getnetgrent_r): Likewise.
* inet/getnetgrent_r.c (__internal_setnetgrent)
(__internal_endnetgrent,__internal_getnetgrent_r): Likewise.
* nss/XXX-lookup.c (DB_LOOKUP_FCT, DB_COMPAT_FCT): Likewise.
* nss/getXXbyYY_r.c (DB_LOOKUP_FCT): Likewise.
* nss/getXXent_r.c (DB_LOOKUP_FCT): Likewise.
* nss/nsswitch.h (db_lookup_function): Likewise.
2017-08-13 Florian Weimer <fweimer@redhat.com> 2017-08-13 Florian Weimer <fweimer@redhat.com>
* debug/fortify_fail.c (__fortify_fail, __fortify_fail_abort): * debug/fortify_fail.c (__fortify_fail, __fortify_fail_abort):

View File

@ -36,7 +36,6 @@
}) })
int int
internal_function
__copy_grp (const struct group srcgrp, const size_t buflen, __copy_grp (const struct group srcgrp, const size_t buflen,
struct group *destgrp, char *destbuf, char **endptr) struct group *destgrp, char *destbuf, char **endptr)
{ {
@ -117,7 +116,6 @@ libc_hidden_def (__copy_grp)
/* Check that the name, GID and passwd fields match, then /* Check that the name, GID and passwd fields match, then
copy in the gr_mem array. */ copy in the gr_mem array. */
int int
internal_function
__merge_grp (struct group *savedgrp, char *savedbuf, char *savedend, __merge_grp (struct group *savedgrp, char *savedbuf, char *savedend,
size_t buflen, struct group *mergegrp, char *mergebuf) size_t buflen, struct group *mergegrp, char *mergebuf)
{ {

View File

@ -25,13 +25,11 @@
calling function must free(newbuf). */ calling function must free(newbuf). */
int int
__copy_grp (const struct group srcgrp, const size_t buflen, __copy_grp (const struct group srcgrp, const size_t buflen,
struct group *destgrp, char *destbuf, char **endptr) struct group *destgrp, char *destbuf, char **endptr);
internal_function;
/* Merge the member lists of two grp structs together. */ /* Merge the member lists of two grp structs together. */
int int
__merge_grp (struct group *savedgrp, char *savedbuf, char *savedend, __merge_grp (struct group *savedgrp, char *savedbuf, char *savedend,
size_t buflen, struct group *mergegrp, char *mergebuf) size_t buflen, struct group *mergegrp, char *mergebuf);
internal_function;
#endif /* _GRP_MERGE_H */ #endif /* _GRP_MERGE_H */

View File

@ -172,7 +172,6 @@ __internal_setnetgrent_reuse (const char *group, struct __netgrent *datap,
} }
int int
internal_function
__internal_setnetgrent (const char *group, struct __netgrent *datap) __internal_setnetgrent (const char *group, struct __netgrent *datap)
{ {
/* Free list of all netgroup names from last run. */ /* Free list of all netgroup names from last run. */
@ -214,7 +213,6 @@ setnetgrent (const char *group)
} }
void void
internal_function
__internal_endnetgrent (struct __netgrent *datap) __internal_endnetgrent (struct __netgrent *datap)
{ {
endnetgrent_hook (datap); endnetgrent_hook (datap);
@ -263,7 +261,6 @@ nscd_getnetgrent (struct __netgrent *datap, char *buffer, size_t buflen,
#endif #endif
int int
internal_function
__internal_getnetgrent_r (char **hostp, char **userp, char **domainp, __internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
struct __netgrent *datap, struct __netgrent *datap,
char *buffer, size_t buflen, int *errnop) char *buffer, size_t buflen, int *errnop)

View File

@ -70,16 +70,13 @@ struct __netgrent
/* The internal netgroup handling functions might be called from outside. */ /* The internal netgroup handling functions might be called from outside. */
extern int __internal_setnetgrent (const char *group, extern int __internal_setnetgrent (const char *group,
struct __netgrent *datap) struct __netgrent *datap);
internal_function;
libc_hidden_proto (__internal_setnetgrent) libc_hidden_proto (__internal_setnetgrent)
extern void __internal_endnetgrent (struct __netgrent *datap) extern void __internal_endnetgrent (struct __netgrent *datap);
internal_function;
libc_hidden_proto (__internal_endnetgrent) libc_hidden_proto (__internal_endnetgrent)
extern int __internal_getnetgrent_r (char **hostp, char **userp, extern int __internal_getnetgrent_r (char **hostp, char **userp,
char **domainp, struct __netgrent *datap, char **domainp, struct __netgrent *datap,
char *buffer, size_t buflen, int *errnop) char *buffer, size_t buflen, int *errnop);
internal_function;
libc_hidden_proto (__internal_getnetgrent_r) libc_hidden_proto (__internal_getnetgrent_r)
#endif /* netgroup.h */ #endif /* netgroup.h */

View File

@ -56,12 +56,10 @@
service_user *DATABASE_NAME_SYMBOL attribute_hidden; service_user *DATABASE_NAME_SYMBOL attribute_hidden;
extern int DB_LOOKUP_FCT (service_user **ni, const char *fct_name, extern int DB_LOOKUP_FCT (service_user **ni, const char *fct_name,
const char *fct2_name, void **fctp) const char *fct2_name, void **fctp);
internal_function;
libc_hidden_proto (DB_LOOKUP_FCT) libc_hidden_proto (DB_LOOKUP_FCT)
int int
internal_function
DB_LOOKUP_FCT (service_user **ni, const char *fct_name, const char *fct2_name, DB_LOOKUP_FCT (service_user **ni, const char *fct_name, const char *fct2_name,
void **fctp) void **fctp)
{ {
@ -79,7 +77,7 @@ libc_hidden_def (DB_LOOKUP_FCT)
#ifndef NO_COMPAT #ifndef NO_COMPAT
int int
internal_function attribute_compat_text_section attribute_compat_text_section
DB_COMPAT_FCT (service_user **ni, const char *fct_name, void **fctp) DB_COMPAT_FCT (service_user **ni, const char *fct_name, void **fctp)
{ {
return DB_LOOKUP_FCT (ni, fct_name, NULL, fctp); return DB_LOOKUP_FCT (ni, fct_name, NULL, fctp);

View File

@ -180,8 +180,7 @@ typedef enum nss_status (*lookup_function) (ADD_PARAMS, LOOKUP_TYPE *, char *,
/* The lookup function for the first entry of this service. */ /* The lookup function for the first entry of this service. */
extern int DB_LOOKUP_FCT (service_user **nip, const char *name, extern int DB_LOOKUP_FCT (service_user **nip, const char *name,
const char *name2, void **fctp) const char *name2, void **fctp);
internal_function;
libc_hidden_proto (DB_LOOKUP_FCT) libc_hidden_proto (DB_LOOKUP_FCT)

View File

@ -113,8 +113,7 @@ __libc_lock_define_initialized (static, lock)
/* The lookup function for the first entry of this service. */ /* The lookup function for the first entry of this service. */
extern int DB_LOOKUP_FCT (service_user **nip, const char *name, extern int DB_LOOKUP_FCT (service_user **nip, const char *name,
const char *name2, void **fctp) const char *name2, void **fctp);
internal_function;
libc_hidden_proto (DB_LOOKUP_FCT) libc_hidden_proto (DB_LOOKUP_FCT)
void void

View File

@ -168,8 +168,7 @@ extern void __nss_disable_nscd (void (*) (size_t, struct traced_file *));
typedef int (*db_lookup_function) (service_user **, const char *, const char *, typedef int (*db_lookup_function) (service_user **, const char *, const char *,
void **) void **);
internal_function;
typedef enum nss_status (*setent_function) (int); typedef enum nss_status (*setent_function) (int);
typedef enum nss_status (*endent_function) (void); typedef enum nss_status (*endent_function) (void);
typedef enum nss_status (*getent_function) (void *, char *, size_t, typedef enum nss_status (*getent_function) (void *, char *, size_t,