From dbeba43bd33ce41bc3c5c95615176e59eb76f00c Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 11 Jan 2007 12:51:29 +1100 Subject: 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. --- utils/mountd/mountd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils/mountd/mountd.c') 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) { -- cgit