NetBSD Problem Report #1509
From gnats Mon Sep 25 17:07:12 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id RAA03366 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Mon, 25 Sep 1995 17:07:12 -0400
Message-Id: <199509250931.KAA17343@gluon.mono.org>
Date: Mon, 25 Sep 1995 10:31:17 +0100
From: abs@mono.org
To: gnats-bugs@netbsd.org
Subject: mountd is less than informative on invalid /etc/exports
X-Send-Pr-Version: 3.2
>Number: 1509
>Category: lib
>Synopsis: mountd is less than informative on invalid /etc/exports
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: lib-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 25 17:20:01 +0000 1995
>Closed-Date: Wed May 22 03:47:47 +0000 1996
>Last-Modified: Wed May 22 03:49:54 +0000 1996
>Originator: David Brownlee
>Release: Aug 22th 1995
>Organization:
Monochrome
>Environment:
sparc, 1.0A, current
System: NetBSD gluon.mono.org 1.0A NetBSD 1.0A (GLUON) #1: monoadm@gluon.mono.org:/mono/u1/NetBSD/src/sys/arch/sparc/compile/GLUON sparc
>Description:
If mountd is unable to export a filesystem due to an invalid hostname,
or a hostname specified on two (conflicting) lines or similar it gives
no indication of which entry caused the problem. This can be a real
pain when you get into using netgroups...
>How-To-Repeat:
Add an invalid hostname, or dotted IP address to a line in
/etc/exports. Or export a filesystem to two netgroups with differing
permissions and have a hostname in both netgroups. Now try to figure
out which hostname is the problem.
The first four lines are from syslog without the patch, the second
four with the patch.
gluon mountd[16959]: Can't change attributes for /mono/netbsd.
gluon mountd[16959]: Bad exports list line /mono/netbsd -alldirs -maproot
gluon mountd[17101]: Gethostbyname failed
gluon mountd[17101]: Bad exports list line /mono/netbsd -alldirs -maproot
gluon mountd[16960]: Can't change attributes for /mono/netbsd to nine-inch-nails.city.ac.uk.
gluon mountd[16960]: Bad exports list line /mono/netbsd -maproot
gluon mountd[17145]: Gethostbyname failed for blobby.
gluon mountd[17145]: Bad exports list line /mono/netbsd -alldirs -maproot
>Fix:
*** sbin/mountd/mountd.c.orig Mon Sep 25 09:57:48 1995
--- sbin/mountd/mountd.c Mon Sep 25 10:18:59 1995
***************
*** 1296,1302 ****
if (isdigit(*cp)) {
saddr = inet_addr(cp);
if (saddr == -1) {
! syslog(LOG_ERR, "Inet_addr failed");
return (1);
}
if ((hp = gethostbyaddr((caddr_t)&saddr, sizeof (saddr),
--- 1296,1302 ----
if (isdigit(*cp)) {
saddr = inet_addr(cp);
if (saddr == -1) {
! syslog(LOG_ERR, "Inet_addr failed for %s.",cp);
return (1);
}
if ((hp = gethostbyaddr((caddr_t)&saddr, sizeof (saddr),
***************
*** 1310,1316 ****
aptr[1] = (char *)NULL;
}
} else {
! syslog(LOG_ERR, "Gethostbyname failed");
return (1);
}
}
--- 1310,1316 ----
aptr[1] = (char *)NULL;
}
} else {
! syslog(LOG_ERR, "Gethostbyname failed for %s.",cp);
return (1);
}
}
***************
*** 1543,1549 ****
cp = dirp + dirplen - 1;
if (errno == EPERM) {
syslog(LOG_ERR,
! "Can't change attributes for %s.\n", dirp);
return (1);
}
if (opt_flags & OP_ALLDIRS) {
--- 1543,1556 ----
cp = dirp + dirplen - 1;
if (errno == EPERM) {
syslog(LOG_ERR,
! "Can't change attributes for %s to %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) {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mrg
State-Changed-When: Tue May 21 23:47:47 EDT 1996
State-Changed-Why:
most of this was already applied. i did the last bit and also
added a few more verbosities.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.