diff options
| author | deraadt <> | 2002-05-24 21:22:37 +0000 |
|---|---|---|
| committer | deraadt <> | 2002-05-24 21:22:37 +0000 |
| commit | 2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64 (patch) | |
| tree | 96f82217a2fd5234ac1e25601237e64983eef146 /src/lib/libc/net/rcmd.c | |
| parent | 4bb76773d7dd0051cb98a137db9aeefb61518f5a (diff) | |
| download | openbsd-2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64.tar.gz openbsd-2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64.tar.bz2 openbsd-2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64.zip | |
try to use strlcpy and snprintf more; ok various
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/net/rcmd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c index d6814676f4..be68c599d8 100644 --- a/src/lib/libc/net/rcmd.c +++ b/src/lib/libc/net/rcmd.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | #if defined(LIBC_SCCS) && !defined(lint) | 36 | #if defined(LIBC_SCCS) && !defined(lint) |
| 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.42 2002/05/22 04:31:14 deraadt Exp $"; | 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.43 2002/05/24 21:22:37 deraadt Exp $"; |
| 38 | #endif /* LIBC_SCCS and not lint */ | 38 | #endif /* LIBC_SCCS and not lint */ |
| 39 | 39 | ||
| 40 | #include <sys/param.h> | 40 | #include <sys/param.h> |
| @@ -407,8 +407,7 @@ again: | |||
| 407 | first = 0; | 407 | first = 0; |
| 408 | if ((pwd = getpwnam(luser)) == NULL) | 408 | if ((pwd = getpwnam(luser)) == NULL) |
| 409 | return (-1); | 409 | return (-1); |
| 410 | (void)strcpy(pbuf, pwd->pw_dir); | 410 | snprintf(pbuf, sizeof pbuf, "%s/.rhosts", pwd->pw_dir); |
| 411 | (void)strcat(pbuf, "/.rhosts"); | ||
| 412 | 411 | ||
| 413 | /* | 412 | /* |
| 414 | * Change effective uid while opening .rhosts. If root and | 413 | * Change effective uid while opening .rhosts. If root and |
