aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-03-31 14:43:58 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-03-31 14:43:58 +0200
commit8d22ca81c34a9127f96cf3bb85b6a64ae17e23b4 (patch)
treedd0c479b13e480320ff6468b9c7946f1ab027b0d
parent55301297d3e4c05ec37faf1e1695f79a74ce2cab (diff)
downloadbusybox-w32-8d22ca81c34a9127f96cf3bb85b6a64ae17e23b4.tar.gz
busybox-w32-8d22ca81c34a9127f96cf3bb85b6a64ae17e23b4.tar.bz2
busybox-w32-8d22ca81c34a9127f96cf3bb85b6a64ae17e23b4.zip
libpwdgrp: comment out more unused functions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/shadow_.h5
-rw-r--r--libpwdgrp/pwd_grp.c30
2 files changed, 26 insertions, 9 deletions
diff --git a/include/shadow_.h b/include/shadow_.h
index 98bd45d04..de126ddec 100644
--- a/include/shadow_.h
+++ b/include/shadow_.h
@@ -60,7 +60,7 @@ struct spwd {
60/* All function names below should be remapped by #defines above 60/* All function names below should be remapped by #defines above
61 * in order to not collide with libc names. */ 61 * in order to not collide with libc names. */
62 62
63 63#ifdef UNUSED_FOR_NOW
64/* Open database for reading */ 64/* Open database for reading */
65extern void setspent(void); 65extern void setspent(void);
66 66
@@ -85,11 +85,13 @@ extern int putspent(const struct spwd *__p, FILE *__stream);
85/* Reentrant versions of some of the functions above */ 85/* Reentrant versions of some of the functions above */
86extern int getspent_r(struct spwd *__result_buf, char *__buffer, 86extern int getspent_r(struct spwd *__result_buf, char *__buffer,
87 size_t __buflen, struct spwd **__result); 87 size_t __buflen, struct spwd **__result);
88#endif
88 89
89extern int getspnam_r(const char *__name, struct spwd *__result_buf, 90extern int getspnam_r(const char *__name, struct spwd *__result_buf,
90 char *__buffer, size_t __buflen, 91 char *__buffer, size_t __buflen,
91 struct spwd **__result); 92 struct spwd **__result);
92 93
94#ifdef UNUSED_FOR_NOW
93extern int sgetspent_r(const char *__string, struct spwd *__result_buf, 95extern int sgetspent_r(const char *__string, struct spwd *__result_buf,
94 char *__buffer, size_t __buflen, 96 char *__buffer, size_t __buflen,
95 struct spwd **__result); 97 struct spwd **__result);
@@ -102,6 +104,7 @@ extern int lckpwdf(void);
102 104
103/* Unlock password file */ 105/* Unlock password file */
104extern int ulckpwdf(void); 106extern int ulckpwdf(void);
107#endif
105 108
106POP_SAVED_FUNCTION_VISIBILITY 109POP_SAVED_FUNCTION_VISIBILITY
107 110
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
index 5c61e5638..87ab7391e 100644
--- a/libpwdgrp/pwd_grp.c
+++ b/libpwdgrp/pwd_grp.c
@@ -164,6 +164,7 @@ int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
164} 164}
165 165
166#if ENABLE_USE_BB_SHADOW 166#if ENABLE_USE_BB_SHADOW
167#ifdef UNUSED_FOR_NOW
167int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf, 168int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
168 char *__restrict buffer, size_t buflen, 169 char *__restrict buffer, size_t buflen,
169 struct spwd **__restrict result) 170 struct spwd **__restrict result)
@@ -180,6 +181,7 @@ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
180 return rv; 181 return rv;
181} 182}
182#endif 183#endif
184#endif
183 185
184/**********************************************************************/ 186/**********************************************************************/
185/* For the various fget??ent funcs, return NULL on failure and a 187/* For the various fget??ent funcs, return NULL on failure and a
@@ -212,7 +214,7 @@ struct group *fgetgrent(FILE *stream)
212#endif 214#endif
213 215
214#if ENABLE_USE_BB_SHADOW 216#if ENABLE_USE_BB_SHADOW
215#if 0 217#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
216struct spwd *fgetspent(FILE *stream) 218struct spwd *fgetspent(FILE *stream)
217{ 219{
218 struct statics *S; 220 struct statics *S;
@@ -225,6 +227,7 @@ struct spwd *fgetspent(FILE *stream)
225} 227}
226#endif 228#endif
227 229
230#ifdef UNUSED_FOR_NOW
228int sgetspent_r(const char *string, struct spwd *result_buf, 231int sgetspent_r(const char *string, struct spwd *result_buf,
229 char *buffer, size_t buflen, struct spwd **result) 232 char *buffer, size_t buflen, struct spwd **result)
230{ 233{
@@ -254,6 +257,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
254 return rv; 257 return rv;
255} 258}
256#endif 259#endif
260#endif /* ENABLE_USE_BB_SHADOW */
257 261
258/**********************************************************************/ 262/**********************************************************************/
259 263
@@ -507,6 +511,7 @@ int getgrent_r(struct group *__restrict resultbuf,
507 return rv; 511 return rv;
508} 512}
509 513
514#ifdef UNUSED_FOR_NOW
510#if ENABLE_USE_BB_SHADOW 515#if ENABLE_USE_BB_SHADOW
511static FILE *spf /*= NULL*/; 516static FILE *spf /*= NULL*/;
512void setspent(void) 517void setspent(void)
@@ -554,6 +559,7 @@ int getspent_r(struct spwd *resultbuf, char *buffer,
554 return rv; 559 return rv;
555} 560}
556#endif 561#endif
562#endif /* UNUSED_FOR_NOW */
557 563
558#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS 564#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
559struct passwd *getpwent(void) 565struct passwd *getpwent(void)
@@ -575,9 +581,8 @@ struct group *getgrent(void)
575 getgrent_r(&gr, line_buff, sizeof(line_buff), &result); 581 getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
576 return result; 582 return result;
577} 583}
578#endif
579 584
580#if 0 //ENABLE_USE_BB_SHADOW 585#if ENABLE_USE_BB_SHADOW
581struct spwd *getspent(void) 586struct spwd *getspent(void)
582{ 587{
583 static char line_buff[PWD_BUFFER_SIZE]; 588 static char line_buff[PWD_BUFFER_SIZE];
@@ -598,6 +603,7 @@ struct spwd *sgetspent(const char *string)
598 return result; 603 return result;
599} 604}
600#endif 605#endif
606#endif /* UNUSED_SINCE_WE_AVOID_STATIC_BUFS */
601 607
602static gid_t *getgrouplist_internal(int *ngroups_ptr, const char *user, gid_t gid) 608static gid_t *getgrouplist_internal(int *ngroups_ptr, const char *user, gid_t gid)
603{ 609{
@@ -663,10 +669,13 @@ int putpwent(const struct passwd *__restrict p, FILE *__restrict f)
663{ 669{
664 int rv = -1; 670 int rv = -1;
665 671
672#if 0
673 /* glibc does this check */
666 if (!p || !f) { 674 if (!p || !f) {
667 errno = EINVAL; 675 errno = EINVAL;
668 return rv; 676 return rv;
669 } 677 }
678#endif
670 679
671 /* No extra thread locking is needed above what fprintf does. */ 680 /* No extra thread locking is needed above what fprintf does. */
672 if (fprintf(f, "%s:%s:%lu:%lu:%s:%s:%s\n", 681 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)
685{ 694{
686 int rv = -1; 695 int rv = -1;
687 696
688 if (!p || !f) { /* Sigh... glibc checks. */ 697#if 0
698 /* glibc does this check */
699 if (!p || !f) {
689 errno = EINVAL; 700 errno = EINVAL;
690 return rv; 701 return rv;
691 } 702 }
703#endif
692 704
693 if (fprintf(f, "%s:%s:%lu:", 705 if (fprintf(f, "%s:%s:%lu:",
694 p->gr_name, p->gr_passwd, 706 p->gr_name, p->gr_passwd,
@@ -733,6 +745,7 @@ static const unsigned char put_sp_off[] ALIGN1 = {
733 offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */ 745 offsetof(struct spwd, sp_expire) /* 7 - not a char ptr */
734}; 746};
735 747
748#ifdef UNUSED_FOR_NOW
736int putspent(const struct spwd *p, FILE *stream) 749int putspent(const struct spwd *p, FILE *stream)
737{ 750{
738 const char *fmt; 751 const char *fmt;
@@ -770,9 +783,10 @@ int putspent(const struct spwd *p, FILE *stream)
770 return rv; 783 return rv;
771} 784}
772#endif 785#endif
786#endif /* USE_BB_SHADOW */
773 787
774/**********************************************************************/ 788/**********************************************************************/
775/* Internal uClibc functions. */ 789/* Internal functions */
776/**********************************************************************/ 790/**********************************************************************/
777 791
778static const unsigned char pw_off[] ALIGN1 = { 792static const unsigned char pw_off[] ALIGN1 = {
@@ -879,9 +893,9 @@ static int FAST_FUNC bb__parsegrent(void *data, char *line)
879 893
880 if (p[1]) { /* We have a member list to process. */ 894 if (p[1]) { /* We have a member list to process. */
881 /* Overwrite the last ':' with a ',' before counting. 895 /* Overwrite the last ':' with a ',' before counting.
882 * This allows us to test for initial ',' and adds 896 * This allows us to (1) test for initial ','
883 * one ',' so that the ',' count equals the member 897 * and (2) adds one ',' so that the number of commas
884 * count. */ 898 * equals the member count. */
885 *p = ','; 899 *p = ',';
886 do { 900 do {
887 /* NOTE: glibc difference - glibc allows and trims leading 901 /* NOTE: glibc difference - glibc allows and trims leading