summaryrefslogtreecommitdiffstats
path: root/support
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix handling of explicit uuidDavid Woodhouse2008-08-281-1/+1
| | | | | | | | | | | Fix a couple of bugs which show up if you try to explicitly set a 16-byte UUID when exporting a file system. First, exportfs cuts the first two bytes off the UUID and writes something invalid to etab. Second, mountd writes the _ascii_ form of the UUID to the kernel, instead of converting it to hex. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* It appears that a recent glibc update now enforces the requirement for a modeSteve Dickson2008-07-151-1/+7
| | | | | | | | | | parameter for open calls with the O_CREAT flag set. nfs-utils support code defines a function xflock used by exportfs and mountd that calls open with O_CREAT but no mode parameter. This causes exportfs and mountd to dump core, with the error message: *** invalid open64 call: O_CREAT without mode ***:rpc.mountd terminated Signed-off-by: Steve Dickson <steved@redhat.com>
* When a FQDN exists in /var/lib/nfs/rmtab it causesSteve Dickson2008-06-251-2/+2
| | | | | | | | the exportfs command to seg fault due to the nfs_export pointer not being allocated. Reworking the parentheses in rmtab_read() so the htype variable is evaluated correctly fix the problem. Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed the initialization of args2 in xlog_backend. ItSteve Dickson2008-06-061-1/+1
| | | | | | caused a compilation error on x86_64 archs. Signed-off-by: Steve Dickson <steved@redhat.com>
* Cleaned up warnings in rmtab.c and xlog.cSteve Dickson2008-06-062-4/+4
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Fixed arguments to the hosts_ctl() call in the good_client() routineSten Spans2008-05-051-2/+2
| | | | | | used in the tcpwrapper support. Signe-off-by: Steve Dickson <steved@redhat.com>
* Stop the kernel export table from being flushedNeil Brown2008-03-041-1/+1
| | | | | | | on MIPS machines. Reported-by: Anirban Sinha <ASinha@zeugmasystems.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* 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-152-21/+48
| | | | | | | | | | | | | | | 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-152-7/+45
| | | | | | | | | | 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: create client_resolve and change client_compose to take a ↵Jeff Layton2007-09-282-9/+16
| | | | | | | | | | | | | | hostent arg This moves the resolution of IP address to hostent into a helper function and has other functions call it. Having client_compose take a hostent arg allows us to avoid an extra hostname lookup in the auth_authenticate codepath as well. Instead of redoing this lookup in client_compose, we can simply reuse the hostent that was already generated in auth_authenticate. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* rpc.mountd: make exportent->e_hostname a dynamically-allocated stringJeff Layton2007-09-285-24/+15
| | | | | | | | | | | | 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>
* rpc.mountd: Change nfs_client->m_hostname to be a dynamically-allocated stringJeff Layton2007-09-282-9/+8
| | | | | | | | | | | Change nfs_client->m_hostname to be dynamically allocated rather than a fixed length array of size NFSCLNT_IDMAX. This also adds a bit of micro-optimization in a few places since it reduces the amount of string copying that needs to be done. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: add EX_SUCCESS exit codeChuck Lever2007-09-251-0/+1
| | | | | | | | | | | | We've had some recent trouble, especially in the umount code, that appears to be due to functions returning a 1 or a 0 return code when they should be returning a mount exit code (such as EX_FAIL) or a 0. To help clearly distinguish these two classes of functions, define an EX_SUCCESS exit code, which is equal to zero. Signed-off-by: Chuck Lever <chuck.lever@oracle.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-303-32/+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-304-55/+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-302-80/+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-302-77/+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-302-20/+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-302-53/+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-295-29/+19
|
* 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>
* fix broken compile due to missing pseudoflavors.hJ. Bruce Fields2007-07-211-0/+17
| | | | | | | | Commit e9b0bed761bc77ba046f53be2ec324c4b61357ff should also have added this file. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* rpcdebug: Update 'rpcdebug' tool with recently added debugging flagsChuck Lever2007-07-201-1/+3
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Support sec= option to specify export securityJ. Bruce Fields2007-07-102-8/+141
| | | | | | | | | | | 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>
* Memory leak in mountdSteinar H. Gunderson2007-05-111-0/+1
| | | | | | | | | | In client_compose(), free() the hostent structure returned before exiting. Normally, gethostbyaddr() returns a pointer to a static struct, but this hostent comes from either get_reliable_hostbyaddr() or get_hostent(), both which return a pointer they privately xmalloc()ed, which thus can and should be free()d. Signed-Off-By: Steinar H. Gunderson <sesse@debian.org>
* nfs-utils: have mountd hold open etab file to force inode number to changeJeff Layton2007-05-111-0/+6
| | | | | | | | | | | | | This patch changes mountd to hold the etab file open so that when it's changed by exportfs, the inode number should change. We then change auth_reload to reload the file based on whether st_ino is different from the last time it was checked. It also changes auth_reload to maintain a static counter value and return it instead of a timestamp and fixes up get_exportlist accordingly. Finally, it adds some comments to xtab_write to warn people about editing the etab in place. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: NeilBrown <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.
* 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.