From 50bfa521cc42959a93afc88aad575cb73a2323b2 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Fri, 4 Apr 2003 22:37:48 +0000 Subject: strcpy->strlcpy, ok millert@ --- usr.sbin/rpc.pcnfsd/pcnfsd_misc.c | 6 +++--- usr.sbin/rpc.pcnfsd/pcnfsd_print.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c b/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c index 810837eef47..890f7033737 100644 --- a/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c +++ b/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcnfsd_misc.c,v 1.8 2003/02/16 01:53:28 deraadt Exp $ */ +/* $OpenBSD: pcnfsd_misc.c,v 1.9 2003/04/04 22:37:47 avsm Exp $ */ /* $NetBSD: pcnfsd_misc.c,v 1.2 1995/07/25 22:20:42 gwr Exp $ */ /* @@ -160,7 +160,7 @@ wlogin(name, req) host = inet_ntoa(who->sin_addr); } - (void)strcpy(ut.ut_line, "PC-NFS"); + (void)strncpy(ut.ut_line, "PC-NFS", UT_LINESIZE); (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name)); (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host)); (void)time(&ut.ut_time); @@ -267,7 +267,7 @@ su_popen(user, cmd, maxtime) if (pw) { cached_uid = pw->pw_uid; cached_gid = pw->pw_gid; - strcpy(cached_user, user); + strlcpy(cached_user, user, sizeof(cached_user)); } else { cached_uid = (uid_t) (-2); cached_gid = (gid_t) (-2); diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c index bbf1267c327..502899958a3 100644 --- a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c +++ b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcnfsd_print.c,v 1.15 2003/02/16 01:53:28 deraadt Exp $ */ +/* $OpenBSD: pcnfsd_print.c,v 1.16 2003/04/04 22:37:47 avsm Exp $ */ /* $NetBSD: pcnfsd_print.c,v 1.3 1995/08/14 19:45:18 gwr Exp $ */ /* @@ -188,7 +188,7 @@ pr_start2(system, pr, user, fname, opts, id) req_id[0] = '\0'; if (stat(pathname, &statbuf)) { - (void)strcat(pathname, ".spl"); + (void)strlcat(pathname, ".spl", sizeof(pathname)); if (stat(pathname, &statbuf)) return (PS_RES_NO_FILE); return (PS_RES_ALREADY); @@ -888,7 +888,7 @@ static char expansion[512]; int i; for (i = 0; i < num_aliases; i++){ if (!strcmp(printer, alias[i].a_printer)) { - strcpy(expansion, alias[i].a_command); + strlcpy(expansion, alias[i].a_command, sizeof(expansion)); substitute(expansion, "$FILE", file); substitute(expansion, "$USER", user); substitute(expansion, "$HOST", host); -- cgit v1.2.3