Subject: Problems with mountd and /etc/exports
To: None <netbsd-help@NetBSD.ORG>
From: Chad Mynhier <mynhier@cs.utk.edu>
List: netbsd-help
Date: 09/07/1996 10:50:10
	I'm running NetBSD-1.2(beta) on a Sparc 5.  I'm having problems 
getting mountd to work.  I'm starting it manually while I try to get it 
working, if that matters.  Here is the error that is logged:

Sep  7 10:29:38 duff-lite mountd[1216]: Can't change attributes for /export/sun4-netbsd1. 

	Here's what my /etc/exports looks like:

/export/sun4-netbsd1 -ro all_ng

where 'all_ng' is an entry in the YP netgroup map.


	Here's the code fragment from mountd that reports the 'attributes'
error:

                while (mount(fsb->f_fstypename, dirp,
                       fsb->f_flags | MNT_UPDATE, (caddr_t)&args) < 0) {
                        if (errno == EPERM) {
                                syslog(LOG_ERR,
                                   "Can't change attributes for %s.\n", dirp);
                                return (1); 
                        }


	Here's the code fragment from the mount system call that returns 
EPERM:

                /*
                 * Do not allow NFS export by non-root users. Silently
                 * enforce MNT_NOSUID and MNT_NODEV for non-root users.
                 */
                if (p->p_ucred->cr_uid != 0) { 
                        if (SCARG(uap, flags) & MNT_EXPORTED) {
                                vput(vp);
                                return (EPERM);
                        } 

	I'm running mountd as root, but the above appears (to me, at least)
to be saying that I'm not running it as root.  Is someone out there capable
of explaining what's going on here, or at least pointing me to something that
will help me figure out what's going on?

Chad Mynhier <mynhier@cs.utk.edu>
Journeyman Wizard, CS Department        
University of Tennessee, Knoxville