diff --git a/appl/ftp/ftp/ftp.c b/appl/ftp/ftp/ftp.c index 9ac5cf6fc..0edaae326 100644 --- a/appl/ftp/ftp/ftp.c +++ b/appl/ftp/ftp/ftp.c @@ -170,12 +170,11 @@ login(char *host) int n, aflag = 0; char *myname = NULL; - struct passwd *pw = getpwuid(getuid()); + struct passwd *pw = k_getpwuid(getuid()); if (pw != NULL) myname = pw->pw_name; user = pass = acct = 0; - if(do_klogin(host)) printf("\n*** Using plaintext user and password ***\n\n"); diff --git a/appl/ftp/ftp/main.c b/appl/ftp/ftp/main.c index bfe9ba1d0..770156e68 100644 --- a/appl/ftp/ftp/main.c +++ b/appl/ftp/ftp/main.c @@ -100,7 +100,7 @@ main(int argc, char **argv) /* * Set up the home directory in case we're globbing. */ - pw = getpwuid(getuid()); + pw = k_getpwuid(getuid()); if (pw != NULL) { home = homedir; strcpy(home, pw->pw_dir); diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index c7b183cc2..06ee6795d 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -254,9 +254,13 @@ parse_auth_level(char *str) { char *p; int ret = 0; - p = strtok(str, ","); - while(p){ - if(strcmp(p, "user") == 0) ; + char *foo; + + for(p = strtok_r(str, ",", &foo); + p; + p = strtok_r(NULL, ",", &foo)) { + if(strcmp(p, "user") == 0) + ; else if(strcmp(p, "otp") == 0) ret |= AUTH_PLAIN|AUTH_OTP; else if(strcmp(p, "ftp") == 0 || @@ -268,7 +272,6 @@ parse_auth_level(char *str) ret |= AUTH_PLAIN|AUTH_FTP; else warnx("bad value for -a"); - p = strtok(NULL, ","); } return ret; } diff --git a/appl/ftp/ftpd/popen.c b/appl/ftp/ftpd/popen.c index c87ebf327..057988961 100644 --- a/appl/ftp/ftpd/popen.c +++ b/appl/ftp/ftpd/popen.c @@ -80,7 +80,7 @@ ftp_rooted(const char *path) static char newpath[MaxPathLen]; struct passwd *pwd; if(!home[0]) - if((pwd = getpwnam("ftp"))) + if((pwd = k_getpwnam("ftp"))) strcpy(home, pwd->pw_dir); sprintf(newpath, "%s/%s", home, path); if(access(newpath, X_OK)) @@ -96,6 +96,7 @@ ftpd_popen(char *program, char *type, int do_stderr, int no_glob) FILE *iop; int argc, gargc, pdes[2], pid; char **pop, *argv[100], *gargv[1000]; + char *foo; if (strcmp(type, "r") && strcmp(type, "w")) return (NULL); @@ -117,7 +118,7 @@ ftpd_popen(char *program, char *type, int do_stderr, int no_glob) /* break up string into pieces */ for (argc = 0, cp = program;; cp = NULL) - if (!(argv[argc++] = strtok(cp, " \t\n"))) + if (!(argv[argc++] = strtok_r(cp, " \t\n", &foo))) break; gargv[0] = (char*)ftp_rooted(argv[0]); diff --git a/appl/otp/otp.c b/appl/otp/otp.c index 53bff22c2..a1f9ed6c9 100644 --- a/appl/otp/otp.c +++ b/appl/otp/otp.c @@ -74,7 +74,7 @@ renew (int argc, char **argv, OtpAlgorithm *alg) if (argc != 2) usage(); - pwd = getpwuid (getuid ()); + pwd = k_getpwuid (getuid ()); if (pwd == NULL) { fprintf(stderr, "%s: You don't exist\n", prog); return 1; @@ -127,7 +127,7 @@ set (int argc, char **argv, OtpAlgorithm *alg) if (argc != 2) usage(); - pwd = getpwuid (getuid ()); + pwd = k_getpwuid (getuid ()); if (pwd == NULL) { fprintf(stderr, "%s: You don't exist\n", prog); return 1; diff --git a/appl/telnet/libtelnet/forward.c b/appl/telnet/libtelnet/forward.c index cc623745f..3c3eb2379 100644 --- a/appl/telnet/libtelnet/forward.c +++ b/appl/telnet/libtelnet/forward.c @@ -415,7 +415,7 @@ rd_and_store_for_creds(inbuf, ticket, lusername) return(retval); } - if (!(pwd = (struct passwd *) k_getpwnam(lusername))) { + if (!(pwd = k_getpwnam(lusername))) { return -1; } diff --git a/appl/telnet/telnet/commands.c b/appl/telnet/telnet/commands.c index 2b8bad41f..8132e53ed 100644 --- a/appl/telnet/telnet/commands.c +++ b/appl/telnet/telnet/commands.c @@ -2372,7 +2372,7 @@ int tn(int argc, char **argv) user = getenv("USER"); if (user == NULL || ((pw = k_getpwnam(user)) && pw->pw_uid != getuid())) { - if (pw = getpwuid(getuid())) + if (pw = k_getpwuid(getuid())) user = pw->pw_name; else user = NULL;