From: Eric Andersen Date: Wed, 3 Jul 2002 23:19:26 +0000 (-0000) Subject: Scrub pwd.h and grp.h handling so we don't have to play any X-Git-Tag: 0_60_4~131 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=887ca79f04cdf45874ed783c1fb9b950bf25a246;p=oweals%2Fbusybox.git Scrub pwd.h and grp.h handling so we don't have to play any silly games. -Erik --- diff --git a/Rules.mak b/Rules.mak index 2b0393309..d5b0127f8 100644 --- a/Rules.mak +++ b/Rules.mak @@ -91,7 +91,7 @@ export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP # To compile vs uClibc, just use the compiler wrapper built by uClibc... # Everything should compile and work as expected these days... -#CC:=/usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc +#CC:=/usr/i386-linux-uclibc/bin/i386-uclibc-gcc # To compile vs some other alternative libc, you may need to use/adjust # the following lines to meet your needs... diff --git a/applets/applets.c b/applets/applets.c index 9dcfe6b85..cfcff3a53 100644 --- a/applets/applets.c +++ b/applets/applets.c @@ -50,8 +50,8 @@ static void check_suid ( struct BB_applet *app ); #include #include -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" static int parse_config_file ( void ); diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 6e7705ed1..a5ac002e9 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -29,8 +29,8 @@ #include #include #include "busybox.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" /*struct passwd *getpwnam();*/ diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index 6b090437f..576526183 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c @@ -18,7 +18,7 @@ #include #include "busybox.h" -#include "pwd.h" +#include "pwd_.h" static int start = 0; static int stop = 0; diff --git a/include/grp.h b/include/grp.h deleted file mode 100644 index 12fecd02e..000000000 --- a/include/grp.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef __CONFIG_GRP_H -#define __CONFIG_GRP_H - -#if !defined CONFIG_USE_BB_PWD_GRP -#include_next - -#else - -#include -#include -#include - - -/* The group structure */ -struct group -{ - char *gr_name; /* Group name. */ - char *gr_passwd; /* Password. */ - gid_t gr_gid; /* Group ID. */ - char **gr_mem; /* Member list. */ -}; - -extern void setgrent __P ((void)); -extern void endgrent __P ((void)); -extern struct group * getgrent __P ((void)); - -extern struct group * getgrgid __P ((__const gid_t gid)); -extern struct group * getgrnam __P ((__const char * name)); - -extern struct group * fgetgrent __P ((FILE * file)); - -extern int setgroups __P ((size_t n, __const gid_t * groups)); -extern int initgroups __P ((__const char * user, gid_t gid)); - -extern struct group * __getgrent __P ((int grp_fd)); - -#endif /* USE_SYSTEM_PWD_GRP */ -#endif /* __CONFIG_GRP_H */ - diff --git a/include/grp_.h b/include/grp_.h new file mode 100644 index 000000000..0ce274cf0 --- /dev/null +++ b/include/grp_.h @@ -0,0 +1,39 @@ +#ifndef __CONFIG_GRP_H +#define __CONFIG_GRP_H + +#if !defined CONFIG_USE_BB_PWD_GRP +#include + +#else + +#include +#include +#include + + +/* The group structure */ +struct group +{ + char *gr_name; /* Group name. */ + char *gr_passwd; /* Password. */ + gid_t gr_gid; /* Group ID. */ + char **gr_mem; /* Member list. */ +}; + +extern void setgrent __P ((void)); +extern void endgrent __P ((void)); +extern struct group * getgrent __P ((void)); + +extern struct group * getgrgid __P ((__const gid_t gid)); +extern struct group * getgrnam __P ((__const char * name)); + +extern struct group * fgetgrent __P ((FILE * file)); + +extern int setgroups __P ((size_t n, __const gid_t * groups)); +extern int initgroups __P ((__const char * user, gid_t gid)); + +extern struct group * __getgrent __P ((int grp_fd)); + +#endif /* USE_SYSTEM_PWD_GRP */ +#endif /* __CONFIG_GRP_H */ + diff --git a/include/libbb.h b/include/libbb.h index f83cc7623..02babb884 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -39,8 +39,8 @@ #include "config.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" #ifdef CONFIG_FEATURE_SHADOWPASSWDS #include "shadow_.h" #endif diff --git a/include/pwd.h b/include/pwd.h deleted file mode 100644 index 178e9e97a..000000000 --- a/include/pwd.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CONFIG_PWD_H -#define __CONFIG_PWD_H - -#if !defined CONFIG_USE_BB_PWD_GRP -#include_next - -#else - -#include -#include -#include - -/* The passwd structure. */ -struct passwd -{ - char *pw_name; /* Username. */ - char *pw_passwd; /* Password. */ - uid_t pw_uid; /* User ID. */ - gid_t pw_gid; /* Group ID. */ - char *pw_gecos; /* Real name. */ - char *pw_dir; /* Home directory. */ - char *pw_shell; /* Shell program. */ -}; - -extern void setpwent __P ((void)); -extern void endpwent __P ((void)); -extern struct passwd * getpwent __P ((void)); - -extern int putpwent __P ((__const struct passwd * __p, FILE * __f)); -extern int getpw __P ((uid_t uid, char *buf)); - -extern struct passwd * fgetpwent __P ((FILE * file)); - -extern struct passwd * getpwuid __P ((__const uid_t)); -extern struct passwd * getpwnam __P ((__const char *)); - -extern struct passwd * __getpwent __P ((__const int passwd_fd)); - -#endif /* USE_SYSTEM_PWD_GRP */ -#endif /* __CONFIG_PWD_H */ - diff --git a/include/pwd_.h b/include/pwd_.h new file mode 100644 index 000000000..3f081e872 --- /dev/null +++ b/include/pwd_.h @@ -0,0 +1,41 @@ +#ifndef __CONFIG_PWD_H +#define __CONFIG_PWD_H + +#if !defined CONFIG_USE_BB_PWD_GRP +#include + +#else + +#include +#include +#include + +/* The passwd structure. */ +struct passwd +{ + char *pw_name; /* Username. */ + char *pw_passwd; /* Password. */ + uid_t pw_uid; /* User ID. */ + gid_t pw_gid; /* Group ID. */ + char *pw_gecos; /* Real name. */ + char *pw_dir; /* Home directory. */ + char *pw_shell; /* Shell program. */ +}; + +extern void setpwent __P ((void)); +extern void endpwent __P ((void)); +extern struct passwd * getpwent __P ((void)); + +extern int putpwent __P ((__const struct passwd * __p, FILE * __f)); +extern int getpw __P ((uid_t uid, char *buf)); + +extern struct passwd * fgetpwent __P ((FILE * file)); + +extern struct passwd * getpwuid __P ((__const uid_t)); +extern struct passwd * getpwnam __P ((__const char *)); + +extern struct passwd * __getpwent __P ((__const int passwd_fd)); + +#endif /* USE_SYSTEM_PWD_GRP */ +#endif /* __CONFIG_PWD_H */ + diff --git a/init/start_stop_daemon.c b/init/start_stop_daemon.c index 6b090437f..576526183 100644 --- a/init/start_stop_daemon.c +++ b/init/start_stop_daemon.c @@ -18,7 +18,7 @@ #include #include "busybox.h" -#include "pwd.h" +#include "pwd_.h" static int start = 0; static int stop = 0; diff --git a/libbb/my_getgrgid.c b/libbb/my_getgrgid.c index bf2067e46..88bafc97b 100644 --- a/libbb/my_getgrgid.c +++ b/libbb/my_getgrgid.c @@ -22,8 +22,8 @@ #include #include #include "libbb.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" /* gets a groupname given a gid */ diff --git a/libbb/my_getgrnam.c b/libbb/my_getgrnam.c index f21d482c6..f80d3f824 100644 --- a/libbb/my_getgrnam.c +++ b/libbb/my_getgrnam.c @@ -22,8 +22,8 @@ #include #include #include "libbb.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" /* returns a gid given a group name */ diff --git a/libbb/my_getpwnam.c b/libbb/my_getpwnam.c index db7f4a65f..04951a4d0 100644 --- a/libbb/my_getpwnam.c +++ b/libbb/my_getpwnam.c @@ -22,8 +22,8 @@ #include #include #include "libbb.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" /* returns a uid given a username */ diff --git a/libbb/my_getpwnamegid.c b/libbb/my_getpwnamegid.c index 4866b9717..07e02c1cf 100644 --- a/libbb/my_getpwnamegid.c +++ b/libbb/my_getpwnamegid.c @@ -22,8 +22,8 @@ #include #include #include "libbb.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" diff --git a/libbb/my_getpwuid.c b/libbb/my_getpwuid.c index 5236c7df3..2abe7a7f3 100644 --- a/libbb/my_getpwuid.c +++ b/libbb/my_getpwuid.c @@ -22,8 +22,8 @@ #include #include #include "libbb.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" diff --git a/libpwdgrp/__getgrent.c b/libpwdgrp/__getgrent.c index 571da3fc3..39cf1890a 100644 --- a/libpwdgrp/__getgrent.c +++ b/libpwdgrp/__getgrent.c @@ -23,7 +23,7 @@ #include #include #include -#include "grp.h" +#include "grp_.h" /* * Define GR_SCALE_DYNAMIC if you want grp to dynamically scale its read buffer diff --git a/libpwdgrp/__getpwent.c b/libpwdgrp/__getpwent.c index e406b8824..d553250f4 100644 --- a/libpwdgrp/__getpwent.c +++ b/libpwdgrp/__getpwent.c @@ -24,7 +24,7 @@ #include #include #include -#include "pwd.h" +#include "pwd_.h" #define PWD_BUFFER_SIZE 256 diff --git a/libpwdgrp/fgetgrent.c b/libpwdgrp/fgetgrent.c index c5d63e05f..1492a1a95 100644 --- a/libpwdgrp/fgetgrent.c +++ b/libpwdgrp/fgetgrent.c @@ -22,7 +22,7 @@ #include #include -#include "grp.h" +#include "grp_.h" struct group *fgetgrent(FILE * file) { diff --git a/libpwdgrp/fgetpwent.c b/libpwdgrp/fgetpwent.c index 6537600ff..54c3b3adc 100644 --- a/libpwdgrp/fgetpwent.c +++ b/libpwdgrp/fgetpwent.c @@ -22,7 +22,7 @@ #include #include -#include "pwd.h" +#include "pwd_.h" struct passwd *fgetpwent(FILE * file) { diff --git a/libpwdgrp/getgrgid.c b/libpwdgrp/getgrgid.c index e70346a77..73f0cca97 100644 --- a/libpwdgrp/getgrgid.c +++ b/libpwdgrp/getgrgid.c @@ -23,7 +23,7 @@ #include #include #include -#include "grp.h" +#include "grp_.h" struct group *getgrgid(const gid_t gid) { diff --git a/libpwdgrp/getgrnam.c b/libpwdgrp/getgrnam.c index 62b2b26ca..919622ea1 100644 --- a/libpwdgrp/getgrnam.c +++ b/libpwdgrp/getgrnam.c @@ -24,7 +24,7 @@ #include #include #include -#include "grp.h" +#include "grp_.h" struct group *getgrnam(const char *name) { diff --git a/libpwdgrp/getpw.c b/libpwdgrp/getpw.c index ca11188aa..d46e2c7da 100644 --- a/libpwdgrp/getpw.c +++ b/libpwdgrp/getpw.c @@ -23,7 +23,7 @@ #include #include #include -#include "pwd.h" +#include "pwd_.h" int getpw(uid_t uid, char *buf) { diff --git a/libpwdgrp/getpwnam.c b/libpwdgrp/getpwnam.c index 88a31f8c2..524fa09be 100644 --- a/libpwdgrp/getpwnam.c +++ b/libpwdgrp/getpwnam.c @@ -24,7 +24,7 @@ #include #include #include -#include "pwd.h" +#include "pwd_.h" struct passwd *getpwnam(const char *name) diff --git a/libpwdgrp/getpwuid.c b/libpwdgrp/getpwuid.c index 776ed12da..819c874ac 100644 --- a/libpwdgrp/getpwuid.c +++ b/libpwdgrp/getpwuid.c @@ -23,7 +23,7 @@ #include #include #include -#include "pwd.h" +#include "pwd_.h" struct passwd *getpwuid(uid_t uid) { diff --git a/libpwdgrp/grent.c b/libpwdgrp/grent.c index 5b1cb6823..df9195599 100644 --- a/libpwdgrp/grent.c +++ b/libpwdgrp/grent.c @@ -28,7 +28,7 @@ #include #include -#include "grp.h" +#include "grp_.h" static int grp_fd = -1; diff --git a/libpwdgrp/initgroups.c b/libpwdgrp/initgroups.c index 9b5dcbcb2..57b25f343 100644 --- a/libpwdgrp/initgroups.c +++ b/libpwdgrp/initgroups.c @@ -23,7 +23,7 @@ #include #include #include -#include "grp.h" +#include "grp_.h" /* * Define GR_SCALE_DYNAMIC if you want grp to dynamically scale its read buffer diff --git a/libpwdgrp/putpwent.c b/libpwdgrp/putpwent.c index 88dffc952..de285ebaf 100644 --- a/libpwdgrp/putpwent.c +++ b/libpwdgrp/putpwent.c @@ -22,7 +22,7 @@ #include #include -#include "pwd.h" +#include "pwd_.h" int putpwent(const struct passwd *passwd, FILE * f) { diff --git a/libpwdgrp/pwent.c b/libpwdgrp/pwent.c index 84bd6176b..1f4239741 100644 --- a/libpwdgrp/pwent.c +++ b/libpwdgrp/pwent.c @@ -23,7 +23,7 @@ #include #include #include -#include "pwd.h" +#include "pwd_.h" #include /* diff --git a/libpwdgrp/setgroups.c b/libpwdgrp/setgroups.c index c9b86f016..c3af1ea77 100644 --- a/libpwdgrp/setgroups.c +++ b/libpwdgrp/setgroups.c @@ -35,7 +35,7 @@ /* This is needed for libc5 */ #include #endif -#include "grp.h" +#include "grp_.h" //#define __NR_setgroups 81 _syscall2(int, setgroups, size_t, size, const gid_t *, list); diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index 87e98fb18..4a5ef8542 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c @@ -32,8 +32,8 @@ #include #include #include "busybox.h" -#include "pwd.h" -#include "grp.h" +#include "pwd_.h" +#include "grp_.h" /* structs __________________________ */ @@ -162,4 +162,4 @@ int addgroup_main(int argc, char **argv) return addgroup(group_file, group, gid); } -/* $Id: addgroup.c,v 1.2 2002/06/23 04:24:24 andersen Exp $ */ +/* $Id: addgroup.c,v 1.3 2002/07/03 23:19:18 andersen Exp $ */ diff --git a/networking/netstat.c b/networking/netstat.c index 67ecc0105..dcbcee21d 100644 --- a/networking/netstat.c +++ b/networking/netstat.c @@ -34,7 +34,7 @@ #include #include "inet_common.h" #include "busybox.h" -#include "pwd.h" +#include "pwd_.h" #ifdef CONFIG_ROUTE extern void displayroutes(int noresolve, int netstatfmt); diff --git a/shell/ash.c b/shell/ash.c index 80da35b59..366f704be 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -69,7 +69,7 @@ #include #include #include "busybox.h" -#include "pwd.h" +#include "pwd_.h" #if !defined(FNMATCH_BROKEN) @@ -12442,7 +12442,7 @@ findvar(struct var **vpp, const char *name) /* * Copyright (c) 1999 Herbert Xu * This file contains code for the times builtin. - * $Id: ash.c,v 1.52 2002/06/06 12:07:28 andersen Exp $ + * $Id: ash.c,v 1.53 2002/07/03 23:19:22 andersen Exp $ */ static int timescmd (int argc, char **argv) { diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 4c502df12..c5f2e9da2 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -82,7 +82,7 @@ #ifdef CONFIG_FEATURE_GETUSERNAME_AND_HOMEDIR # ifndef TEST -# include "pwd.h" +# include "pwd_.h" # else # include # endif /* TEST */