diff options
author | Neil Brown <neilb@suse.de> | 2007-01-11 12:51:29 +1100 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-01-11 12:51:29 +1100 |
commit | dbeba43bd33ce41bc3c5c95615176e59eb76f00c (patch) | |
tree | 8ebaaafe5a35425b39e9e792565cf3b4497b1131 /utils/mountd/mountd.c | |
parent | 8fd9fad1ea4b25b8962d70133f476650ef0637b0 (diff) | |
download | nfs-utils-dbeba43bd33ce41bc3c5c95615176e59eb76f00c.tar.gz nfs-utils-dbeba43bd33ce41bc3c5c95615176e59eb76f00c.tar.xz nfs-utils-dbeba43bd33ce41bc3c5c95615176e59eb76f00c.zip |
Ensure 'showmount -e' gets current information.
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.
Diffstat (limited to 'utils/mountd/mountd.c')
-rw-r--r-- | utils/mountd/mountd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index 72332ce..5204faa 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -463,14 +463,19 @@ static exports get_exportlist(void) { static exports elist = NULL; + static time_t etime = 0; + time_t atime; struct exportnode *e, *ne; struct groupnode *g, *ng, *c, **cp; nfs_export *exp; int i; - if (!auth_reload() && elist) + atime = auth_reload(); + if (elist && atime == etime) return elist; + etime = atime; + for (e = elist; e != NULL; e = ne) { ne = e->ex_next; for (g = e->ex_groups; g != NULL; g = ng) { |