Bug 210652

Summary: Fix path for per-user nsmb.conf file in nsmb.conf(5)
Product: Documentation Reporter: Ganael LAPLANCHE <ganael.laplanche>
Component: DocumentationAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Some People CC: martymac
Priority: --- Keywords: patch
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
Patch for nsmb.conf(5) none

Description Ganael LAPLANCHE 2016-06-28 08:18:06 UTC
Created attachment 171903 [details]
Patch for nsmb.conf(5)


r214387 introduced a wrong path for per-user nsmb.conf file. See contrib/smbfs/lib/smb/subr.c :

164-    home = getenv("HOME");
165-    if (home) {
166-            fn = malloc(strlen(home) + 20);
167:            sprintf(fn, "%s/.nsmbrc", home);
168-            error = rc_open(fn, "r", &smb_rc);
169-            free(fn);
170-    }
171-    error = rc_merge(SMB_CFG_FILE, &smb_rc);

The file read is in fact ~/.nsmbrc, as also specified in mount_smbfs(8) :

92:     ~/.nsmbrc       Keeps static parameters for connections and other information.

and /etc/nsmb.conf :

3-# smbfs lookups configuration files in next order:
4:#     1. ~/.nsmbrc
5-#     2. /etc/nsmb.conf - if this file found it will
6-#        override values with same keys from user files.

Find attached a patch that fixes the path to that file in nsmb.conf(5).

Best regards,
Comment 1 commit-hook freebsd_committer 2016-11-24 10:04:51 UTC
A commit references this bug:

Author: martymac
Date: Thu Nov 24 10:04:21 UTC 2016
New revision: 309095
URL: https://svnweb.freebsd.org/changeset/base/309095

  Fix path for per-user nsmb.conf file

  ~/nsmb.conf, as erroneously introduced by r214387, is never used. Fix the man
  page to specify that ~/.nsmbrc is used instead.

  PR:		210652
  Submitted by:	ganael.laplanche@corp.ovh.com
  Approved by:	gjb (doceng@)