Bug 210652 - Fix path for per-user nsmb.conf file in nsmb.conf(5)
Summary: Fix path for per-user nsmb.conf file in nsmb.conf(5)
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-doc (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-06-28 08:18 UTC by Ganael LAPLANCHE
Modified: 2016-11-24 10:05 UTC (History)
1 user (show)

See Also:


Attachments
Patch for nsmb.conf(5) (443 bytes, text/plain)
2016-06-28 08:18 UTC, Ganael LAPLANCHE
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ganael LAPLANCHE 2016-06-28 08:18:06 UTC
Created attachment 171903 [details]
Patch for nsmb.conf(5)

Hi,

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) :

91-FILES
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,
Ganael.
Comment 1 commit-hook freebsd_committer freebsd_triage 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

Log:
  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@)

Changes:
  head/share/man/man5/nsmb.conf.5