summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Krause <david@cvs.openbsd.org>1995-12-27 12:32:43 +0000
committerDavid Krause <david@cvs.openbsd.org>1995-12-27 12:32:43 +0000
commit5522b9730363192ff136895cace5341eb20bbc0d (patch)
tree73f16ed03107174a2d007050821a7677b3d7d57a
parent02965e5ba76a288ead18e450766197893d5a91da (diff)
If mountd is unable to export a filesystem due to a hostname being invalid
or specified on two (conflicting) lines it now logs the offending hostname
-rw-r--r--sbin/mountd/mountd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c
index f058461300b..ef86ed32101 100644
--- a/sbin/mountd/mountd.c
+++ b/sbin/mountd/mountd.c
@@ -1294,7 +1294,7 @@ get_host(cp, grp)
if (isdigit(*cp)) {
saddr = inet_addr(cp);
if (saddr == -1) {
- syslog(LOG_ERR, "Inet_addr failed");
+ syslog(LOG_ERR, "Inet_addr failed for %s.",cp);
return (1);
}
if ((hp = gethostbyaddr((caddr_t)&saddr, sizeof (saddr),
@@ -1308,7 +1308,7 @@ get_host(cp, grp)
aptr[1] = (char *)NULL;
}
} else {
- syslog(LOG_ERR, "Gethostbyname failed");
+ syslog(LOG_ERR, "Gethostbyname failed for %s.",cp);
return (1);
}
}
@@ -1541,7 +1541,14 @@ do_mount(ep, grp, exflags, anoncrp, dirp, dirplen, fsb)
cp = dirp + dirplen - 1;
if (errno == EPERM) {
syslog(LOG_ERR,
- "Can't change attributes for %s.\n", dirp);
+ "Can't change attributes for %s (%s).\n",
+ dirp,
+ (grp->gr_type == GT_HOST)
+ ?grp->gr_ptr.gt_hostent->h_name
+ :(grp->gr_type == GT_NET)
+ ?grp->gr_ptr.gt_net.nt_name
+ :"Unknown");
+ /* XXX: Get address from sockaddr_iso? */
return (1);
}
if (opt_flags & OP_ALLDIRS) {