aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lukemftp/src/ruserpass.c
diff options
context:
space:
mode:
authorMike Heffner <mikeh@FreeBSD.org>2002-06-15 09:40:37 +0000
committerMike Heffner <mikeh@FreeBSD.org>2002-06-15 09:40:37 +0000
commit2e0951ee2da24c3bd16b4edded44a579c3cffe90 (patch)
tree77711ef38217eee071b8f3259f6d812352371afa /contrib/lukemftp/src/ruserpass.c
parentccb3a87203714318b08be59f5a29f6e916a987ce (diff)
downloadsrc-vendor/tnftp/1.6.BETA2.tar.gz
src-vendor/tnftp/1.6.BETA2.zip
Diffstat (limited to 'contrib/lukemftp/src/ruserpass.c')
-rw-r--r--contrib/lukemftp/src/ruserpass.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/contrib/lukemftp/src/ruserpass.c b/contrib/lukemftp/src/ruserpass.c
index 1b2bf843d274..0eadfc85c7ca 100644
--- a/contrib/lukemftp/src/ruserpass.c
+++ b/contrib/lukemftp/src/ruserpass.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ruserpass.c,v 1.27 2000/07/18 06:47:02 lukem Exp $ */
+/* $NetBSD: ruserpass.c,v 1.28 2000/11/15 00:11:04 lukem Exp $ */
/*
* Copyright (c) 1985, 1993, 1994
@@ -66,25 +66,19 @@ static struct toktab {
int
ruserpass(const char *host, const char **aname, const char **apass,
- const char **aacct)
+ const char **aacct)
{
- char *hdir, buf[BUFSIZ], *tmp;
+ char *tmp;
char myname[MAXHOSTNAMELEN + 1], *mydomain;
int t, i, c, usedefault = 0;
struct stat stb;
- hdir = getenv("HOME");
- if (hdir == NULL)
- hdir = ".";
- if (strlcpy(buf, hdir, sizeof(buf)) >= sizeof(buf) ||
- strlcat(buf, "/.netrc", sizeof(buf)) >= sizeof(buf)) {
- warnx("%s/.netrc: %s", hdir, strerror(ENAMETOOLONG));
+ if (netrc[0] == '\0')
return (0);
- }
- cfile = fopen(buf, "r");
+ cfile = fopen(netrc, "r");
if (cfile == NULL) {
if (errno != ENOENT)
- warn("%s", buf);
+ warn("%s", netrc);
return (0);
}
if (gethostname(myname, sizeof(myname)) < 0)