]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount-util: don't mask away MS_RDONLY twice
authorLennart Poettering <lennart@poettering.net>
Thu, 9 Jan 2020 13:55:15 +0000 (14:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Jan 2020 13:55:15 +0000 (14:55 +0100)
We have the flags mask for that, and if callers really wanted us to mask
this away, then they should pass the correct mask.

src/shared/mount-util.c

index cf500a126be2c08e4f1cc15e50104a72506d141a..935691ce778349eb73c4c2f70ef7064b2c74d71b 100644 (file)
@@ -237,7 +237,6 @@ int bind_remount_recursive_with_mountinfo(
 
                         orig_flags = 0;
                         (void) get_mount_flags(simplified, &orig_flags, table);
-                        orig_flags &= ~MS_RDONLY;
 
                         if (mount(NULL, simplified, NULL, (orig_flags & ~flags_mask)|MS_BIND|MS_REMOUNT|new_flags, NULL) < 0)
                                 return -errno;
@@ -279,7 +278,6 @@ int bind_remount_recursive_with_mountinfo(
                         /* Try to reuse the original flag set */
                         orig_flags = 0;
                         (void) get_mount_flags(x, &orig_flags, table);
-                        orig_flags &= ~MS_RDONLY;
 
                         if (mount(NULL, x, NULL, (orig_flags & ~flags_mask)|MS_BIND|MS_REMOUNT|new_flags, NULL) < 0)
                                 return -errno;