summaryrefslogtreecommitdiffstats
path: root/support/nfs
Commit message (Collapse)AuthorAgeFilesLines
...
* Stop segfaults on amd64 during warnings messages by creatingSteve Dickson2008-01-171-2/+7
| | | | | | | | | a second va_list in xlog_backend() and then use that va_list to print messages on stderr. Signed-off-by: Steinar H. Gunderson <sesse@debian.org> Signed-off-by: Steve Langasek <vorlon@debian.org> Signed-off-by: Steve Dickson <steved@dickson.boston.devel.redhat.com>
* Automatically set 'nohide' on referral exports.Steve Dickson2008-01-091-0/+6
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Cleanup xlog logging code to be safe and usable for allKevin Coffman2007-10-151-21/+43
| | | | | | | | | | | | | | | This patch reworks the xlog logging code to avoid rebuilding the message into a fixed size buffer. It also adds two new logging functions xlog_warn and xlog_err which are replacements for idmap_warn and idmap_err. There use to be two different variates of these functions with the only difference being that one flavor tacked on the error string to the end of the message. This responsibility has been pushed to the called of the function since it needlessly complicated the function and required us to rebuild the message strings. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Copy new cacheio functions used by svcgssd to nfslibKevin Coffman2007-10-151-7/+40
| | | | | | | | | | Copy private qword_ functions from the svcgssd version into the general nfslib library. Add prototypes as needed. Also, update readline to use a bigger buffer allocation as is needed in the svcgssd version. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* rpc.mountd: make exportent->e_hostname a dynamically-allocated stringJeff Layton2007-09-281-13/+6
| | | | | | | | | | | | This makes the e_hostname field of the exportent into a pointer to a dynamically allocated string. This is necessary since this is field is often filled out from the m_hostname. This too adds a few micro-optimizations as we can avoid copying the string in some places and simply pass a pointer to the original string instead. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* nfs-utils: specify a create mode with open(...O_CREAT) call in xflockJeff Layton2007-08-091-1/+1
| | | | | | | | | The xflock function can create a file via open() with O_CREAT, but does not specify the create mode when it does so. I think 0644 should be appropriate given the current usage of this function. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: eliminate another dependency on a global variableChuck Lever2007-07-301-1/+1
| | | | | | | | | | | | | | The file support/nfs/fstab.c, which is linked into libnfs.a, depends on the global variable "verbose." This variable is defined and used only in the mount command, and the functions in fstab.c are used only by the mount command. Move fstab.c and support/include/fstab.h to utils/mount. This file placement is also consistent with at least one other mount helper, mount.ocfs2. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: eliminate conn.c and conn.hChuck Lever2007-07-302-22/+1
| | | | | | | conn.[ch] are now no longer needed. Clean them out and delete them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move get_socket() function to utils/mount/network.cChuck Lever2007-07-301-78/+0
| | | | | | | | | | Now we can address the real problem: that get_socket() depends on the global variable "verbose" which is only available in the mount command. Move get_socket() into utils/mount/network.c, and make it static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move clnt_ping() to utils/mountChuck Lever2007-07-301-75/+0
| | | | | | | | | | Continue clean up of mount functionality in libnfs.a by moving clnt_ping() to utils/mount/network.c. Note that socklen_t is an unsigned int... the i386 gcc compiler threw a signedness warning about the 3rd argument of getsockname(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move more mount-only functions out of libnfs.aChuck Lever2007-07-301-18/+0
| | | | | | | Continue clean-up with nfsvers_to_mnt() and mntvers_to_nfs(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move mnt_{open, close}clnt calls to utils/mount/network.cChuck Lever2007-07-301-48/+0
| | | | | | | | | | | | | | | | | It turns out that get_socket() accesses a global variable, "verbose," that is only available in the mount command; yet it's in libnfs.a. This creates an undocumented API dependency that will bite someone someday. This mount-specific functionality doesn't really belong in libnfs.a anyway. The simplest way to resolve this is to move all of the functions in support/nfs/conn.c into utils/mount. network.c seems like the logical place to put these. An added benefit is we eventually get to make get_socket() static. Let's start with the mnt_{open,close}clnt functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Add -Wstrict-prototypes to compiler args, and fix warnings caused.Neil Brown2007-07-293-9/+7
|
* Use __fpurge to ensure single-line writes to cache filesJ. Bruce Fields2007-07-271-0/+12
| | | | | | | | | | | | | | | | | | | | On a recent Debian/Sid machine, I saw libc retrying stdio writes that returned write errors. The result is that if an export downcall returns an error (which it can in normal operation, since it currently (incorrectly) returns -ENOENT on any negative downcall), then subsequent downcalls will write multiple lines (including the original line that received the error). The result is that the server fails to respond to any rpc call that refers to an unexported mount point (such as a readdir of a directory containing such a mountpoint), so client commands hang. I don't know whether this libc behavior is correct or expected, but it seems safest to add the __fpurge() (suggested by Neil) to ensure data is thrown away. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Support sec= option to specify export securityJ. Bruce Fields2007-07-101-8/+131
| | | | | | | | | | | This adds support for reading sec= option and sending security data through cache via "... secinfo n flavor1 flag1 ... flavorN flagN". If sec= is missing, no secinfo option will be passed down. Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* move pseudoflavor information to common codeJ. Bruce Fields2007-07-101-0/+19
| | | | | | | | I'd like to be able to use the same pseudoflavor data in exportfs and mountd; so move it to nfslib and a common include. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Fix retry= to handle lack of reserved port situationFlavio Leitner2007-07-101-0/+8
| | | | | | | | | | In the case of several (>500) mounts running at the same time with -o tcp, the number of attempts that succeed is about 300-500 because it run out of priviledged port (they are busy in TIME_WAIT state). Signed-off-by: Flavio Leitner <flavio.leitner@gmail.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Be more cautious about use for privilege ports (<1024).Neil Brown2007-04-161-3/+0
| | | | | | | | | | | | | Ports < 1024 are a scarce resource and should not be used carelessly. Technically they should be not used at all without registration with IANA, but sometimes we need them despite that. So: for the socket that RPC services listen on, don't use a <1024 port by default. There is no need. For sockets that we send messages on, that are long-lived, and that might need to appear 'privileged', avoid using a number that is registered in /etc/services if possible.
* 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.
* 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.
* Fix another warning: error -> nfs_errorNeil Brown2007-03-161-2/+2
|
* Remove nfs_mntent_t in favour of struct mntentNeil Brown2007-03-162-5/+5
| | | | They are identical and the later allows us to use hasmntent.
* Correctly handle "user" and "users" mount options.Neil Brown2007-03-161-0/+58
| | | | | | | | | | | | 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-161-1/+1
| | | | It is only used in one place.
* Remove "maptype" supportJ. Bruce Fields2007-03-151-37/+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-131-27/+35
| | | | | | | | | | | | | | | | | | | | | | 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-271-0/+4
|\
| * Extend the exportfs/mountd interface to pass fslocations info into the kernelFred Isaman2007-02-271-0/+4
| | | | | | | | | | | | | | | | 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-222-23/+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-221-1/+36
| | | | | | | | | | 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-122-7/+29
| | | | | | | | | | | 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-112-6/+7
| | | | | | 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.
* Remove some files that old, unused, unneeded.Neil Brown2006-07-054-493/+0
| | | | | | | | | | | | | | | 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
* 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
|
* Merge branch 'master' of git://linux-nfs.org/nfs-utilsGreg Banks2006-07-035-15/+140
|\
| * Allow rpc.nfsd to suppress tcp or udp, and listen on a specific address.Steve Dickson2006-07-031-3/+90
| | | | | | | | | | | | | | | | | | | | -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-261-1/+32
| | | | | | | | | | | | e.g. -N 2 means that NFSv2 won't be supported, just v3 and v4 (if the kernel supports them).
| * Fix various issues discovered by CoverityNeil Brown2006-06-232-4/+4
| | | | | | | | Thanks to Michael Halcrow for finding them.