autofs5 (5.0.4-3.2) 01UPSTREAM_autofs-5.0.4-fix-notify-mount-message-path

Summary

 CHANGELOG         |    1 +
 daemon/direct.c   |    5 ++++-
 daemon/indirect.c |    5 ++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 01UPSTREAM_autofs-5.0.4-fix-notify-mount-message-path.patch
##
## DP: Upstream patch on top of 5.0.4.

@DPATCH@
autofs-5.0.4 - fix notify mount message path

From: Ian Kent <raven@themaw.net>

If logging is set to verbose we want to log the actual path rather
than the false root. Hoevever, when logging is set to debug we do
need to show the false root to give us the true picture in relation
to accompanying log messages.
---

 CHANGELOG         |    1 +
 daemon/direct.c   |    5 ++++-
 daemon/indirect.c |    5 ++++-
 3 files changed, 9 insertions(+), 2 deletions(-)


diff --git a/CHANGELOG b/CHANGELOG
index d1cc113..0a0519f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -51,6 +51,7 @@
 - always read file maps key lookup fixes.
 - use srv query for domain dn.
 - fix not releasing resources when using submounts.
+- fix notify mount message path.
 
 4/11/2008 autofs-5.0.4
 -----------------------
diff --git a/daemon/direct.c b/daemon/direct.c
index 1ed2b15..74a9acc 100644
--- a/daemon/direct.c
+++ b/daemon/direct.c
@@ -767,8 +767,11 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me, const char *
 	}
 
 	ops->timeout(ap->logopt, ioctlfd, &timeout);
-	notify_mount_result(ap, mountpoint, str_offset);
 	cache_set_ino_index(me->mc, me->key, st.st_dev, st.st_ino);
+	if (ap->logopt & LOGOPT_DEBUG)
+		notify_mount_result(ap, mountpoint, str_offset);
+	else
+		notify_mount_result(ap, me->key, str_offset);
 	ops->close(ap->logopt, ioctlfd);
 
 	debug(ap->logopt, "mounted trigger %s at %s", me->key, mountpoint);
diff --git a/daemon/indirect.c b/daemon/indirect.c
index bc39e63..463b39c 100644
--- a/daemon/indirect.c
+++ b/daemon/indirect.c
@@ -174,7 +174,10 @@ static int do_mount_autofs_indirect(struct autofs_point *ap, const char *root)
 	ap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO;
 
 	ops->timeout(ap->logopt, ap->ioctlfd, &timeout);
-	notify_mount_result(ap, root, str_indirect);
+	if (ap->logopt & LOGOPT_DEBUG)
+		notify_mount_result(ap, root, str_indirect);
+	else
+		notify_mount_result(ap, ap->path, str_indirect);
 
 	return 0;