diff options
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r-- | util-linux/mount.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 694057bbe..d954febe5 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -105,22 +105,22 @@ enum { | |||
105 | static const int32_t mount_options[] = { | 105 | static const int32_t mount_options[] = { |
106 | // MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs. | 106 | // MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs. |
107 | 107 | ||
108 | USE_FEATURE_MOUNT_LOOP( | 108 | IF_FEATURE_MOUNT_LOOP( |
109 | /* "loop" */ 0, | 109 | /* "loop" */ 0, |
110 | ) | 110 | ) |
111 | 111 | ||
112 | USE_FEATURE_MOUNT_FSTAB( | 112 | IF_FEATURE_MOUNT_FSTAB( |
113 | /* "defaults" */ 0, | 113 | /* "defaults" */ 0, |
114 | /* "quiet" 0 - do not filter out, vfat wants to see it */ | 114 | /* "quiet" 0 - do not filter out, vfat wants to see it */ |
115 | /* "noauto" */ MOUNT_NOAUTO, | 115 | /* "noauto" */ MOUNT_NOAUTO, |
116 | /* "sw" */ MOUNT_SWAP, | 116 | /* "sw" */ MOUNT_SWAP, |
117 | /* "swap" */ MOUNT_SWAP, | 117 | /* "swap" */ MOUNT_SWAP, |
118 | USE_DESKTOP(/* "user" */ MOUNT_USERS,) | 118 | IF_DESKTOP(/* "user" */ MOUNT_USERS,) |
119 | USE_DESKTOP(/* "users" */ MOUNT_USERS,) | 119 | IF_DESKTOP(/* "users" */ MOUNT_USERS,) |
120 | /* "_netdev" */ 0, | 120 | /* "_netdev" */ 0, |
121 | ) | 121 | ) |
122 | 122 | ||
123 | USE_FEATURE_MOUNT_FLAGS( | 123 | IF_FEATURE_MOUNT_FLAGS( |
124 | // vfs flags | 124 | // vfs flags |
125 | /* "nosuid" */ MS_NOSUID, | 125 | /* "nosuid" */ MS_NOSUID, |
126 | /* "suid" */ ~MS_NOSUID, | 126 | /* "suid" */ ~MS_NOSUID, |
@@ -161,20 +161,20 @@ static const int32_t mount_options[] = { | |||
161 | }; | 161 | }; |
162 | 162 | ||
163 | static const char mount_option_str[] = | 163 | static const char mount_option_str[] = |
164 | USE_FEATURE_MOUNT_LOOP( | 164 | IF_FEATURE_MOUNT_LOOP( |
165 | "loop\0" | 165 | "loop\0" |
166 | ) | 166 | ) |
167 | USE_FEATURE_MOUNT_FSTAB( | 167 | IF_FEATURE_MOUNT_FSTAB( |
168 | "defaults\0" | 168 | "defaults\0" |
169 | // "quiet\0" - do not filter out, vfat wants to see it | 169 | // "quiet\0" - do not filter out, vfat wants to see it |
170 | "noauto\0" | 170 | "noauto\0" |
171 | "sw\0" | 171 | "sw\0" |
172 | "swap\0" | 172 | "swap\0" |
173 | USE_DESKTOP("user\0") | 173 | IF_DESKTOP("user\0") |
174 | USE_DESKTOP("users\0") | 174 | IF_DESKTOP("users\0") |
175 | "_netdev\0" | 175 | "_netdev\0" |
176 | ) | 176 | ) |
177 | USE_FEATURE_MOUNT_FLAGS( | 177 | IF_FEATURE_MOUNT_FLAGS( |
178 | // vfs flags | 178 | // vfs flags |
179 | "nosuid\0" | 179 | "nosuid\0" |
180 | "suid\0" | 180 | "suid\0" |
@@ -1781,9 +1781,9 @@ int mount_main(int argc UNUSED_PARAM, char **argv) | |||
1781 | int i, j, rc = 0; | 1781 | int i, j, rc = 0; |
1782 | unsigned opt; | 1782 | unsigned opt; |
1783 | struct mntent mtpair[2], *mtcur = mtpair; | 1783 | struct mntent mtpair[2], *mtcur = mtpair; |
1784 | SKIP_DESKTOP(const int nonroot = 0;) | 1784 | IF_NOT_DESKTOP(const int nonroot = 0;) |
1785 | 1785 | ||
1786 | USE_DESKTOP(int nonroot = ) sanitize_env_if_suid(); | 1786 | IF_DESKTOP(int nonroot = ) sanitize_env_if_suid(); |
1787 | 1787 | ||
1788 | // Parse long options, like --bind and --move. Note that -o option | 1788 | // Parse long options, like --bind and --move. Note that -o option |
1789 | // and --option are synonymous. Yes, this means --remount,rw works. | 1789 | // and --option are synonymous. Yes, this means --remount,rw works. |
@@ -1797,9 +1797,9 @@ int mount_main(int argc UNUSED_PARAM, char **argv) | |||
1797 | 1797 | ||
1798 | // Parse remaining options | 1798 | // Parse remaining options |
1799 | // Max 2 params; -o is a list, -v is a counter | 1799 | // Max 2 params; -o is a list, -v is a counter |
1800 | opt_complementary = "?2o::" USE_FEATURE_MOUNT_VERBOSE("vv"); | 1800 | opt_complementary = "?2o::" IF_FEATURE_MOUNT_VERBOSE("vv"); |
1801 | opt = getopt32(argv, OPTION_STR, &lst_o, &fstype, &O_optmatch | 1801 | opt = getopt32(argv, OPTION_STR, &lst_o, &fstype, &O_optmatch |
1802 | USE_FEATURE_MOUNT_VERBOSE(, &verbose)); | 1802 | IF_FEATURE_MOUNT_VERBOSE(, &verbose)); |
1803 | while (lst_o) append_mount_options(&cmdopts, llist_pop(&lst_o)); // -o | 1803 | while (lst_o) append_mount_options(&cmdopts, llist_pop(&lst_o)); // -o |
1804 | if (opt & OPT_r) append_mount_options(&cmdopts, "ro"); // -r | 1804 | if (opt & OPT_r) append_mount_options(&cmdopts, "ro"); // -r |
1805 | if (opt & OPT_w) append_mount_options(&cmdopts, "rw"); // -w | 1805 | if (opt & OPT_w) append_mount_options(&cmdopts, "rw"); // -w |