summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavid <david@openbsd.org>1995-12-27 12:32:42 +0000
committerdavid <david@openbsd.org>1995-12-27 12:32:42 +0000
commit7cf6c46a18d46f3ff3b6d58d0d4af1ef166bddb3 (patch)
tree6e8e79ff6b4b97c202e04c0ae57e0347a0868112
parentSupport LDSTATIC and BINDIR (diff)
downloadwireguard-openbsd-7cf6c46a18d46f3ff3b6d58d0d4af1ef166bddb3.tar.xz
wireguard-openbsd-7cf6c46a18d46f3ff3b6d58d0d4af1ef166bddb3.zip
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) {