summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mountd
Commit message (Collapse)AuthorAgeFilesLines
* MFC r314659,r314676:ngie2017-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | r314659: usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output r314676: Fix build after r314656 Some of the changes I introduced to use .ALLSRC were correct in spirit, but incorrect in reality -- in particular, ../Makefile.inc hadn't been pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk explicitly so we can be certain that the values used as dependencies in the targets are defined when the target recipe has been evaluated. Reminder: thou shalt separate out separate functional changes before committing them. (YUGE) Pointyhat to: ngie In collaboration with: bdrewery
* MFC: r307891rmacklem2016-11-081-2/+2
| | | | | | Fix the man page to reflect the change done by r307890 to mountd.c so that the "-n" option uses the sysctl for the new NFS server. This is a content change.
* MFC: r307890rmacklem2016-11-081-1/+1
| | | | | | | | | | | | mountd(8) was erroneously setting the sysctl for the old NFS server when the new/default NFS server was running, for the "-n" option. This patch fixes the problem for head and stable/11. For stable/10 the patch will need to be modified when MFC'd, since the stable/10 mountd.c handles both old and new NFS servers. Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default, there wouldn't have been many users affected by the code not setting it to 0 when the "-n" option was specified.
* Use MIN macro from sys/param.h.araujo2016-05-021-1/+1
| | | | MFC after: 2 weeks.
* Cleanup unnecessary semicolons from utilities we all love.pfg2016-04-151-3/+3
|
* Allow /etc/exports to contain usernames/groups with spaces in them.jpaetzel2016-01-072-1/+72
| | | | | | | | | | | If you are getting your users/groups from a directory service such as LDAP or AD it's possible for those usernames or groupnames to contain spaces. Submitted by: Sean E. Fagan Reviewed by: rmacklem MFC after: 1 week Sponsored by: iXsystems
* Fix type mismatches for malloc(3) and Co.uqs2015-12-291-1/+1
| | | | | | | | | This is rather pedantic, as for most architectures it holds that sizeof(type *) == sizeof(type **) Found by: clang static analyzer Reviewed by: ed Differential Revision: https://reviews.freebsd.org/D4722
* Staticize some stuff in mountd(8); no functional changes.trasz2015-07-041-129/+131
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add META_MODE support.sjg2015-06-131-0/+22
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-273-38/+28
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-192-5/+8
| |\
| * | Updated dependenciessjg2014-05-161-1/+0
| | |
| * | Updated dependenciessjg2014-05-101-0/+2
| | |
| * | sync from headsjg2013-04-121-1/+1
| |\ \
| * | | Updated dependenciessjg2013-03-111-0/+1
| | | |
| * | | Updated dependenciessjg2013-02-161-2/+0
| | | |
| * | | Sync with HEAD.obrien2013-02-082-3/+6
| |\ \ \
| | \ \ \
| | \ \ \
| *-. \ \ \ Sync from headsjg2012-11-043-23/+88
| |\ \ \ \ \
| * | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+23
| | |/ / / / | |/| | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | Add a warning message to mountd for exported filermacklem2015-05-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | systems that are automounted, since that configuration isn't supported. This still allows the export, since two emails I received felt that this should not be disabled. It sends the message to syslog(LOG_ERR..), so that it goes to the same places as the other messages related to /etc/exports problems, even though it is a warning and not an error. Reviewed by: trasz MFC after: 2 weeks
* | | | | | Remove oldnfs leftovers from mountd(8).trasz2015-04-292-34/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: rmacklem@ Sponsored by: The FreeBSD Foundation
* | | | | | No need to delete export from filesystems which are not exported.sjg2015-04-181-0/+6
| | | | | |
* | | | | | Mountd iterating over the mount points may race with the parallelkib2015-02-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unmount, which causes error from nmount(2) call when performing MNT_DELEXPORT over the directory which ceased to be a mount point. The race is legitimate and innocent, but results in the chatty mountd. Silence it by providing an distinguished error code for the situation, and ignoring the error in mountd loop. Based on the patch by: Andreas Longwitz <longwitz@incore.de> Prodded and tested by: bdrewery Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | | | | | When mountd is creating sockets, it iterates over all addresses specifiedrstone2015-01-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the "hosts" array and eventually looks up the network address with getaddrinfo(). At one point it checks for a numeric address and if it sees one, it sets a hint parameter to force getaddrinfo to interpret the host as a numeric address. However that hint is not cleared for subsequent iterations of the loop and if any hosts seen after this point are host names, getaddrinfo will fail on the name. The result of this bug is that you cannot pass a host name to the -h flag. Unfortunately, the first iteration will either process ::1 or 127.0.0.1, so the flag is set on the first iteration and all host names will fail to be processed. The same bug applies to rpc.lockd and rpc.statd, so fix them too. Differential Revision: https://reviews.freebsd.org/D1507 Reported by: Dylan Martin MFC after: 1 week Sponsored by: Sandvine Inc.
* | | | | | Convert usr.sbin to LIBADDbapt2014-11-251-2/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | Reduce overlinking
* | | | | Avoid showing stale errors when nmount(2) fails.bdrewery2014-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes nmount(2) will fail without setting errmsg. The previous (ignored) error would then be shown as the reason for the failed call if the next nmount(2) also fails without [ENOENT,ENOTSUP]. An example is when there is a tmpfs mounted with -o size. vfs_filteropt() adds 'size' as an error in errmsg due to 'size' not being in tmpfs_updateopts. Then tmpfs_mount returns [ENOTSUP] from nmount(2), which is then ignored. The next call may race with an unmount causing an invalid [EINVAL] that then does log an error, with the tmpfs errmsg. The race itself is a separate issue to fix as it is expected to have an [ENOENT] returned instead. In this example the mount being shown is actually nullfs, not tmpfs that the error is from. mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-commit-test-devel/04/.npkg: Invalid argument mount option <size> is unknown It should only show: mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-commit-test-devel/04/.npkg: Invalid argument MFC after: 2 weeks
* | | | | Try to clarify how file systems are exported for NFSv4.rmacklem2014-08-141-5/+6
| |_|_|/ |/| | | | | | | | | | | | | | | Suggested by: rcarter@pinyon.org MFC after: 1 week
* | | | Check if the -sec option is given without an argument.pluknet2013-02-201-1/+1
| |_|/ |/| | | | | | | | | | | | | | PR: bin/170413 Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> MFC after: 1 week
* | | Attempt to clarify that for ZFS, all file systems underrmacklem2012-12-251-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | the NFSv4 root must be exported. This is because ZFS checks exports itself. This is a content change. MFC after: 2 weeks
* | | Fix socket calls on error post-r243965.kevlo2012-12-211-1/+1
| |/ |/| | | | | Submitted by: Garrett Cooper
* | Add a description for the '-S' option to the mountd man page.rmacklem2012-10-151-2/+15
| | | | | | | | | | | | | | This is a content change. Reviewed by: kib MFC after: 2 weeks
* | Add a new '-S' option to mountd, which tells it to suspendrmacklem2012-10-151-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | execution of the nfsd threads while it is reloading the exports. This avoids clients from getting intermittent access errors when the exports are being reloaded non-atomically. It is not an ideal solution, since requests will back up while the nfsd threads are suspended. Also, when this option is used, if mountd crashes while reloading exports, mountd will have to be restarted to get the nfsd threads to resume execution. This has been tested by Vincent Hoffman (vince at unsane.co.uk) and John Hickey (jh at deterlab.net). The nfse patch offers a more comprehensive solution for this issue. PR: kern/9619, kern/131342 Reviewed by: kib MFC after: 2 weeks
* | Minor mdoc fixes.joel2012-10-071-1/+1
| |
* | Attila Bogar reported a bug in mountd when multiple exportrmacklem2012-09-241-14/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entries with different security flavors are in the exports(5) file. For that case, mountd replies with the security flavors of the last entry and not the correct one for the client host. This patch fixes that by storing separate copies of the flavors for each host/net case, plus a default one for the case where no hosts/nets are specified on an entry in the exports(5) file. Unlike the patch in the PR, it replies with the security flavors for the entry instead of merging the security flavors for all the entries and replying with that. Tested by: attila.bogar at linguamatics.com PR: kern/164933 MFC after: 2 weeks
* | Show error messages if nmount() failed.delphij2012-08-271-4/+4
|/ | | | MFC after: 1 month
* Remove trailing whitespace per mdoc lint warningeadler2012-03-291-2/+2
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Fix warning when compiling with gcc46:eadler2012-01-201-4/+1
| | | | | | | | error: variable 'dirp' set but not used error: variable 'dirplen' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days
* Spelling fixes for usr.sbin/uqs2011-12-301-1/+1
|
* Use calloc() instead of an explicit memset.delphij2011-07-141-4/+2
| | | | MFC after: 2 weeks
* Try and fix the exports.5 man page so that it clarifies howrmacklem2011-07-121-1/+21
| | | | | | | | NFSv4 exports are handled. Improved by informal review comments from mckusick, kudak at mit.edu and bde. This is a content change. MFC after: 2 weeks
* Fix the nfs related daemons so that they don't intermittentlyrmacklem2011-06-021-30/+213
| | | | | | | | | | | | | | | | | | | | | | | | fail with "bind: address already in use". This problem was reported to the freebsd-stable@ mailing list on Feb. 19 under the subject heading "statd/lockd startup failure" by george+freebsd at m5p dot com. The problem is that the first combination of {udp,tcp X ipv4,ipv6} would select a port# dynamically, but one of the other three combinations would have that port# already in use. The patch is somewhat involved because it was requested by dougb@ that the four combinations use the same port# wherever possible. The patch splits the create_service() function into two functions. The first goes as far as bind(2) in a loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port# for all four cases. If these attempts fail, the last attempt allows the 4 cases to use different port #s. After this function has succeeded, the second function, called complete_service(), does the rest of what create_service() did. The three daemons mountd, rpc.lockd and rpc.statd all have a create_service() function that is patched in a similar way. However, create_service() has non-trivial differences for the three daemons that made it impractical to share the same functions between them. Reviewed by: jhb MFC after: 2 weeks
* Patch the mountd and nfsd man pages to reflect the recent changesrmacklem2011-04-241-13/+7
| | | | | done by r220980 to deprecate the -e option and add the -o option. This is a content change for both man pages.
* This patch changes the default NFS server to the new one, which wasrmacklem2011-04-241-8/+8
| | | | | | | | referred to as the experimental server. It also adds a new command line option "-o" to both mountd and nfsd that forces them to use the old/regular NFS server. The "-e" option for these commands is now a no-op, since the new server is the default. I will be committing rc script and man changes soon. Discussed on freebsd-fs@.
* Fixed conversion of prefix length to a netmask.ru2011-03-011-1/+1
|
* Add __unused. Ansi prototypes.charnier2010-12-201-111/+48
|
* o Fix typo: sepcify -> specify.maxim2010-07-121-1/+1
| | | | | | PR: docs/148499 Submitted by: Warren Block MFC after: 1 week
* If the "-alldirs" export option was used for the V4: line, mountdrmacklem2010-05-061-4/+4
| | | | | | | | | would crash in check_options() since dp == NULL for the V4: line. This patch moves the check for options allowed on the V4: line to ahead of where dp is used to avoid this crash. Reported by: mamalos AT eng.auth.gr MFC after: 1 week
* Description of steps required to setup NFSv4 server is in nfsv4(4);trasz2009-12-031-1/+2
| | | | | add reference to exports(5), since that's the obvious starting point for searching for this.
* Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementationdfr2009-06-241-36/+35
| | | | and will be removed.
OpenPOWER on IntegriCloud