]> git.pld-linux.org Git - packages/autofs.git/blob - autofs-4.1.4-multi-parse-fix.patch
- use functions
[packages/autofs.git] / autofs-4.1.4-multi-parse-fix.patch
1 diff -Nurp autofs-4.1.4.orig/modules/parse_sun.c autofs-4.1.4/modules/parse_sun.c
2 --- autofs-4.1.4.orig/modules/parse_sun.c       2005-04-05 20:42:42.000000000 +0800
3 +++ autofs-4.1.4/modules/parse_sun.c    2005-04-25 10:00:13.000000000 +0800
4 @@ -766,7 +766,16 @@ static int check_is_multi(const char *ma
5  {
6         const char *p = (char *) mapent;
7         int multi = 0;
8 -       int first_chunk = 0;
9 +       int not_first_chunk = 0;
10 +
11 +       if (!p) {
12 +               crit("check_is_multi: unexpected NULL map entry pointer");
13 +               return 0;
14 +       }
15 +       
16 +       /* If first character is "/" it's a multi-mount */
17 +       if (*p == '/')
18 +               return 1;
19  
20         while (*p) {
21                 p = skipspace(p);
22 @@ -779,7 +788,7 @@ static int check_is_multi(const char *ma
23                  * path that begins with '/' indicates a mutil-mount
24                  * entry.
25                  */
26 -               if (first_chunk) {
27 +               if (not_first_chunk) {
28                         if (*p == '/' || *p == '-') {
29                                 multi = 1;
30                                 break;
31 @@ -796,7 +805,7 @@ static int check_is_multi(const char *ma
32                  * after which it's a multi mount.
33                  */
34                 p += chunklen(p, check_colon(p));
35 -               first_chunk++;
36 +               not_first_chunk++;
37         }
38  
39         return multi;
40 @@ -883,7 +892,12 @@ int parse_mount(const char *root, const 
41                                 return 1;
42                         }
43  
44 -                       path = dequote(p, l = chunklen(p, 0));
45 +                       if (*p != '/') {
46 +                               l = 0;
47 +                               path = dequote("/", 1);
48 +                       } else
49 +                                path = dequote(p, l = chunklen(p, 0));
50 +
51                         if (!path) {
52                                 error(MODPREFIX "out of memory");
53                                 free(myoptions);
This page took 0.028302 seconds and 3 git commands to generate.