conf/86260: the weak_mountd_authentication flag from /etc/rc.conf is not taken into account

thierry herbelot thierry at herbelot.com
Sat Sep 17 09:20:06 PDT 2005


>Number:         86260
>Category:       conf
>Synopsis:       the weak_mountd_authentication flag from /etc/rc.conf is not taken into account
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 17 16:20:05 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     thierry herbelot
>Release:        FreeBSD 6.0-BETA4
>Organization:
>Environment:
FreeBSD XXX 6.0-BETA4 FreeBSD 6.0-BETA4 #3: Wed Sep 14 16:50:32 CEST 2005     YYYY at XXX:/usr/obj/usr/src/sys/GENERIC  i386 
>Description:
I am trying to mount as a user an NFS partition exported from a 6.0-BETA4 server. the client is also running 6.0-BETA4 (GENERIC).

I have set "sysctl vfs.usermount=1" on the client, but I get :
% mount server:/share ~/mnt
[udp] server:/share: RPCPROG_MNT: RPC: Authentication error; why = Client credential too weak

on the server, /etc/rc.conf contains :
nfs_reserved_port_only="NO"
weak_mountd_authentication="YES"
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_enable="YES"
rpcbind_enable="YES"

with these flags, mountd should be started with "-n -r", but a debug trace of "sh -x /etc/rc.d/mountd start" gives :
..
+ checkyesno weak_mountd_authentication
+ eval _value=$weak_mountd_authentication
+ _value=YES
+ debug checkyesno: weak_mountd_authentication is set to YES.
+ return 0
+ mountd_flags=-r -n
+ rm -f /var/db/mountdtab
+ umask 022
+
+ return 0
+ _return=0
+ [ 0 -ne 0 ]
+ echo Starting mountd.
Starting mountd.
+ [ -n  ]
+ _doit=/usr/sbin/mountd -r
+ [ -n  ]
+ debug run_rc_command: _doit: /usr/sbin/mountd -r
+ eval /usr/sbin/mountd -r
+ /usr/sbin/mountd -r
+ _return=0
+ [ 0 -ne 0 ]
+ [ -n  ]
+ return 0

If I understanding the startup process : in the /etc/rc.d/mountd script, mountd_precmd() correctly configures the "-n" and "-r" flags, but the subsequent call to load_rc_config() resets the flags to the default value set in /etc/defauls/rc.conf (or /etc/rc.conf)

A workaround is obviously to set mountd_flags="-r -n" in /etc/rc.conf
>How-To-Repeat:
(as in the full description)
>Fix:
(perhaps set the flags after the call to load_rc_config() - but it voids the in the interest of using mountd_precmd() - I have checked with the /etc/rc.d/mountd script in NetBSD, but this is simpler : it does not use rc.conf variables to set the mountd flags)
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list