diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-08-18 18:31:22 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-08-18 18:31:22 +0000 |
commit | aa5ec6e986b2282d373774bb1dfbc0d8d4bd2b6f (patch) | |
tree | f0cfddb8baa8a94c8ddcc4e24b32cfd363e85775 /libexec | |
parent | f635e5aa9e03108817900699c84263901777bd52 (diff) |
strlcpy invades the tree
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/fingerd/fingerd.c | 6 | ||||
-rw-r--r-- | libexec/login_radius/raddauth.c | 4 | ||||
-rw-r--r-- | libexec/login_token/token.c | 4 | ||||
-rw-r--r-- | libexec/rpc.rusersd/rusers_proc.c | 22 |
4 files changed, 18 insertions, 18 deletions
diff --git a/libexec/fingerd/fingerd.c b/libexec/fingerd/fingerd.c index db9690cce84..f5630c6ab29 100644 --- a/libexec/fingerd/fingerd.c +++ b/libexec/fingerd/fingerd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fingerd.c,v 1.21 2001/07/08 21:18:07 deraadt Exp $ */ +/* $OpenBSD: fingerd.c,v 1.22 2001/08/18 18:31:21 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "from: @(#)fingerd.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$OpenBSD: fingerd.c,v 1.21 2001/07/08 21:18:07 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: fingerd.c,v 1.22 2001/08/18 18:31:21 deraadt Exp $"; #endif #endif /* not lint */ @@ -135,7 +135,7 @@ main(argc, argv) sa = (struct sockaddr *)&ss; if (getnameinfo(sa, sa->sa_len, hostbuf, sizeof(hostbuf), NULL, 0, 0) != 0) { - strncpy(hostbuf, "?", sizeof(hostbuf)); + strlcpy(hostbuf, "?", sizeof(hostbuf)); } hname = hostbuf; } diff --git a/libexec/login_radius/raddauth.c b/libexec/login_radius/raddauth.c index c8883b0d41e..a819a3aa716 100644 --- a/libexec/login_radius/raddauth.c +++ b/libexec/login_radius/raddauth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raddauth.c,v 1.4 2001/07/26 20:47:44 millert Exp $ */ +/* $OpenBSD: raddauth.c,v 1.5 2001/08/18 18:31:21 deraadt Exp $ */ /*- * Copyright (c) 1996, 1997 Berkeley Software Design, Inc. All rights reserved. @@ -347,7 +347,7 @@ rad_request(pid_t id, char *name, char *password, int port, char *vector, *ptr++ = PW_PASSWORD; *ptr++ = p * AUTH_VECTOR_LEN + 2; - strncpy(pass_buf, password, AUTH_PASS_LEN); /* must zero fill */ + strlcpy(pass_buf, password, AUTH_PASS_LEN); /* must zero fill */ /* Calculate the md5 digest */ secretlen = strlen(auth_secret); diff --git a/libexec/login_token/token.c b/libexec/login_token/token.c index 10a689c2a03..41c002d60d1 100644 --- a/libexec/login_token/token.c +++ b/libexec/login_token/token.c @@ -1,4 +1,4 @@ -/* $OpenBSD: token.c,v 1.5 2001/06/28 21:18:45 millert Exp $ */ +/* $OpenBSD: token.c,v 1.6 2001/08/18 18:31:21 deraadt Exp $ */ /*- * Copyright (c) 1995 Migration Associates Corp. All Rights Reserved @@ -285,7 +285,7 @@ tokenuserinit(int flags, char *username, unsigned char *usecret, unsigned mode) return (1); memset(&tokenrec, 0, sizeof(tokenrec)); - strncpy(tokenrec.uname, username, sizeof(tokenrec.uname)); + strlcpy(tokenrec.uname, username, sizeof(tokenrec.uname)); cb2h(secret, tokenrec.secret); tokenrec.mode = 0; tokenrec.flags = TOKEN_ENABLED | TOKEN_USEMODES; diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c index 820d08a7ef4..d272488836a 100644 --- a/libexec/rpc.rusersd/rusers_proc.c +++ b/libexec/rpc.rusersd/rusers_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rusers_proc.c,v 1.9 2001/07/08 21:18:10 deraadt Exp $ */ +/* $OpenBSD: rusers_proc.c,v 1.10 2001/08/18 18:31:21 deraadt Exp $ */ /*- * Copyright (c) 1993 John Brezak @@ -29,7 +29,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.9 2001/07/08 21:18:10 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.10 2001/08/18 18:31:21 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -251,11 +251,11 @@ do_names_3(int all) utmps[nusers].ut_idle = getidle(usr.ut_line, usr.ut_host); utmps[nusers].ut_line = line[nusers]; - strncpy(line[nusers], usr.ut_line, sizeof(line[nusers])); + strlcpy(line[nusers], usr.ut_line, sizeof(line[nusers])); utmps[nusers].ut_user = name[nusers]; - strncpy(name[nusers], usr.ut_name, sizeof(name[nusers])); + strlcpy(name[nusers], usr.ut_name, sizeof(name[nusers])); utmps[nusers].ut_host = host[nusers]; - strncpy(host[nusers], usr.ut_host, sizeof(host[nusers])); + strlcpy(host[nusers], usr.ut_host, sizeof(host[nusers])); nusers++; } ut.utmp_array_len = nusers; @@ -313,11 +313,11 @@ do_names_2(int all) utmp_idle[nusers].ui_idle = getidle(usr.ut_line, usr.ut_host); utmp_idle[nusers].ui_utmp.ut_line = line[nusers]; - strncpy(line[nusers], usr.ut_line, sizeof(line[nusers])); + strlcpy(line[nusers], usr.ut_line, sizeof(line[nusers])); utmp_idle[nusers].ui_utmp.ut_name = name[nusers]; - strncpy(name[nusers], usr.ut_name, sizeof(name[nusers])); + strlcpy(name[nusers], usr.ut_name, sizeof(name[nusers])); utmp_idle[nusers].ui_utmp.ut_host = host[nusers]; - strncpy(host[nusers], usr.ut_host, sizeof(host[nusers])); + strlcpy(host[nusers], usr.ut_host, sizeof(host[nusers])); nusers++; } @@ -372,11 +372,11 @@ do_names_1(int all) ru_utmpp[nusers] = &ru_utmp[nusers]; ru_utmp[nusers].ut_time = usr.ut_time; ru_utmp[nusers].ut_line = line[nusers]; - strncpy(line[nusers], usr.ut_line, sizeof(line[nusers])); + strlcpy(line[nusers], usr.ut_line, sizeof(line[nusers])); ru_utmp[nusers].ut_name = name[nusers]; - strncpy(name[nusers], usr.ut_name, sizeof(name[nusers])); + strlcpy(name[nusers], usr.ut_name, sizeof(name[nusers])); ru_utmp[nusers].ut_host = host[nusers]; - strncpy(host[nusers], usr.ut_host, sizeof(host[nusers])); + strlcpy(host[nusers], usr.ut_host, sizeof(host[nusers])); nusers++; } |