mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
libpwdgrp: comment out more unused functions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
55301297d3
commit
8d22ca81c3
@ -60,7 +60,7 @@ struct spwd {
|
|||||||
/* All function names below should be remapped by #defines above
|
/* All function names below should be remapped by #defines above
|
||||||
* in order to not collide with libc names. */
|
* in order to not collide with libc names. */
|
||||||
|
|
||||||
|
#ifdef UNUSED_FOR_NOW
|
||||||
/* Open database for reading */
|
/* Open database for reading */
|
||||||
extern void setspent(void);
|
extern void setspent(void);
|
||||||
|
|
||||||
@ -85,11 +85,13 @@ extern int putspent(const struct spwd *__p, FILE *__stream);
|
|||||||
/* Reentrant versions of some of the functions above */
|
/* Reentrant versions of some of the functions above */
|
||||||
extern int getspent_r(struct spwd *__result_buf, char *__buffer,
|
extern int getspent_r(struct spwd *__result_buf, char *__buffer,
|
||||||
size_t __buflen, struct spwd **__result);
|
size_t __buflen, struct spwd **__result);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int getspnam_r(const char *__name, struct spwd *__result_buf,
|
extern int getspnam_r(const char *__name, struct spwd *__result_buf,
|
||||||
char *__buffer, size_t __buflen,
|
char *__buffer, size_t __buflen,
|
||||||
struct spwd **__result);
|
struct spwd **__result);
|
||||||
|
|
||||||
|
#ifdef UNUSED_FOR_NOW
|
||||||
extern int sgetspent_r(const char *__string, struct spwd *__result_buf,
|
extern int sgetspent_r(const char *__string, struct spwd *__result_buf,
|
||||||
char *__buffer, size_t __buflen,
|
char *__buffer, size_t __buflen,
|
||||||
struct spwd **__result);
|
struct spwd **__result);
|
||||||
@ -102,6 +104,7 @@ extern int lckpwdf(void);
|
|||||||
|
|
||||||
/* Unlock password file */
|
/* Unlock password file */
|
||||||
extern int ulckpwdf(void);
|
extern int ulckpwdf(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
POP_SAVED_FUNCTION_VISIBILITY
|
POP_SAVED_FUNCTION_VISIBILITY
|
||||||
|
|
||||||
|
@ -164,6 +164,7 @@ int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_USE_BB_SHADOW
|
#if ENABLE_USE_BB_SHADOW
|
||||||
|
#ifdef UNUSED_FOR_NOW
|
||||||
int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
|
int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
|
||||||
char *__restrict buffer, size_t buflen,
|
char *__restrict buffer, size_t buflen,
|
||||||
struct spwd **__restrict result)
|
struct spwd **__restrict result)
|
||||||
@ -180,6 +181,7 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/* For the various fget??ent funcs, return NULL on failure and a
|
/* For the various fget??ent funcs, return NULL on failure and a
|
||||||
@ -212,7 +214,7 @@ struct group *fgetgrent(FILE *stream)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_USE_BB_SHADOW
|
#if ENABLE_USE_BB_SHADOW
|
||||||
#if 0
|
#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
|
||||||
struct spwd *fgetspent(FILE *stream)
|
struct spwd *fgetspent(FILE *stream)
|
||||||
{
|
{
|
||||||
struct statics *S;
|
struct statics *S;
|
||||||
@ -225,6 +227,7 @@ struct spwd *fgetspent(FILE *stream)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef UNUSED_FOR_NOW
|
||||||
int sgetspent_r(const char *string, struct spwd *result_buf,
|
int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||||
char *buffer, size_t buflen, struct spwd **result)
|
char *buffer, size_t buflen, struct spwd **result)
|
||||||
{
|
{
|
||||||
@ -254,6 +257,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* ENABLE_USE_BB_SHADOW */
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
@ -507,6 +511,7 @@ int getgrent_r(struct group *__restrict resultbuf,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef UNUSED_FOR_NOW
|
||||||
#if ENABLE_USE_BB_SHADOW
|
#if ENABLE_USE_BB_SHADOW
|
||||||
static FILE *spf /*= NULL*/;
|
static FILE *spf /*= NULL*/;
|
||||||
void setspent(void)
|
void setspent(void)
|
||||||
@ -554,6 +559,7 @@ int getspent_r(struct spwd *resultbuf, char *buffer,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* UNUSED_FOR_NOW */
|
||||||
|
|
||||||
#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
|
#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
|
||||||
struct passwd *getpwent(void)
|
struct passwd *getpwent(void)
|
||||||
@ -575,9 +581,8 @@ struct group *getgrent(void)
|
|||||||
getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
|
getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0 //ENABLE_USE_BB_SHADOW
|
#if ENABLE_USE_BB_SHADOW
|
||||||
struct spwd *getspent(void)
|
struct spwd *getspent(void)
|
||||||
{
|
{
|
||||||
static char line_buff[PWD_BUFFER_SIZE];
|
static char line_buff[PWD_BUFFER_SIZE];
|
||||||
@ -598,6 +603,7 @@ struct spwd *sgetspent(const char *string)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* UNUSED_SINCE_WE_AVOID_STATIC_BUFS */
|
||||||
|
|
||||||
static gid_t *getgrouplist_internal(int *ngroups_ptr, const char *user, gid_t gid)
|
static gid_t *getgrouplist_internal(int *ngroups_ptr, const char *user, gid_t gid)
|
||||||
{
|
{
|
||||||
@ -663,10 +669,13 @@ int putpwent(const struct passwd *__restrict p, FILE *__restrict f)
|
|||||||
{
|
{
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* glibc does this check */
|
||||||
if (!p || !f) {
|
if (!p || !f) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* No extra thread locking is needed above what fprintf does. */
|
/* No extra thread locking is needed above what fprintf does. */
|
||||||
if (fprintf(f, "%s:%s:%lu:%lu:%s:%s:%s\n",
|
if (fprintf(f, "%s:%s:%lu:%lu:%s:%s:%s\n",
|
||||||
@ -685,10 +694,13 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
|
|||||||
{
|
{
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
|
|
||||||
if (!p || !f) { /* Sigh... glibc checks. */
|
#if 0
|
||||||
|
/* glibc does this check */
|
||||||
|
if (!p || !f) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (fprintf(f, "%s:%s:%lu:",
|
if (fprintf(f, "%s:%s:%lu:",
|
||||||
p->gr_name, p->gr_passwd,
|
p->gr_name, p->gr_passwd,
|
||||||
@ -733,6 +745,7 @@ static const unsigned char put_sp_off[] ALIGN1 = {
|
|||||||
offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */
|
offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef UNUSED_FOR_NOW
|
||||||
int putspent(const struct spwd *p, FILE *stream)
|
int putspent(const struct spwd *p, FILE *stream)
|
||||||
{
|
{
|
||||||
const char *fmt;
|
const char *fmt;
|
||||||
@ -770,9 +783,10 @@ int putspent(const struct spwd *p, FILE *stream)
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* USE_BB_SHADOW */
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/* Internal uClibc functions. */
|
/* Internal functions */
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
||||||
static const unsigned char pw_off[] ALIGN1 = {
|
static const unsigned char pw_off[] ALIGN1 = {
|
||||||
@ -879,9 +893,9 @@ static int FAST_FUNC bb__parsegrent(void *data, char *line)
|
|||||||
|
|
||||||
if (p[1]) { /* We have a member list to process. */
|
if (p[1]) { /* We have a member list to process. */
|
||||||
/* Overwrite the last ':' with a ',' before counting.
|
/* Overwrite the last ':' with a ',' before counting.
|
||||||
* This allows us to test for initial ',' and adds
|
* This allows us to (1) test for initial ','
|
||||||
* one ',' so that the ',' count equals the member
|
* and (2) adds one ',' so that the number of commas
|
||||||
* count. */
|
* equals the member count. */
|
||||||
*p = ',';
|
*p = ',';
|
||||||
do {
|
do {
|
||||||
/* NOTE: glibc difference - glibc allows and trims leading
|
/* NOTE: glibc difference - glibc allows and trims leading
|
||||||
|
Loading…
Reference in New Issue
Block a user