summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mountd
Commit message (Collapse)AuthorAgeFilesLines
* 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
* - more mark-up fixesdanger2008-07-011-8/+6
| | | | Submitted by: ru
* - add some missing wordsdanger2008-06-301-25/+44
| | | | | | | | | - we don't have ne(4), replace it with re(4) - fix markup - bump date Submitted by: ru MFC after: 3 days
* - markup fixesdanger2008-06-271-15/+68
| | | | | | | | | | - advise to use rc script to SIGHUP mountd - add information about possiblity of using /prefix network notation [1] PR: docs/124373 Reviewed by: jhb Obtained from: NetBSD [1] MFC after: 3 days
* Remove hacks which filter out MNT_ROOTFS.rodrigc2008-03-051-15/+1
| | | | | | | They are no longer needed now that we filter out MNT_ROOTFS inside the nmount() call in revision 1.267 of vfs_mount.c. Reviewed by: rink
* Use the correct variable to check for a malloc failing. This fixes asimon2007-10-271-1/+1
| | | | | case where mountd would fail to start with "out of memory" logged to syslog.
* Add the -h <bindip> option to mountd, similar to the one in nfsd(8)matteo2007-10-202-160/+340
| | | | | | | | | | | | | -h bindip Specify specific IP addresses to bind to for TCP and UDP requests. This option may be specified multiple times. If no -h option is specified, mountd will bind to INADDR_ANY. Note that when specifying IP addresses with -h, mountd will automatically add 127.0.0.1 and if IPv6 is enabled, ::1 to the list. PR: bin/114097 Reviewed by: pjd (an eariler version of the patch) MFC after: 1 week
* Fatal error is only when cannot open any of the given exports files.pjd2007-04-131-2/+9
|
* Grr, committed manual page without the last change - make the comment a bitpjd2007-02-031-1/+1
| | | | prettier.
* Add support for multiple exports files. This will be useful for example forpjd2007-02-032-125/+145
| | | | | | | ZFS, where we have automatically generated /etc/zfs/exports file, which should not be edited directly. Discussed with: rwatson
* If nmount() fails to export a directory, in the syslog() error message,rodrigc2007-01-261-2/+4
| | | | add the errmsg string returned by nmount().
* Ignore SIGPIPE, instead of terminating process.rodrigc2006-11-181-0/+1
| | | | | | PR: 81230 Submitted by: Dmitrij Tejblum <tejblum yandex-team ru> MFC after: 1 month
* My previous commit made it impossible to export / over NFS; this smallrink2006-10-191-1/+6
| | | | | | | | | | | change fixes this. Reported by: Lin Jui-Nan Eric < ericlin dot jnlin at gmail dot com > Submitted by: Erik Trulsson < ertr1013 at student dot uu dot se > (commit is inspired by a patch from Erik) Pointyhat to: me Reviewed by: stable@ Approved by: imp (mentor) MFC after: 3 days
* Prevent mountd(8) from resetting mount options when exporting a filesystem.rink2006-10-091-1/+1
| | | | | | Approved by: imp (mentor) Sponsored by: Quality Service Provider BV MFC after: 3 days
* In get_exportlist(), properly loop over mounted filesystems.rodrigc2006-07-081-5/+4
| | | | | PR: bin/99873 Submitted by: Danny Braniss <danny at cs dot huji dot ac dot il>
* For network filesystems (NFS, samba, etc.), do not pass "export" nmount()rodrigc2006-06-061-0/+15
| | | | | | | | parameter to try to delete an NFS export. It won't work, and will log a spurious warning to syslog. Tested by: Arno J. Klaassen <arno at heho dot snv dot jussieu dot fr> MFC after: 3 days
* Do not log "can't delete export" messages if nmount() returns ENOTSUP.rodrigc2006-05-281-1/+1
| | | | | This eliminates spurious log entries for trying to delete exports for filesystems like devfs and procfs.
* Convert to nmount() and remove hardcoded checks for ufs, msdosfs, ntfs,rodrigc2006-05-241-25/+19
| | | | | | and cd9660. PR: bin/97642
* Convert mountd to nmount(). Remove some hardcoded dependenciesrodrigc2006-05-232-69/+142
| | | | on ufs, cd9660, msdosfs, and ntfs, but not all dependencies.
* Note that when -d flag is used, mountd(8) will not detach from thekeramida2006-05-021-1/+4
| | | | | | | | controlling terminal. PR: docs/96660 Submitted by: Jeff Ito <ijk@speakeasy.net> MFC after: 1 week
* Use ".Pa" for path names.jkoshy2006-01-291-12/+12
| | | | MFC after: 3 days
* Pidfiles should be created with permission preventing users from openingpjd2005-09-161-1/+1
| | | | | | | them for reading. When user can open file for reading, he can also flock(2) it, which can lead to confusions. Pointed out by: green
* Use pidfile(3) in mountd(8). There is no need to use /var/run/mountd.lockpjd2005-08-242-17/+16
| | | | anymore.
* NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 definesume2005-05-131-7/+2
| | | | | NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special for it, now.
* Remove unused variables.stefanf2005-04-091-2/+0
|
* Sort sections.ru2005-01-181-3/+3
|
* Also do not send junk mount arguments when removing exports.phk2004-12-111-0/+1
|
* Pass an array of gid_t rather than an array of int to getgroups().stefanf2004-10-021-2/+3
| | | | PR: 56646
* Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived softwareimp2004-08-075-20/+1
| | | | (with permission of addtional copyright holders where appropriate)
* Markup nits.ru2004-06-041-2/+2
|
* Correct typo in the last revision.ceri2004-03-271-1/+1
|
* Note that only one webnfs share is allowed per NFS server.ceri2004-03-221-0/+3
| | | | | | | PR: docs/45371 Submitted by: Mattias Pantzare <pantzer@ludd.luth.se>, Matthew D. Fuller <fullermd@over-yonder.net> MFC after: 2 days
* Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)markm2004-03-051-1/+1
| | | | | | | | | | | | | | | that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other". Tested on: i386 sparc64
* Add a new option to mountd(8), -p <port>. This allows the user to specifybms2004-03-042-7/+76
| | | | | | | a known port for use in firewall rulesets; otherwise the port is chosen at run-time by bindresvport(). MFC after: 1 week
* Be consistent in the EXAMPLES formatting.obrien2004-01-011-0/+1
|
OpenPOWER on IntegriCloud