Blame SOURCES/autofs-5.0.7-fix-check-mkdir_path-in-mount_bind-mount_mount.patch

306fa1
autofs-5.0.7 - fix check mkdir_path() in mount_bind.c:mount_mount()
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
306fa1
---
306fa1
 modules/mount_bind.c |    7 ++++++-
306fa1
 1 file changed, 6 insertions(+), 1 deletion(-)
306fa1
306fa1
diff --git a/modules/mount_bind.c b/modules/mount_bind.c
306fa1
index d6c6fe7..61a773c 100644
306fa1
--- a/modules/mount_bind.c
306fa1
+++ b/modules/mount_bind.c
306fa1
@@ -209,7 +209,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
306fa1
 			      "failed to create local mount %s -> %s",
306fa1
 			      fullpath, what);
306fa1
 			if (ap->flags & MOUNT_FLAG_GHOST && !status)
306fa1
-				mkdir_path(fullpath, 0555);
306fa1
+				if (mkdir_path(fullpath, 0555) && errno != EEXIST) {
306fa1
+					char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
306fa1
+					error(ap->logopt,
306fa1
+					      MODPREFIX "mkdir_path %s failed: %s",
306fa1
+					      fullpath, estr);
306fa1
+				}
306fa1
 			else {
306fa1
 				if (ap->type == LKP_INDIRECT)
306fa1
 					rmdir_path(ap, fullpath, ap->dev);