summaryrefslogtreecommitdiffstats
path: root/utils/exportfs/exportfs.c
Commit message (Collapse)AuthorAgeFilesLines
* exportfs: Update exportfs flush option list in usage message.Namjae Jeon2012-07-051-9/+12
| | | | | | | Update exportfs flush option list in usage message. And sorted these cases in alphabetical order. Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Removed warnings about routines not being prototypedSteve Dickson2012-03-121-2/+4
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Stop racing exportfs on clustersSteve Dickson2012-03-121-0/+41
| | | | | | | | | | This problem can occur when multiple cluster services fail over at the same time, causing missing high-available exports. Having a lot of nfs-exports will trigger this issue easier. https://bugzilla.linux-nfs.org/show_bug.cgi?id=224 Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: do not warn if /etc/exports.d/ does not existMike Frysinger2011-09-011-2/+5
| | | | | | | | | It isn't uncommon for /etc/exports.d/ to not exist, and imo, it's not that big of a deal as often times, a simple /etc/exports is sufficient. So silently skip the case where the dir is missing. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: drop extra newline in xlogMike Frysinger2011-09-011-4/+4
| | | | | | | | Since xlog() itself appends a newline, we don't want to add our own otherwise we get extra in the output. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: matchhostname() doesn't handle localhost properlyChuck Lever2011-08-291-2/+32
| | | | | | | | | | | | Same change as statd_matchhostname() is necessary for the logic in exportfs. Recall that these are "separate but nearly equal" because the exportfs version requires extra expensive string checking that would be onerous for statd. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed a warning from exportfs.cSteve Dickson2011-04-061-1/+1
| | | | | | exportfs.c:280:29: warning: 'exp' may be used uninitialized in this function Signed-off-by: Steve Dickson <steved@redhat.com>
* Read /etc/exports.d/*.export as extra export filesMasatake YAMATO2011-03-071-1/+58
| | | | | | | | | | | | | | | | This patch adding a capability to read /etc/exports.d/*.exports as extra export files to exportfs. If one wants to add or remove an export entry in a script, currently one may have to use sed or something tool for adding or removing the line for the entry in /etc/exports file. With the patch, adding and removing an entry from a script is much easier. cat<<EOF... or mv can be used for adding. rm can be used for removing. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Enable IPv6 support in matchhostname()Chuck Lever2010-09-161-21/+2
| | | | | | | | | | | | To gain IPv6 support in matchhostname(), simply replace the socket address comparison helpers with the generic versions that can handle IPv4 and IPv6. host_addrinfo() (called by matchhostname()) returns IPv6 addresses only if IPv6 support is enabled. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Use xlog() for error reportingChuck Lever2010-08-241-27/+29
| | | | | | | | | | | | | | exportfs already invokes xlog_open() because libexport.a uses xlog() exclusively for error reporting and debugging messages. If we can use xlog() throughout exportfs itself, that enables xlog debugging messages everywhere in the code path. In addition, use xlog() instead of fprintf(stderr) for reporting errors in exportfs.c, to be consistent with libexport.a and other components of nfs-utils. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: exportfs.c no longer needs #include "xmalloc.h"Chuck Lever2010-08-241-2/+4
| | | | | | | | Clean up: No calls to xmalloc() or xstrdup() here. No need for the double #include of xmalloc.h. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Replace matchhostname()Chuck Lever2010-06-221-0/+78
| | | | | | | | | | | | | | | | | So that exportfs can eventually support IPv6 addresses, copy statd's getaddrinfo(3)-based matchhostname to exportfs, with adjustments for dealing with export wildcards and netgroups. Until exportfs has full IPv6 support, however, we want to ensure that IPv6 addresses continue to remain blocked in the address comparison code used by exportfs. At a later point we'll replace much of this with the generic functions in sockaddr.h. Since it contains special logic for handling wildcard and netgroups, this function is specialized for exportfs, and does not belong in one of the shared libraries. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Replace "struct hostent" with "struct addrinfo"Chuck Lever2010-06-221-16/+9
| | | | | | | | | | | | | | | | | | | struct hostent can store either IPv4 or IPv6 addresses, but it can't store both address families concurrently for the same host. Neither can hostent deal with parts of socket addresses that are outside of the sin{,6}_addr field. Replace the use of "struct hostent" everywhere in libexport.a, mountd, and exportfs with "struct addrinfo". This is a large change, but there are so many strong dependencies on struct hostent that this can't easily be broken into smaller pieces. One benefit of this change is that hostent_dup() is no longer required, since the results of getaddrinfo(3) are already dynamically allocated. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Add a common exit label in exportfs()Chuck Lever2010-06-221-8/+6
| | | | | | | | | Clean up: Reduce code duplication by introducing a goto label for freeing hp and exiting. This will make replacing "struct hostent *" with "struct addrinfo *" more straightforward in this code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Add helpers to manage DNS lookupsChuck Lever2010-06-221-6/+5
| | | | | | | | | | | | | | | Introduce DNS query helpers based on getaddrinfo(3) and getnameinfo(3). These will eventually replace the existing hostent-based functions in support/export/hostname.c. Put some of these new helpers to immediate use, where convenient. As they are part of libexport.a, I've added the forward declarations for these new functions in exportfs.h rather than misc.h, where the hostent-based forward declarations are currently. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Added the sys/stat.h header file to a number ofSteve Dickson2010-01-221-0/+1
| | | | | | files which ensure the S_ISDIR() macro is defined. Signed-off-by: Steve Dickson <steved@redhat.com>
* Exportfs and rpc.mountd optimalizationTomas Richter2009-02-181-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | There were some problems with exportfs and rpc.mountd for long export lists - see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76643 I do optimalization as my bachelors thesis (Facuulty of informatics, Masaryk's university Brno, Czech Republic), under lead of Yenya Kasprzak. Both exportfs and rpc.mount build linked list of exports (shared functions in export.c). Every time they are inserting new export into list, they search for same export in list. I replaced linked list by hash table and functions export_add and export_lookup by functions hash_export_add and hash_export_lookup (export.c). Because some other functions required exportlist as linked list, hash table has some implementation modification im comparison with ordinary hash table. It also keeps exports in linked list and has pointer to head of the list. So there's no need of implementation function <for_all_in_hash_table>. Signed-off-by: Tomas Richter <krik3t@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Stop exportfs warning about needing fsid, when we actually have oneDavid Woodhouse2008-08-281-1/+9
| | | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Support sec= option to specify export securityJ. Bruce Fields2007-07-101-0/+1
| | | | | | | | | | | 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>
* exportfs - test exportability of filesystems when exportfs is run.Neil Brown2007-04-021-1/+85
| | | | | | | | | When exporting a filesystem test to see if the kernel is likely to accept the export and print suitable warning message if not. Don't actually fail the 'exportfs' as by the time a MOUNT request arrives, the filesystem might be exportable. Signed-off-by: Neil Brown <neilb@suse.de>
* Make warning about host matching multiple exports more helpful.Neil Brown2007-03-191-0/+2
| | | | | 1/ only warn once per export, as it could get too noisy. 2/ make it a little clearer why this might be a problem.
* Remove "maptype" supportJ. Bruce Fields2007-03-151-4/+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>
* Extend the exportfs/mountd interface to pass fslocations info into the kernelFred Isaman2007-02-271-0/+2
| | | | | | | | 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>
* Extend the exportfs interface to pass fslocations info into the kernel.Fred Isaman2007-02-221-1/+13
| | | | | | | | | | 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>
* Use UUIDs to identify filesystems if kernel supports it.Neil Brown2007-02-121-0/+2
| | | | | | | | | | | 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.
* One final step in convertion of anon = -2 -> 65534Neil Brown2006-08-091-2/+2
| | | | | Printing export options should avoid printing 'anonuid=65534' rather than avoiding 'anonuid=-2'.
* Autogen updateneilbrown2005-12-201-1/+3
|
* Support "acl" and "no_acl" export options.chip2005-04-061-0/+2
|
* Prepare to support gss authentication and idmap looks for nfsv4neilbrown2004-09-151-28/+38
|
* Fix cache flushing problem.neilbrown2004-06-081-1/+2
|
* Change CROSSMNT to CROSSMOUNTneilbrown2003-08-061-1/+1
|
* /proc/fs/nfsd as an alternate to /proc/fs/nfsdneilbrown2003-08-041-1/+1
|
* Release 1.0.5neilbrown2003-07-171-2/+8
|
* *** empty log message ***neilbrown2003-07-141-2/+2
|
* Assorted fixesneilbrown2003-07-141-5/+8
|
* Fixes to make unexporting and exporting with wildcardsneilbrown2003-07-031-4/+8
| | | | work more sensibly.
* new "mountpoint" export option.neilbrown2003-05-301-0/+14
|
* enhance exportfs to use new cache/upcall stuffneilbrown2003-05-211-6/+21
|
* Make CROSSMNT distinct from NOHIDEneilbrown2003-05-211-1/+3
|
* 2002-10-11 H.J. Lu <hjl@lucon.org>hjl2002-10-111-1/+3
| | | | | | | | | | | | | * support/include/exportfs.h (export_errno): New. * support/nfs/exports.c: Include <errno.h>. (export_errno): New. (getexportent): Set export_errno to EINVAL for bad option. (parseopts): Likewise. Report the location of the default sync/async option. * utils/exportfs/exportfs.c (main): Initialize export_errno to 0. Return export_errno.
* *** empty log message ***neilbrown2002-02-281-0/+2
|
* missed an assignment for hp->h_name to hname...neilbrown2001-09-211-0/+1
|
* make "exportfs -au" do no DNS lookupneilbrown2001-09-201-44/+13
|
* call gethostbyaddr to make sure that we have canonical hostnameneilbrown2001-09-201-1/+8
| | | | for all exports
* 1/ be less trusting of information in /var/lib/nfs/xtab. Add things toneilbrown2000-08-231-1/+1
| | | | | | kernel even if they are in here. 2/ O_CREAT [ex]log when locking for write incase they don't exist 3/ added etc/debian diretory with some files
* add reporting of nohide, insecure_locks and no_subtree_check inneilbrown2000-03-071-0/+6
| | | | | exportfs -V cvs: ----------------------------------------------------------------------
* Initial revisionhjl1999-10-181-0/+391