summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/rcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/rcmd.c')
-rw-r--r--src/lib/libc/net/rcmd.c5
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)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.42 2002/05/22 04:31:14 deraadt Exp $"; 37static 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