Blob Blame History Raw
autofs-5.1.7 - fix flags check in umount_multi()

From: Ian Kent <raven@themaw.net>

Coverity: operator_confusion: "ap->flags | 1" is always 1/true
	  regardless of the values of its operand.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG          |    1 +
 daemon/automount.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 9e385ba9..7add6c55 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -56,6 +56,7 @@
 - fix possible memory leak in mnts_add_amdmount().
 - fix double unlock in parse_mount().
 - add length check in umount_subtree_mounts().
+- fix flags check in umount_multi().
 
 25/01/2021 autofs-5.1.7
 - make bind mounts propagation slave by default.
diff --git a/daemon/automount.c b/daemon/automount.c
index 70506d83..23235a7d 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -662,7 +662,7 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl)
 		/* Check if the autofs mount has browse mode enabled.
 		 * If so re-create the directory entry.
 		 */
-		if (ap->flags | MOUNT_FLAG_GHOST) {
+		if (ap->flags & MOUNT_FLAG_GHOST) {
 			int ret;
 
 			/* If the browse directory create fails log an