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

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