summaryrefslogtreecommitdiffstats
path: root/support
Commit message (Collapse)AuthorAgeFilesLines
* Never set SO_REUSEADDR on a UDP socket.Neil Brown2007-03-222-3/+6
| | | | | | | | The effect is quite different from TCP sockets. For TCP, it allows you to listen for new connections even if there are outstanding old connections with the same local address. For UDP, it allows other people to steal your packets by binding to the same address.
* Add --with-rpcgen= for configure so that the system rpcgen can be used.Neil Brown2007-03-201-1/+5
| | | | | | | Ultimately it makes sense to remove remove rpcgen from the nfs-utils release as it is already in the glibc release. With this patch you can use the system rpcgen to make sure it works. It is not default yet, but it might be in a future release.
* Handle -o remount betterNeil Brown2007-03-201-2/+11
| | | | | | | | On -o remount, we need to update the entry in mtab rather than add a new one. update_mtab does this so use that. However it might free some strings that shouldn't be freed, so stop it from calling free - the program will exit soon anyway so no exit is needed.
* Make warning about host matching multiple exports more helpful.Neil Brown2007-03-192-1/+5
| | | | | 1/ only warn once per export, as it could get too noisy. 2/ make it a little clearer why this might be a problem.
* Fix another warning: error -> nfs_errorNeil Brown2007-03-161-2/+2
|
* Remove nfs_mntent_t in favour of struct mntentNeil Brown2007-03-164-18/+10
| | | | They are identical and the later allows us to use hasmntent.
* Correctly handle "user" and "users" mount options.Neil Brown2007-03-162-0/+65
| | | | | | | | | | | | If "user" or "users" is given, then allow mount.nfs to be run by a non-root user providing that the mountpoint, filesystem, and options exactly match what is found in fstab. For "user", record the user name in mtab so they can unmount the filesystem later. Also alwasys ignore auto, owner, group and their negations as well as "_netdev", "comment" and "loop".
* Make mtab_head staticNeil Brown2007-03-162-2/+1
| | | | It is only used in one place.
* Fix memory leak in mountd.Steinar H. Gunderson2007-03-161-0/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Remove "maptype" supportJ. Bruce Fields2007-03-153-50/+0
| | | | | | | | It appears that this is used only by unfsd, and is obscure enough that we should be able to just rip it out with no special precautions. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Restore use of un-connected socket for UDP mount requests.Neil Brown2007-03-132-28/+36
| | | | | | | | | | | | | | | | | | | | | | When connecting to an NFSv4 server we need to find out IP address as it would be seen by the server, to register an address for callbacks. This is most easily done by connecting the socket to the servers address and then getting the address of our endpoint. However with a connected UDP socket, replies that come from a different IP address - as can happen with non-Linux multi-homed servers - will be rejected. So if we connected our UDP socket, we need to be sure to disconnect it before using it. This patch adds an option to get_socket to say if we want it connected or not and, in the case where we do, we disconnect a UDP socket after the connection information has been used. Also clean up the error handling in clnt_ping which was getting clumsy.
* Merge branch 'branch-1-0'Neil Brown2007-02-272-0/+6
|\
| * Extend the exportfs/mountd interface to pass fslocations info into the kernelFred Isaman2007-02-272-0/+6
| | | | | | | | | | | | | | | | Fix up a few issues with the fsloc code. Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* | Remove rpc.lockdNeil Brown2007-02-224-30/+1
| | | | | | | | | | | | This was only needed for kernels 2.2.14 through 2.2.17. These have long since been superceded, so remove some dead weight.
* | Change default from subtree_check to no_subtree_checkNeil Brown2007-02-221-3/+3
|/ | | | | | | subtree_check causes more problems than it is worth, and it isn't worth much in the first place.. Signed-off-by: Neil Brown <neilb@suse.de>
* Extend the exportfs interface to pass fslocations info into the kernel.Fred Isaman2007-02-223-1/+45
| | | | | | | | | | Extend exportfs interface to pass fslocations info into the kernel, using syntax modelled after AIX. Adds "refer=" and "replicas=" options to /etc/exports to enable use of the kernel fslocation code. Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Support group-id looks for kernels that ask for them.Neil Brown2007-02-121-0/+1
| | | | | | | With "-g" mountd will listen for uid -> gidlist requests from the kernel and provide the required mapping. This is specific to AUTH_USER (aka AUTH_SYS) and is designed to overcome the 16-gid limit in the AUTH_UNIX protocol.
* Use UUIDs to identify filesystems if kernel supports it.Neil Brown2007-02-123-7/+30
| | | | | | | | | | | This introduces a new dependancy on libblkid. If a filesystem being exported has a UUID that libblkid can extract, then that is passed to the kernel for use in identifying the filesystem in filehandles. This means that 'fsid=' is no longer needed to work around the problem of device numbers changing. fsid= is still needed for fielsystems that have no device, and can now be given 16byute uuid instead of just a 32bit one.
* Correct spelling errorNeil Brown2007-02-121-2/+2
| | | | writting -> writing
* Make UDP sockets not blockingNeil Brown2007-02-051-4/+15
| | | | | | | | | This is needs if mountd is running multithreaded else multiple threads will be blocked on a UDP port with nothing to read and so won't be able to serve up-calls from the kernel. Thanks to "Murali Krishna V" <vm.krishna@gmail.com> for highlighting the problem.
* Use memset instead of __bzero.Steinar H. Gunderson2007-02-051-1/+1
| | | | | | | | | bzero has been deprecated for years (and anything starting with __ is an internal function anyhow), and __bzero seems to have broken on ia64 not too long ago. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow default options in /etc/exportsSteinar H. Gunderson2007-02-051-28/+54
| | | | | | | | | | | | | | | | | | | | | | | Implement default options in /etc/exports, to fix a long-standing wishlist bug in Debian. (The user claims the syntax matches that of OpenBSD.) This makes it possible to write "/srv/www -sync,no_subtree_check host1 host2 host3" instead of having to write (sync,no_subtree_check) over and over and over again, driving the administrator slowly mad. Such option lines can be placed anywhere on the line, and affects anything after them (I do not know if OpenBSD allows this). The patch is slightly convoluted in order to avoid triggering spurious warnings; for instance, we want "/srv/www -sync host1" to trigger a warning, but not "/srv/www -sync,no_subtree_check host1" or "/srv/www -sync host1(no_subtree_check)". There was also a suggestion for a truly global (ie. per-file) option list, but this seemed like the safest bet, given that it matches that of other implementations. Also, the man page is updated with information on the new possibilities, and an example. Signed-off-by: Steinar H. Gunderson <sesse@debian.org> Signed-off-by: Neil Brown <neilb@suse.de>
* Never set flushtime for a cache in the future.Neil Brown2007-02-051-1/+4
| | | | | | If 'etab' happens to have a timestamp in the future, this will get copied to the flush-time for various caches, and no exports will work until that time arrives. So clamp the flushtime to 'now'.
* Error check messages sent to the kernel.Neil Brown2007-01-113-7/+8
| | | | | | And make sure that if we fail to export a filesystem in mountd, then we don't try to get a filehandle on it, or a deadlock might occur.
* "rpc.nfsd XX" should not fail if ports are already open.Neil Brown2006-08-071-1/+15
| | | | | | | | | support/nfs/nfssvc.c: if any ports are already open, don't try to open any more. This means that once nfsd is running rpc.nfsd X will just change the number of threads, not the ports in use.
* Remove warning if neither 'sync' or 'async' present.Neil Brown2006-08-071-13/+13
| | | | Add warning of neither 'subtree_check' or 'no_subtree_check' present.
* Call nfssvc_versbits before nfssvc_setfdsSteve Dickson2006-07-081-2/+5
| | | | | nfssvc_versbits() has to be called before nfssvc_setfds() for the version processing to work correctly
* Use 65534 for anon uid/gid rather than -2Steinar H. Gunderson2006-07-051-4/+4
| | | | This is more consistant across platforms.
* Update rpcdebug to know about new 2.6 debug flags. AddedGreg Banks2006-07-051-0/+4
| | | | a manpage and installed rpcdebug (in sbindir).
* Remove some files that old, unused, unneeded.Neil Brown2006-07-0512-690/+2
| | | | | | | | | | | | | | | deleted: support/export/keys.c deleted: support/include/rpcdispatch.h deleted: support/include/rpcsec.h deleted: support/include/version.h deleted: support/include/ypupdate.h deleted: support/nfs/clients.c deleted: support/nfs/keytab.c deleted: support/nfs/ypupdate_xdr.c deleted: support/rpc/include/Makefile.am deleted: tools/rpcdebug/neat_idea.c deleted: utils/mountd/mount_xdr.c deleted: utils/rquotad/pathnames.h
* Avoid error creating an existing symlinkNeil Brown2006-07-051-0/+1
| | | | Just remove the link first.
* Use socklen_t some more to avoid warnings.Greg Banks2006-07-031-1/+6
|
* Fix warning about pointer signedness differing.Greg Banks2006-07-031-2/+3
|
* Include the right header to get xmalloc() declaration.Greg Banks2006-07-031-1/+1
|
* Merge branch 'master' of git://linux-nfs.org/nfs-utilsGreg Banks2006-07-039-24/+166
|\
| * Allow rpc.nfsd to suppress tcp or udp, and listen on a specific address.Steve Dickson2006-07-033-4/+95
| | | | | | | | | | | | | | | | | | | | -T - will suppressing listening for TCP connection. -U - will suppress UDP -H host - will only listen on that local address -p port - will listen on that port. This requires kernel patches which will hopefully be in 2.6.19 and possibly some earlier test and vendor kernels.
| * Add support for suppressing different NFS versions.Steve Dickson2006-06-263-2/+40
| | | | | | | | | | | | e.g. -N 2 means that NFSv2 won't be supported, just v3 and v4 (if the kernel supports them).
| * Further coverity related cleanups.Neil Brown2006-06-231-3/+2
| | | | | | | | | | Greg Banks suggested some variations, particularly improved use of xmalloc/xstrdup functions. Thanks.
| * Fix various issues discovered by CoverityNeil Brown2006-06-233-10/+16
| | | | | | | | Thanks to Michael Halcrow for finding them.
| * Fix comment parsing (again)Neil Brown2006-06-231-6/+6
| | | | | | | | | | | | | | | | Bruce Fields noticed that I broke comment parsing... as xskip() is always called before xgettok(), that is the best place to put xskipcomment and still maintain proper semantics of xskip and xgettok.
| * Try to make sure that clientid used for NFSv4 is reliable.Neil Brown2006-06-232-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | We need to give an IP address to identify this client to the server. The current code does a gethostbyname of the hostname. One some systems this returns 127.0.0.1 or similar, which is not useful. Instead, use getsockname of the sock used to connect to the server to confirm that the server is working. This gives the address on the interface that was chosen to talk to that server, which is the best address we can find (if there is a NAT in the way, it might still not work, but in that case there is nothing we can do).
* | Comment out the decades-old SCCS id strings from the original SunGreg Banks2006-06-271-1/+1
| | | | | | | | | | | | distribution. They cause compile warnings, there is no longer any reason to try to build them into the binaries, and gcc seems to be eliding some of them anyway.
* | Detect if glibc provides socklen_t and use that insteadGreg Banks2006-06-271-2/+6
| | | | | | | | | | of int in those cases which generate compile warnings, e.g. the last argument of recvfrom().
* | Fix a number of the easier compile warnings: unused variables,Greg Banks2006-06-223-1/+5
|/ | | | unused labels, constness, signedness.
* multiple threads for mountdGreg Banks2006-06-161-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How about the attached patch against nfs-utils tot? It adds a -t option to set the number of forked workers. Default is 1 thread, i.e. the old behaviour. I've verified that showmount -e, the Ogata mount client, and a real mount from Linux and IRIX boxes work with and without the new option. I've verified that you can manually kill any of the workers without the portmap registration going away, that killing all the workers causes the manager process to wake up and unregister, and killing the manager process causes the workers to be killed and portmap unregistered. I've verified that all the workers have file descriptors for the udp socket and the tcp rendezvous socket, that connections are balanced across all the workers if service times are sufficiently long, and that performance is improved by that parallelism, at least for small numbers of threads. For example, with 60 parallel MOUNT calls and a testing patch to make DNS lookups take 100 milliseconds time to perform all mounts (averaged over 5 runs) is: num elapsed threads time (sec) ------ ---------- 1 13.125 2 6.859 3 4.836 4 3.841 5 3.303 6 3.100 7 3.078 8 3.018 Greg. -- Greg Banks, R&D Software Engineer, SGI Australian Software Group. I don't speak for SGI.
* Move NFS mount code from util-linux to nfs-utils - part 2Amit Gud2006-06-1614-68/+1303
| | | | | | | | | Adds the support functions needed for mount and umount. This functionality will someday be available in the form of shared mount library. Signed-off-by: Amit Gud <agud@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Only treat '#' as starting a comment when at the start of a tokenNeil Brown2006-06-051-2/+5
| | | | otherwise '#' in filenames cannot be read.
* escape hashes in exportsNeil Brown2006-06-051-1/+1
| | | | | | | Makes sure any # signs in the printed-out exports file are escaped (as with quotes, spaces, etc.), so they won't be treated as a comment when they're read back in again. "Steinar H. Gunderson" <sesse@debian.org>
* fix exportfs with multiple matchesNeil Brown2006-06-051-1/+1
| | | | | | | Fixes a problem with exportfs -o and multiple entries of the same type for the same patch that matches a given client. The entire rationale and problem description can be found at http://bugs.debian.org/245449 (fumihiko kakuma <kakmy@mvh.biglobe.ne.jp>)
* Remove **/Makefile.in, aclocal.m4, configure, andNeil Brown2006-04-1710-4713/+0
| | | | | | support/include/config.h.in from source control These are auto autogenerated by aclocal -I aclocal ; autoheader ; automake ; autoconf