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