Magellan Linux

Annotation of /trunk/busybox/patches/busybox-1.20.2-do-not-pass-comment_ANYTHING-mount-option-to-kernel.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1856 - (hide annotations) (download)
Thu Jul 26 09:16:24 2012 UTC (11 years, 9 months ago) by niro
File size: 1841 byte(s)
-more upstream patches
1 niro 1856 From 6ebb2b6b242fc4e66100f6ea64101eb75d2071e9 Mon Sep 17 00:00:00 2001
2     From: Denys Vlasenko <vda.linux@googlemail.com>
3     Date: Fri, 22 Jun 2012 13:17:18 +0000
4     Subject: mount: do not pass "comment=ANYTHING" option to kernel. Closes 5240
5    
6     Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
7     ---
8     diff --git a/util-linux/mount.c b/util-linux/mount.c
9     index 95dee18..b6c94d7 100644
10     --- a/util-linux/mount.c
11     +++ b/util-linux/mount.c
12     @@ -218,6 +218,7 @@ static const int32_t mount_options[] = {
13     IF_DESKTOP(/* "user" */ MOUNT_USERS,)
14     IF_DESKTOP(/* "users" */ MOUNT_USERS,)
15     /* "_netdev" */ 0,
16     + IF_DESKTOP(/* "comment" */ 0,) /* systemd uses this in fstab */
17     )
18    
19     IF_FEATURE_MOUNT_FLAGS(
20     @@ -275,6 +276,7 @@ static const char mount_option_str[] =
21     IF_DESKTOP("user\0")
22     IF_DESKTOP("users\0")
23     "_netdev\0"
24     + IF_DESKTOP("comment\0") /* systemd uses this in fstab */
25     )
26     IF_FEATURE_MOUNT_FLAGS(
27     // vfs flags
28     @@ -465,7 +467,11 @@ static unsigned long parse_mount_options(char *options, char **unrecognized)
29     // FIXME: use hasmntopt()
30     // Find this option in mount_options
31     for (i = 0; i < ARRAY_SIZE(mount_options); i++) {
32     - if (strcasecmp(option_str, options) == 0) {
33     + /* We support "option=" match for "comment=" thingy */
34     + unsigned opt_len = strlen(option_str);
35     + if (strncasecmp(option_str, options, opt_len) == 0
36     + && (options[opt_len] == '\0' || options[opt_len] == '=')
37     + ) {
38     unsigned long fl = mount_options[i];
39     if ((long)fl < 0)
40     flags &= fl;
41     @@ -473,7 +479,7 @@ static unsigned long parse_mount_options(char *options, char **unrecognized)
42     flags |= fl;
43     goto found;
44     }
45     - option_str += strlen(option_str) + 1;
46     + option_str += opt_len + 1;
47     }
48     // We did not recognize this option.
49     // If "unrecognized" is not NULL, append option there.
50     --
51     cgit v0.9.0.1-2-gef13