Bug 207625 - mount_smbfs(8): missing description of option "-n opt"
Summary: mount_smbfs(8): missing description of option "-n opt"
Status: New
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-01 20:43 UTC by O. Hartmann
Modified: 2024-03-10 14:48 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2016-03-01 20:43:28 UTC
Manpage of mount_smbfs(8) states:

SYNOPSIS
     mount_smbfs [-E cs1:cs2] [-I host] [-L locale] [-M crights:srights] [-N]
                 [-O cowner:cgroup/sowner:sgroup] [-R retrycount] [-T timeout]
                 [-U username] [-W workgroup] [-c case] [-d mode] [-f mode]
                 [-g gid] [-n opt] [-u uid]
                 //user@server[:port1[:port2]]/share node

The option "-n opt" is never mentioned again or described/documented!

Further, the SMB (server message block) is outdated, the TCP port 139 used with NetBIOS is considered dangerous as it is an exploit to takeover windows connections. It has been recommended to disable using TCP/139. 

I do not find ANY(!) hints how to use CIFS and TCP port 445 only!  One can only guess that it is the addition to /user@server[:port1... with port1 substituted with 445.

Iit should be made clear whether mount_smbfs is a suitable tool to mount CIFS share from a CIFS only server.

In my experience, it is very hard to find any fitting FreeBSD documentation regarding CIFS. It seems this is already standard in the Linux world and I find it a pity that FreeBSD is behind, outdated or even worse incapable.
Comment 1 Sean McBride 2019-09-09 20:00:29 UTC
Just checked FreeBSD 12's man page and "-n opt" is still undescribed.
Comment 2 Sammy Dyer 2022-10-05 06:38:34 UTC
MARKED AS SPAM
Comment 3 Chris Davidson 2024-03-10 14:48:55 UTC
The -n option is also not documented in the latest -CURRENT (FreeBSD current.home 15.0-CURRENT FreeBSD 15.0-CURRENT #6 main-n268726-32c7350beb82: Thu Mar  7 21:25:02 EST 2024     chrisdavidson@current.home:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64)

I did take a look at the source code dig a little deeper and checked out the soruce code (contrib/smbfs/mount_smbfs/mount_smbfs.c). This option does exist in the source code but it has comments around it, that it is never reached.

Evidence: The case option for 'n' exists on line 180 but on line 179 it has a comment: /*NOTREACHED*/.

Looking through other distribution manual pages they are NOT mentioning this option at all, example: 

https://www.illumos.org/man/8/mount_smbfs

I can not find a reference to it online but the mac os ventura manual pages also do NOT reference this option.

My conclusion is two options:
1. Remove the reference in the manual page
2. Update the source code for mount_smbfs.c to make the case reachable.

Option 2 "looks" to be resolved by adding a break line to the case above and then testing it out a little.

Hope this information is helpful for resolution of this manual page discrepancy.