summaryrefslogtreecommitdiffstats
path: root/utils/mountd/auth.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-01-11 12:51:29 +1100
committerNeil Brown <neilb@suse.de>2007-01-11 12:51:29 +1100
commitdbeba43bd33ce41bc3c5c95615176e59eb76f00c (patch)
tree8ebaaafe5a35425b39e9e792565cf3b4497b1131 /utils/mountd/auth.c
parent8fd9fad1ea4b25b8962d70133f476650ef0637b0 (diff)
downloadnfs-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/auth.c')
-rw-r--r--utils/mountd/auth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index 4f803d7..183c9ea 100644
--- a/utils/mountd/auth.c
+++ b/utils/mountd/auth.c
@@ -46,7 +46,7 @@ auth_init(char *exports)
xtab_mount_write();
}
-int
+time_t
auth_reload()
{
struct stat stb;
@@ -55,7 +55,7 @@ auth_reload()
if (stat(_PATH_ETAB, &stb) < 0)
xlog(L_FATAL, "couldn't stat %s", _PATH_ETAB);
if (stb.st_mtime == last_modified)
- return 0;
+ return last_modified;
last_modified = stb.st_mtime;
export_freeall();
@@ -63,7 +63,7 @@ auth_reload()
// export_read(export_file);
xtab_export_read();
- return 1;
+ return last_modified;
}
static nfs_export *