summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/rcmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index e2b9199492..30ca6710c4 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -382,10 +382,14 @@ again:
382 (void)fclose(hostf); 382 (void)fclose(hostf);
383 } 383 }
384 if (first == 1 && (__check_rhosts_file || superuser)) { 384 if (first == 1 && (__check_rhosts_file || superuser)) {
385 int len;
386
385 first = 0; 387 first = 0;
386 if ((pwd = getpwnam(luser)) == NULL) 388 if ((pwd = getpwnam(luser)) == NULL)
387 return (-1); 389 return (-1);
388 snprintf(pbuf, sizeof pbuf, "%s/.rhosts", pwd->pw_dir); 390 len = snprintf(pbuf, sizeof pbuf, "%s/.rhosts", pwd->pw_dir);
391 if (len < 0 || len >= sizeof pbuf)
392 return (-1);
389 393
390 /* 394 /*
391 * Change effective uid while opening .rhosts. If root and 395 * Change effective uid while opening .rhosts. If root and