From 57abdf3eaa424deafda497a4a896328238353e18 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 6 Dec 2020 15:32:11 +0000 Subject: Prepare for 0.1.0.0, add --enable-libc-includes configure switch pwd.h, grp.h and shadow.h will not overwrite the libc headers by default anymore; you need to explicitly add the switch. --- src/include/grp.h | 13 ------------- src/include/nsss/grp.h | 19 +++++++++++++++++++ src/include/nsss/pwd.h | 13 +++++++++++++ src/include/nsss/shadow.h | 19 +++++++++++++++++++ src/include/pwd.h | 7 ------- src/include/shadow.h | 13 ------------- 6 files changed, 51 insertions(+), 33 deletions(-) (limited to 'src/include') diff --git a/src/include/grp.h b/src/include/grp.h index a30fe79..7c5b8f9 100644 --- a/src/include/grp.h +++ b/src/include/grp.h @@ -10,17 +10,4 @@ #include -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#include -extern int setgroups (size_t, gid_t const *) ; -extern int initgroups (char const *, gid_t) ; -#endif - -#ifdef _GNU_SOURCE -#include -extern struct group *fgetgrent (FILE *) ; -extern int fgetgrent_r (FILE *, struct group *, char *, size_t, struct group **) ; -extern int putgrent (struct group const *, FILE *) ; -#endif - #endif diff --git a/src/include/nsss/grp.h b/src/include/nsss/grp.h index 0d56cbd..e26ae05 100644 --- a/src/include/nsss/grp.h +++ b/src/include/nsss/grp.h @@ -62,6 +62,25 @@ extern "C" { #endif #endif + /* + The following functions are not implemented by nsss. + However, the libc may implement them, so we still need to + declare them. Of course, we only declare functions that + do not conflict with nsss operation. + */ + +#if defined(_GNU_SOURCE) || defined(_DEFAULT_SOURCE) +#include +extern int setgroups (size_t, gid_t const *) ; +extern int initgroups (char const *, gid_t) ; +#endif + +#ifdef _GNU_SOURCE +#include +extern struct group *fgetgrent (FILE *) ; +extern int fgetgrent_r (FILE *, struct group *, char *, size_t, struct group **) ; +extern int putgrent (struct group const *, FILE *) ; +#endif #ifdef __cplusplus } diff --git a/src/include/nsss/pwd.h b/src/include/nsss/pwd.h index 950a5ce..f3c7000 100644 --- a/src/include/nsss/pwd.h +++ b/src/include/nsss/pwd.h @@ -50,6 +50,19 @@ extern "C" { #endif #endif + /* + The following functions are not implemented by nsss. + However, the libc may implement them, so we still need to + declare them. Of course, we only declare functions that + do not conflict with nsss operation. + */ + +#ifdef _GNU_SOURCE +#include +extern struct passwd *fgetpwent (FILE *) ; +extern int fgetpwent_r (FILE *, struct passwd *, char *, size_t, struct passwd **) ; +extern int putpwent (struct passwd const *, FILE *) ; +#endif #ifdef __cplusplus } diff --git a/src/include/nsss/shadow.h b/src/include/nsss/shadow.h index c3357fd..5665fc8 100644 --- a/src/include/nsss/shadow.h +++ b/src/include/nsss/shadow.h @@ -44,6 +44,25 @@ extern "C" { #endif #endif + /* + The following functions are not implemented by nsss. + However, the libc may implement them, so we still need to + declare them. Of course, we only declare functions that + do not conflict with nsss operation. + */ + +#include + +extern struct spwd *fgetspent (FILE *) ; +extern struct spwd *sgetspent (char const *) ; +extern int putspent (struct spwd const *, FILE *) ; +extern int lckpwdf (void) ; +extern int ulckpwdf (void) ; + +#ifdef _DEFAULT_SOURCE +extern int fgetspent_r(FILE *, struct spwd *, char *, size_t, struct spwd **) ; +extern int sgetspent_r (char const *, struct spwd *, char *, size_t, struct spwd **) ; +#endif #ifdef __cplusplus } diff --git a/src/include/pwd.h b/src/include/pwd.h index 6ad4faf..22aa835 100644 --- a/src/include/pwd.h +++ b/src/include/pwd.h @@ -10,11 +10,4 @@ #include -#ifdef _GNU_SOURCE -#include -extern struct passwd *fgetpwent (FILE *) ; -extern int fgetpwent_r (FILE *, struct passwd *, char *, size_t, struct passwd **) ; -extern int putpwent (struct passwd const *, FILE *) ; -#endif - #endif diff --git a/src/include/shadow.h b/src/include/shadow.h index 00d1944..96a2719 100644 --- a/src/include/shadow.h +++ b/src/include/shadow.h @@ -10,17 +10,4 @@ #include -#include - -extern struct spwd *fgetspent (FILE *) ; -extern struct spwd *sgetspent (char const *) ; -extern int putspent (struct spwd const *, FILE *) ; -extern int lckpwdf (void) ; -extern int ulckpwdf (void) ; - -#ifdef _DEFAULT_SOURCE -extern int fgetspent_r(FILE *, struct spwd *, char *, size_t, struct spwd **) ; -extern int sgetspent_r (char const *, struct spwd *, char *, size_t, struct spwd **) ; -#endif - #endif -- cgit 1.4.1