/* All function names below should be remapped by #defines above
* in order to not collide with libc names. */
-
+#ifdef UNUSED_FOR_NOW
/* Open database for reading */
extern void setspent(void);
/* Reentrant versions of some of the functions above */
extern int getspent_r(struct spwd *__result_buf, char *__buffer,
size_t __buflen, struct spwd **__result);
+#endif
extern int getspnam_r(const char *__name, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
struct spwd **__result);
+#ifdef UNUSED_FOR_NOW
extern int sgetspent_r(const char *__string, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
struct spwd **__result);
/* Unlock password file */
extern int ulckpwdf(void);
+#endif
POP_SAVED_FUNCTION_VISIBILITY
}
#if ENABLE_USE_BB_SHADOW
+#ifdef UNUSED_FOR_NOW
int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct spwd **__restrict result)
return rv;
}
#endif
+#endif
/**********************************************************************/
/* For the various fget??ent funcs, return NULL on failure and a
#endif
#if ENABLE_USE_BB_SHADOW
-#if 0
+#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
struct spwd *fgetspent(FILE *stream)
{
struct statics *S;
}
#endif
+#ifdef UNUSED_FOR_NOW
int sgetspent_r(const char *string, struct spwd *result_buf,
char *buffer, size_t buflen, struct spwd **result)
{
return rv;
}
#endif
+#endif /* ENABLE_USE_BB_SHADOW */
/**********************************************************************/
return rv;
}
+#ifdef UNUSED_FOR_NOW
#if ENABLE_USE_BB_SHADOW
static FILE *spf /*= NULL*/;
void setspent(void)
return rv;
}
#endif
+#endif /* UNUSED_FOR_NOW */
#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
struct passwd *getpwent(void)
getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
return result;
}
-#endif
-#if 0 //ENABLE_USE_BB_SHADOW
+#if ENABLE_USE_BB_SHADOW
struct spwd *getspent(void)
{
static char line_buff[PWD_BUFFER_SIZE];
return result;
}
#endif
+#endif /* UNUSED_SINCE_WE_AVOID_STATIC_BUFS */
static gid_t *getgrouplist_internal(int *ngroups_ptr, const char *user, gid_t gid)
{
{
int rv = -1;
+#if 0
+ /* glibc does this check */
if (!p || !f) {
errno = EINVAL;
return rv;
}
+#endif
/* No extra thread locking is needed above what fprintf does. */
if (fprintf(f, "%s:%s:%lu:%lu:%s:%s:%s\n",
{
int rv = -1;
- if (!p || !f) { /* Sigh... glibc checks. */
+#if 0
+ /* glibc does this check */
+ if (!p || !f) {
errno = EINVAL;
return rv;
}
+#endif
if (fprintf(f, "%s:%s:%lu:",
p->gr_name, p->gr_passwd,
offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */
};
+#ifdef UNUSED_FOR_NOW
int putspent(const struct spwd *p, FILE *stream)
{
const char *fmt;
return rv;
}
#endif
+#endif /* USE_BB_SHADOW */
/**********************************************************************/
-/* Internal uClibc functions. */
+/* Internal functions */
/**********************************************************************/
static const unsigned char pw_off[] ALIGN1 = {
if (p[1]) { /* We have a member list to process. */
/* Overwrite the last ':' with a ',' before counting.
- * This allows us to test for initial ',' and adds
- * one ',' so that the ',' count equals the member
- * count. */
+ * This allows us to (1) test for initial ','
+ * and (2) adds one ',' so that the number of commas
+ * equals the member count. */
*p = ',';
do {
/* NOTE: glibc difference - glibc allows and trims leading