File 0001-autofs-5.1.9-fix-get-parent-multi-mount-check-in-try.patch of Package autofs

From ad2ab844414acb793b2a5fc71edcda8e179aeda2 Mon Sep 17 00:00:00 2001
From: Ian Kent <raven@themaw.net>
Date: Tue, 5 Dec 2023 11:18:58 +0800
Subject: [PATCH 01/14] autofs-5.1.9 - fix get parent multi-mount check in
 try_remount()

In commit 635b90ecc (autofs-5.1.8 - fix mount tree startup reconnect)
when getting the parent the check for a multi-mount should include a
check for the root of the multi-mount as well since the root does not
set its parent (it remains NULL).

We could set the root parent to itself but that may have side effects
because the convention has always been the parent is NULL for the
multi-mount root.

Reported-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Suggested-by: Roberto Bergantinos Corpas <rbergant@redhat.com>

Signed-off-by: Ian Kent <raven@themaw.net>
(cherry picked from commit fe0cc2dc930990da59b0c6facf043d7067af476a)
---
 CHANGELOG    | 3 +++
 lib/mounts.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Index: autofs-5.1.9/CHANGELOG
===================================================================
--- autofs-5.1.9.orig/CHANGELOG
+++ autofs-5.1.9/CHANGELOG
@@ -1,5 +1,7 @@
 
+=======
 - Fix incompatible function pointer types in cyrus-sasl module.
+- fix get parent multi-mount check in try_remount().
 
 02/11/2023 autofs-5.1.9
 - fix kernel mount status notification.
Index: autofs-5.1.9/lib/mounts.c
===================================================================
--- autofs-5.1.9.orig/lib/mounts.c
+++ autofs-5.1.9/lib/mounts.c
@@ -2878,7 +2878,7 @@ int try_remount(struct autofs_point *ap,
 	}
 
 	me->flags &= ~MOUNT_FLAG_DIR_CREATED;
-	mapent = IS_MM(me) ? MM_PARENT(me) : me;
+	mapent = IS_MM(me) && !IS_MM_ROOT(me) ? MM_PARENT(me) : me;
 	/* Direct or offset mount, key is full path */
 	if (mapent->key[0] == '/') {
 		if (!is_mounted(mapent->key, MNTS_REAL))
openSUSE Build Service is sponsored by