add base packages..
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-base / autofs / autofs-4.1.4 / 061_multi_parse_fix.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 061_multi_parse_fix.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
8 diff -Naur .B/modules/parse_sun.c .A/modules/parse_sun.c
9 --- .B/modules/parse_sun.c      2005-04-05 12:42:42.000000000 +0000
10 +++ .A/modules/parse_sun.c      2007-01-07 21:36:35.000000000 +0000
11 @@ -766,7 +766,16 @@
12  {
13         const char *p = (char *) mapent;
14         int multi = 0;
15 -       int first_chunk = 0;
16 +       int not_first_chunk = 0;
17 +
18 +       if (!p) {
19 +               crit("check_is_multi: unexpected NULL map entry pointer");
20 +               return 0;
21 +       }
22 +       
23 +       /* If first character is "/" it's a multi-mount */
24 +       if (*p == '/')
25 +               return 1;
26  
27         while (*p) {
28                 p = skipspace(p);
29 @@ -779,7 +788,7 @@
30                  * path that begins with '/' indicates a mutil-mount
31                  * entry.
32                  */
33 -               if (first_chunk) {
34 +               if (not_first_chunk) {
35                         if (*p == '/' || *p == '-') {
36                                 multi = 1;
37                                 break;
38 @@ -796,7 +805,7 @@
39                  * after which it's a multi mount.
40                  */
41                 p += chunklen(p, check_colon(p));
42 -               first_chunk++;
43 +               not_first_chunk++;
44         }
45  
46         return multi;
47 @@ -883,7 +892,12 @@
48                                 return 1;
49                         }
50  
51 -                       path = dequote(p, l = chunklen(p, 0));
52 +                       if (*p != '/') {
53 +                               l = 0;
54 +                               path = dequote("/", 1);
55 +                       } else
56 +                                path = dequote(p, l = chunklen(p, 0));
57 +
58                         if (!path) {
59                                 error(MODPREFIX "out of memory");
60                                 free(myoptions);