summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mountd
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* When mountd.c parses the nfsv4 root line(s) in /etc/exports, itrmacklem2009-06-231-1/+13
| | | | | | | | allocates data structures that are never linked into the tree or free'd. As such, mountd would leak memory every time it parsed an nfsv4 root line. This patch frees up those structures to plug the leak. Approved by: kib (mentor)
* Rework the credential code to support larger values of NGROUPS andbrooks2009-06-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867
* Re-do r192913 in less intrusive way. Only do IP_RECVDSTADDR/IP_SENDSRCADDRkan2009-06-181-7/+0
| | | | | | | | | | | | | dace for UPDv4 sockets bound to INADDR_ANY. Move the code to set IP_RECVDSTADDR/IP_SENDSRCADDR into svc_dg.c, so that both TLI and non-TLI users will be using it. Back out my previous commit to mountd. Turns out the problem was affecting more than one binary so it needs to me addressed in generic rpc code in libc in order to fix them all. Reported by: lstewart Tested by: lstewart
* The change r192913 has added dependency on IP_RECVDSTADDR beingkan2009-06-081-0/+7
| | | | | | set for RPC UDP sockets. Mountd uses internal libc fuctions directly and bypasses generic socket initialization completely, so we need to set IP_RECVDSTADDR here to match the libc behavior.
* Change the "-4" argument for nfsd and mountd to "-e" to avoidrmacklem2009-05-282-11/+11
| | | | | | | confusion, since it does not refer to IPv4 nor NFSv4, but to running the experimental server instead of the regular one. Approved by: kib (mentor)
* Modify mountd to handle the experimental nfs server as well as thermacklem2009-05-273-135/+358
| | | | | | | | | | | | regular one. It now takes a "-4" command line argument to force it to use the experimental server. Otherwise it will use the regular server unless the experimental server is the only one linked into the kernel. A third kind of line has been added to /etc/exports, which is specific to NFSv4 and defines where the NFSv4 tree root is and can be used to limit access to NFSv4 state handling operations that do not use any file handle. Approved by: kib (mentor)
* Implement support for RPCSEC_GSS authentication to both the NFS clientdfr2008-11-032-6/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and server. This replaces the RPC implementation of the NFS client and server with the newer RPC implementation originally developed (actually ported from the userland sunrpc code) to support the NFS Lock Manager. I have tested this code extensively and I believe it is stable and that performance is at least equal to the legacy RPC implementation. The NFS code currently contains support for both the new RPC implementation and the older legacy implementation inherited from the original NFS codebase. The default is to use the new implementation - add the NFS_LEGACYRPC option to fall back to the old code. When I merge this support back to RELENG_7, I will probably change this so that users have to 'opt in' to get the new code. To use RPCSEC_GSS on either client or server, you must build a kernel which includes the KGSSAPI option and the crypto device. On the userland side, you must build at least a new libc, mountd, mount_nfs and gssd. You must install new versions of /etc/rc.d/gssd and /etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf. As long as gssd is running, you should be able to mount an NFS filesystem from a server that requires RPCSEC_GSS authentication. The mount itself can happen without any kerberos credentials but all access to the filesystem will be denied unless the accessing user has a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There is currently no support for situations where the ticket file is in a different place, such as when the user logged in via SSH and has delegated credentials from that login. This restriction is also present in Solaris and Linux. In theory, we could improve this in future, possibly using Brooks Davis' implementation of variant symlinks. Supporting RPCSEC_GSS on a server is nearly as simple. You must create service creds for the server in the form 'nfs/<fqdn>@<REALM>' and install them in /etc/krb5.keytab. The standard heimdal utility ktutil makes this fairly easy. After the service creds have been created, you can add a '-sec=krb5' option to /etc/exports and restart both mountd and nfsd. The only other difference an administrator should notice is that nfsd doesn't fork to create service threads any more. In normal operation, there will be two nfsd processes, one in userland waiting for TCP connections and one in the kernel handling requests. The latter process will create as many kthreads as required - these should be visible via 'top -H'. The code has some support for varying the number of service threads according to load but initially at least, nfsd uses a fixed number of threads according to the value supplied to its '-n' option. Sponsored by: Isilon Systems MFC after: 1 month
OpenPOWER on IntegriCloud