summaryrefslogtreecommitdiffstats
path: root/utils/mountd/mountd.c
Commit message (Collapse)AuthorAgeFilesLines
* nfs-utils: have mountd hold open etab file to force inode number to changeJeff Layton2007-05-111-5/+5
| | | | | | | | | | | | | 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>
* Allow exporting of a subfilesystem when 'crossmnt' is set.Neil Brown2007-03-191-3/+3
| | | | | | | | | If we are asked to export a filesystem which is not explicitly exported, but an ancestor is exported as 'crossmnt', export the filesystems with the same options as the ancestor. This is the first step to making 'crossmnt' effectively export a tree of filesystems.
* Support group-id looks for kernels that ask for them.Neil Brown2007-02-121-2/+7
| | | | | | | 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.
* Ensure 'showmount -e' gets current information.Neil Brown2007-01-111-1/+6
| | | | | | If auth_reload has been called by someone else, get_exportlist can incorrectly return old data. So track modify times better and only use cached data if the modify time matches.
* Error check messages sent to the kernel.Neil Brown2007-01-111-2/+5
| | | | | | 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.
* add missing long option for -r in mountdJeff Layton2006-12-201-0/+1
| | | | | | | | | I forgot a bit of code that needs to go into patch 3 that I posted yesterday. This adds a long option for the -r option. I'll post manpage update patches once I get them written up. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* add -r flag to make mountd do reverse resolve of ipaddress on the flyJeff Layton2006-12-191-1/+5
| | | | | | | | | | | | | For those that want "traditional" showmount -a behavior from their mountd (hostname:/path instead of ipaddr:/path). This patch adds a '-r' flag that does a reverse-resolve for each IP address listed in the rmtab when a dump operation is called. Probably not a good idea for those concerned about performance, but since it's not the default option, I don't see it being an issue. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* remove extraneous mountlist_add/del calls and change remaining ones to use ↵Jeff Layton2006-12-191-9/+8
| | | | | | | | | | | | | | | | | | | | | | IP addresses Neil suggested a patch to change the mountlist_add and mountlist_del calls to use IP addresses instead of the names returned by client_compose based on a command line option flag. I don't see any real reason to put client_compose strings into the rmtab, so this patch makes it so that it adds IP addresses instead of those strings to the rmtab by default. It also removes all mountlist_add calls that are being done from kernel cache routines. My main concern there is NFSv4. We don't seem to make any upcalls to mountd on NFSv4 unmounts, and I don't see a way to reliably remove NFSv4 entries. So, I figured I'd stick with having mountlist_add only called when a v2 or v3 mount call is made, and mountlist_del called only on the corresponding unmount call. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix -n option to mountdSteinar H. Gunderson2006-10-241-1/+1
| | | | | | | The getopt_long() option string in mountd was having a spurious colon after the 'n', leading to the short form of --no-tcp not being usable (expecting a parameter, contrary to the long form and the documentation). Fix.
* Fix a number of the easier compile warnings: unused variables,Greg Banks2006-06-221-4/+4
| | | | unused labels, constness, signedness.
* multiple threads for mountdGreg Banks2006-06-161-9/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* mountd state directoryNeil Brown2006-06-051-4/+13
| | | | | | Let the user select (via a new parameter) the path to the NFS state directory for mountd, to match the statd functionality. "Steinar H. Gunderson" <sesse@debian.org>
* Autogen updateneilbrown2005-12-201-1/+3
|
* Small nfs-utils patch from Olaf Kirchneilbrown2005-10-071-4/+2
|
* Assorted changes from Steve Dicksonneilbrown2005-10-061-14/+15
|
* 2005-08-26 Kevin Coffman <kwc@citi.umich.edu>neilbrown2005-08-261-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *utils/mountd/mountd.c: mountd currently always returns AUTH_NULL and AUTH_SYS as the allowable flavors in mount replies. We want it to also return gss flavors when appropriate. For now as a hack we just have it always return the KRB5 flavors as well. *utils/mountd/cache.c: When attempting to mount an NFSv4 pseudofilesystem (fsid=0) and the actual exported directory does not exist on the server, rpc.mountd doesn't check the directory exists (when fsidtype=1, i.e. using fsid, but does check for fsidtype=0, i.e. using dev/ino). The non-existent exported directory path with fsid=0 is written to the kernel via /proc/net/rpc/nfsd.export/channel, which leads to path_lookup() to return ENOENT (seems appropriate). Unfortunately, the new_cache approach ignores errors returned when writing via the channel file so that particular error is lost and the mount request is silently ignored. Assuming it doesn't make sense to revamp the new_cache/up-call method to not ignore returned errors, it seems appropriate to fix the case where rpc.mountd doesn't check for the existence of an exported directory with fsid= semantics. The following patch does this by moving the stat() up so it is done for both fsidtype's. I'm not certain whether the other tests need to be executed for fsidtype=1, but it doesn't appear to hurt [Not exactly true: the comparison of inode numbers caused problems so now it's kept for fsidtype=0 only]. Would it be also desirable to log a warning for every error, if any, returned by a write to any of the /proc/net/rpc/*/channel files which would otherwise be ignored (maybe under a debug flag)? * gssd/mountd/svcgssd: Changes gssd, svcgssd, and mountd to ignore a SIGHUP rather than dying. * many: Remove the gssapi code and rely on an external library instead.
* Sanitise stderr logging.neilbrown2005-03-141-2/+2
|
* Support --ha-callout for high-availability calloutsneilbrown2004-09-061-2/+12
|
* 1.0.6neilbrown2003-09-121-2/+2
|
* Work around RLIMIT_NOFILE-to-big problemneilbrown2003-09-121-11/+14
|
* Change CROSSMNT to CROSSMOUNTneilbrown2003-08-061-1/+1
|
* Open channel files O_WRONLY, and improve mountlist support.neilbrown2003-08-041-3/+9
|
* Release 1.0.5neilbrown2003-07-171-12/+13
|
* Assorted fixesneilbrown2003-07-141-1/+1
|
* See Changelogneilbrown2003-07-021-0/+1
|
* new "mountpoint" export option.neilbrown2003-05-301-0/+7
|
* Stuffneilbrown2003-05-231-3/+13
|
* Support new kernel upcalls for export cache management.neilbrown2003-05-211-2/+28
|
* See Changelogneilbrown2003-02-191-1/+1
|
* 2002-04-08 H.J. Lu <hjl@lucon.org>hjl2002-04-081-1/+1
| | | | | | | | | | | | | * etc/redhat/nfs: New. * etc/redhat/nfs.init: Updated. * nfs-utils.spec.in: Updated. * nfs-utils.spec: Regenerated. * utils/mountd/mountd.c (longopts): Fix a typo. * utils/mountd/mountd.man: Updated.
* 2001-10-11 Chip Salzenberg <chip@pobox.com>chip2001-10-111-8/+9
| | | | | * utils/mountd/mountd.c (main): Close fds > 2 _before_ RPC init. * debian/changelog: Version 0.3.3-2.
* 2001-10-08 Chip Salzenberg <chip@pobox.com>chip2001-10-081-2/+8
| | | | * utils/mountd/mountd.c (main): When daemonizing, close all fds > 2.
* 2001-06-05 H.J. Lu <hjl@lucon.org>hjl2001-06-051-5/+30
| | | | | | | | | * utils/mountd/mountd.c (longopts): Add "foreground/d". (main): Support --foreground/-d to set the limit of the number of open file descriptors. (usage): Updated. * utils/mountd/mountd.man: Updated for --foreground/-d.
* 2001-05-28 H.J. Lu <hjl@lucon.org>hjl2001-05-281-0/+7
| | | | | | | * utils/lockd/lockd.c (main): chdir to NFS_STATEDIR. * utils/mountd/mountd.c (main): Likewise. * utils/nfsd/nfsd.c (main): Likewise. * utils/rquotad/rquota_svc.c (main): Likewise.
* 2001-02-02 H.J. Lu <hjl@lucon.org>hjl2001-02-111-3/+3
| | | | | | | | | | | | * support/include/rpcmisc.h (rpc_init): Remove bufsize. * support/nfs/rpcmisc.c (makesock): Remove socksz and comment out SO_SNDBUF/SO_RCVBUF. (rpc_init): Remove bufsize and remove socksz in calls to makesock (). * utils/mountd/mountd.c (main): Remove bufsize in calls to rpc_init ().
* 2000-11-09 H.J. Lu <hjl@lucon.org>hjl2000-11-091-1/+5
| | | | | | | | | | | | * etc/redhat/nfs.init (start): Pass --no-tcp to mountd if TCP is not supported by kernel. * support/nfs/rpcmisc.c (rpc_init): Don't set _rpcfdtype to 0. * utils/mountd/mountd.c (longopts): Add "-n/--no-tcp". (main): Set to _rpcfdtype to SOCK_DGRAM for "-n/--no-tcp". * utils/mountd/mountd.man: Updated for "-n/--no-tcp".
* 2000-08-25 Ion Badulescu <ionut@cs.columbia.edu>hjl2000-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * utils/rquotad/rquotad.man, utils/statd/statd.man, utils/mountd/mountd.man: updated * utils/mountd/Makefile (LIBS): added -lmisc $(LIBWRAP) $(LIBNSL) * utils/rquotad/Makefile: fix comment * support/misc/tcpwrapper.c (logit): added comment about waiting for the children after fork() * utils/mountd/mountd.c (main): ignore SIGCHLD to prevent leaving zombies behind (from logit()'s fork) * utils/rquotad/rquota_svc.c (main): ditto * utils/statd/statd.c (main): ditto * utils/rquotad/rquota_svc.c (rquotaprog_1): pass RQUOTAPROG to check_default instead of 0, for prognum * utils/statd/statd.c (sm_prog_1_wrapper): pass SM_PROG to check_default instead of 0, for prognum * utils/mountd/mount_dispatch.c: Include "tcpwrapper.h" if HAVE_TCP_WRAPPER is defined. (mount_dispatch): Call check_default () if HAVE_TCP_WRAPPER is defined. Reject an RPC call if check_default () fails.
* 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
* 2000-06-05 H.J. Lu <hjl@lucon.org>hjl2000-06-061-7/+16
| | | | | | | | | | | * utils/mountd/mountd.c (mount_dump_1_svc): Cast svc_getcaller to "struct sockaddr_in *" for glibc 2.2. (mount_umnt_1_svc): Likewise. (mount_umntall_1_svc): Likewise. (mount_export_1_svc): Likewise. (mount_exportall_1_svc): Likewise. (mount_pathconf_2_svc): Likewise. (get_rootfh): Likewise.
* Change to using variable length file handles, for better v3 support, andneilbrown2000-03-211-18/+22
| | | | | introduce getfh_size to use new (2.3.99) syscall for getting file handles with length
* Mon Jan 10 14:26:33 2000 H.J. Lu <hjl@lucon.org>hjl2000-01-101-1/+1
| | | | | | | | * utils/mountd/auth.c (auth_authenticate_internal): Call xstrdup for hostname before passing it to gethostbyname. * utils/mountd/mountd.c (get_exportlist): Use xstrdup instead of strdup.
* Initial revisionhjl1999-10-181-0/+489