Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 275

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs=5.0.3 - don't readmap on HUP for new mount

From: Ian Kent <raven@themaw.net>

If we're performin a new mount during a HUP signal then
we will read the map during the mount.
---

 lib/master.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/lib/master.c b/lib/master.c
index d971ad6..13302f1 100644
--- a/lib/master.c
+++ b/lib/master.c
@@ -1108,8 +1108,6 @@ int master_mount_mounts(struct master *master, time_t age, int readall)
 		}
 		cache_unlock(nc);
 
-		check_update_map_sources(this, readall);
-
 		st_mutex_lock();
 
 		state_pipe = this->ap->state_pipe[1];
@@ -1120,11 +1118,14 @@ int master_mount_mounts(struct master *master, time_t age, int readall)
 
 		st_mutex_unlock();
 
-		if (ret == -1 && save_errno == EBADF)
+		if (!ret)
+			check_update_map_sources(this, readall);
+		else if (ret == -1 && save_errno == EBADF) {
 			if (!master_do_mount(this)) {
 				list_del_init(&this->list);
 				master_free_mapent_sources(ap->entry, 1);
 				master_free_mapent(ap->entry);
+			}
 		}
 	}