summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 22:08:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 22:08:03 +0000
commitc98af7b72dd588fac037ff367379a4a335ae436d (patch)
tree5e51f62578b8d1d7e564138efa13efb5ed70d945
parent7c113e094838cd7e32e797e90d6070f743d40852 (diff)
more strlcpy; ok beck, and others pointed out a glitch
-rw-r--r--usr.sbin/amd/amd/afs_ops.c4
-rw-r--r--usr.sbin/amd/amd/mapc.c6
-rw-r--r--usr.sbin/amd/amd/util.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/amd/amd/afs_ops.c b/usr.sbin/amd/amd/afs_ops.c
index 999d1f2c683..12e35742a0f 100644
--- a/usr.sbin/amd/amd/afs_ops.c
+++ b/usr.sbin/amd/amd/afs_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: afs_ops.c,v 1.9 2002/11/25 18:04:10 pvalchev Exp $ */
+/* $OpenBSD: afs_ops.c,v 1.10 2003/03/13 22:08:02 deraadt Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -186,7 +186,7 @@ mount_toplvl(char *dir, char *opts)
* Most kernels have a name length restriction.
*/
if (strlen(fs_hostname) >= HOSTNAMESZ)
- strcpy(fs_hostname + HOSTNAMESZ - 3, "..");
+ strlcpy(fs_hostname + HOSTNAMESZ - 3, "..", 3);
#endif /* HOSTNAMESZ */
#ifdef NFSMNT_DUMBTIMR
diff --git a/usr.sbin/amd/amd/mapc.c b/usr.sbin/amd/amd/mapc.c
index 4fd0f7d8738..354bf7f34fc 100644
--- a/usr.sbin/amd/amd/mapc.c
+++ b/usr.sbin/amd/amd/mapc.c
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mapc.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: mapc.c,v 1.7 2002/08/05 07:24:26 pvalchev Exp $";
+static char *rcsid = "$Id: mapc.c,v 1.8 2003/03/13 22:08:02 deraadt Exp $";
#endif /* not lint */
/*
@@ -685,7 +685,7 @@ mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse)
*/
strlcpy(wildname, key, sizeof wildname);
while (error && (subp = strrchr(wildname, '/'))) {
- strcpy(subp, "/*");
+ strcpy(subp, "/*"); /* ok */
#ifdef DEBUG
dlog("mapc recurses on %s", wildname);
#endif
@@ -789,7 +789,7 @@ root_newmap(char *dir, char *opts, char *map)
snprintf(str, sizeof(str), "cache:=mapdefault;type:=toplvl;fs:=\"%s\";%s",
map, opts ? opts : "");
else
- strcpy(str, opts);
+ strlcpy(str, opts, sizeof str);
mapc_repl_kv(root_map, dir, strdup(str));
}
diff --git a/usr.sbin/amd/amd/util.c b/usr.sbin/amd/amd/util.c
index b2fbf115635..52e0594710f 100644
--- a/usr.sbin/amd/amd/util.c
+++ b/usr.sbin/amd/amd/util.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)util.c 8.1 (Berkeley) 6/6/93
- * $Id: util.c,v 1.9 2002/08/05 07:24:26 pvalchev Exp $
+ * $Id: util.c,v 1.10 2003/03/13 22:08:02 deraadt Exp $
*/
/*
@@ -85,7 +85,7 @@ strealloc(char *p, char *s)
p = (char *) xrealloc((void *)p, len);
- strcpy(p, s);
+ strlcpy(p, s, len);
#ifdef DEBUG_MEM
malloc_verify();
#endif /* DEBUG_MEM */