Skip to contentSkip to conversation

mount: chk_mountpoint should only check for execute perms for unpriveleged users

PATCH In review Scott Mayhew 2 participants 2 messages Mar 20, 2014 – Mar 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mount: chk_mountpoint should only check for execute perms for unpriveleged users

Otherwise 'mount -o remount' fails on mounts that have root squashing enabled and world execute perms disabled.

---
 utils/mount/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/mount/utils.c +1 -1
index ede77a8..92662ed 100644
@@ -130,7 +130,7 @@ int chk_mountpoint(const char *mount_point)
 		mount_error(NULL, mount_point, ENOTDIR);
 		return 1;
 	}
-	if (access(mount_point, X_OK) < 0) {
+	if (getuid() != 0 && geteuid() != 0 && access(mount_point, X_OK) < 0) {
 		mount_error(NULL, mount_point, errno);
 		return 1;
 	}
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 4 lines · Scott Mayhew

Otherwise 'mount -o remount' fails on mounts that have root squashing enabled and world execute perms disabled.

Committed...

steved.

Quoted 19 lines
---
 utils/mount/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/mount/utils.c +1 -2
index ede77a8..92662ed 100644
@@ -130,7 +130,7 @@ int chk_mountpoint(const char *mount_point)
 		mount_error(NULL, mount_point, ENOTDIR);
 		return 1;
 	}
-	if (access(mount_point, X_OK) < 0) {
+	if (getuid() != 0 && geteuid() != 0 && access(mount_point, X_OK) < 0) {
 		mount_error(NULL, mount_point, errno);
 		return 1;
 	}
-- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html