diff --git a/appl/ftp/common/glob.c b/appl/ftp/common/glob.c index 633c6881c..0de3439ed 100644 --- a/appl/ftp/common/glob.c +++ b/appl/ftp/common/glob.c @@ -371,7 +371,7 @@ globtilde(const Char *pattern, Char *patbuf, glob_t *pglob) /* * Expand a ~user */ - if ((pwd = getpwnam((char*) patbuf)) == NULL) + if ((pwd = k_getpwnam((char*) patbuf)) == NULL) return pattern; else h = pwd->pw_dir; diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index 4a659a841..32812e507 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -201,7 +201,7 @@ static char *gunique (char *); static void lostconn (int); static int receive_data (FILE *, FILE *); static void send_data (FILE *, FILE *, off_t); -static struct passwd * sgetpwnam (char *); +static struct passwd * sk_getpwnam (char *); static char * curdir(void) @@ -464,7 +464,7 @@ sgetpwnam(char *name) static struct passwd save; struct passwd *p; - if ((p = getpwnam(name)) == NULL) + if ((p = k_getpwnam(name)) == NULL) return (p); if (save.pw_name) { free(save.pw_name); diff --git a/appl/kx/kxd.c b/appl/kx/kxd.c index 04560b954..cf7093a92 100644 --- a/appl/kx/kxd.c +++ b/appl/kx/kxd.c @@ -51,7 +51,7 @@ recv_conn (int sock, des_cblock *key, des_key_schedule schedule, strncmp(version, "KXSERV.0", KRB_SENDAUTH_VLEN) != 0) { return 1; } - passwd = getpwnam (auth.pname); + passwd = k_getpwnam (auth.pname); if (passwd == NULL) return fatal (sock, "Cannot find uid"); username = strdup (passwd->pw_name); diff --git a/appl/popper/pop_pass.c b/appl/popper/pop_pass.c index 670c087e0..db579052c 100644 --- a/appl/popper/pop_pass.c +++ b/appl/popper/pop_pass.c @@ -31,7 +31,7 @@ pop_pass (POP *p) #endif /* KERBEROS */ /* Look for the user in the password file */ - if ((pw = getpwnam(p->user)) == NULL) + if ((pw = k_getpwnam(p->user)) == NULL) return (pop_msg(p,POP_FAILURE, "Password supplied for \"%s\" is incorrect.",p->user)); diff --git a/appl/telnet/libtelnet/forward.c b/appl/telnet/libtelnet/forward.c index d7223eda3..f7ba47054 100644 --- a/appl/telnet/libtelnet/forward.c +++ b/appl/telnet/libtelnet/forward.c @@ -420,7 +420,7 @@ rd_and_store_for_creds(inbuf, ticket, lusername) return(retval); } - if (!(pwd = (struct passwd *) getpwnam(lusername))) { + if (!(pwd = (struct passwd *) k_getpwnam(lusername))) { return -1; } diff --git a/appl/telnet/libtelnet/krb4encpwd.c b/appl/telnet/libtelnet/krb4encpwd.c index 90e764d56..d26930ca5 100644 --- a/appl/telnet/libtelnet/krb4encpwd.c +++ b/appl/telnet/libtelnet/krb4encpwd.c @@ -413,7 +413,7 @@ char *name, *passwd; struct passwd *pwd; int passwdok_status = 0; - if (pwd = getpwnam(name)) + if (pwd = k_getpwnam(name)) salt = pwd->pw_passwd; else salt = "xx"; diff --git a/appl/telnet/libtelnet/rsaencpwd.c b/appl/telnet/libtelnet/rsaencpwd.c index 2e23dc37f..d0a2ec63b 100644 --- a/appl/telnet/libtelnet/rsaencpwd.c +++ b/appl/telnet/libtelnet/rsaencpwd.c @@ -462,7 +462,7 @@ char *name, *passwd; struct passwd *pwd; int passwdok_status = 0; - if (pwd = getpwnam(name)) + if (pwd = k_getpwnam(name)) salt = pwd->pw_passwd; else salt = "xx"; diff --git a/appl/telnet/libtelnet/spx.c b/appl/telnet/libtelnet/spx.c index e866670c7..fe55035d4 100644 --- a/appl/telnet/libtelnet/spx.c +++ b/appl/telnet/libtelnet/spx.c @@ -488,7 +488,7 @@ spx_status(ap, name, level) * and acl_file to "~kannan/.sphinx" */ - pwd = getpwnam(UserNameRequested); + pwd = k_getpwnam(UserNameRequested); if (pwd == NULL) { return(AUTH_USER); /* not authenticated */ } diff --git a/appl/telnet/telnet/commands.c b/appl/telnet/telnet/commands.c index ea56a0b16..fc1071968 100644 --- a/appl/telnet/telnet/commands.c +++ b/appl/telnet/telnet/commands.c @@ -2362,7 +2362,7 @@ int tn(int argc, char **argv) user = getenv("USER"); if (user == NULL || - ((pw = getpwnam(user)) && pw->pw_uid != getuid())) { + ((pw = k_getpwnam(user)) && pw->pw_uid != getuid())) { if (pw = getpwuid(getuid())) user = pw->pw_name; else diff --git a/lib/roken/Makefile.in b/lib/roken/Makefile.in index 686300ee5..755f03767 100644 --- a/lib/roken/Makefile.in +++ b/lib/roken/Makefile.in @@ -31,7 +31,7 @@ SHLIBEXT = @SHLIBEXT@ LIB = $(LIBNAME).$(LIBEXT) -OBJECTS = signal.o @LIBOBJS@ +OBJECTS = k_getpwnam.o signal.o @LIBOBJS@ all: $(LIB) diff --git a/lib/roken/glob.c b/lib/roken/glob.c index 633c6881c..0de3439ed 100644 --- a/lib/roken/glob.c +++ b/lib/roken/glob.c @@ -371,7 +371,7 @@ globtilde(const Char *pattern, Char *patbuf, glob_t *pglob) /* * Expand a ~user */ - if ((pwd = getpwnam((char*) patbuf)) == NULL) + if ((pwd = k_getpwnam((char*) patbuf)) == NULL) return pattern; else h = pwd->pw_dir; diff --git a/lib/roken/iruserok.c b/lib/roken/iruserok.c index 1bcd48a3d..72d322034 100644 --- a/lib/roken/iruserok.c +++ b/lib/roken/iruserok.c @@ -220,7 +220,7 @@ again: } if (first == 1 && (__check_rhosts_file || superuser)) { first = 0; - if ((pwd = getpwnam(luser)) == NULL) + if ((pwd = k_getpwnam(luser)) == NULL) return (-1); (void)strcpy(pbuf, pwd->pw_dir); (void)strcat(pbuf, "/.rhosts"); diff --git a/lib/roken/roken.h b/lib/roken/roken.h index cd2a1333a..30c7c83d0 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -70,4 +70,7 @@ int getent(char *cp, char *name); char *getstr(char *id, char **cpp); #endif +#include +struct passwd *k_getpwnam (char *user); + #endif /* __ROKEN_H__ */ diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index cd2a1333a..30c7c83d0 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -70,4 +70,7 @@ int getent(char *cp, char *name); char *getstr(char *id, char **cpp); #endif +#include +struct passwd *k_getpwnam (char *user); + #endif /* __ROKEN_H__ */