relocate packages on recipes-base/recipes-enigma2/recipes-wlan.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-connectivity / autofs / autofs-4.1.4 / 063_misc_fixes.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 063_misc_fixes.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
8 diff -Naur .B/lib/cache.c .A/lib/cache.c
9 --- .B/lib/cache.c      2005-02-06 06:00:53.000000000 +0000
10 +++ .A/lib/cache.c      2007-01-07 21:36:35.000000000 +0000
11 @@ -337,8 +337,10 @@
12                 if (!path)
13                         return;
14  
15 -               if (is_mounted(_PATH_MOUNTED, path))
16 +               if (is_mounted(_PATH_MOUNTED, path)) {
17 +                       free(path);
18                         continue;
19 +               }
20  
21                 if (me->age < age) {
22                         mapent_hash[i] = me->next;
23 diff -Naur .B/modules/lookup_file.c .A/modules/lookup_file.c
24 --- .B/modules/lookup_file.c    2005-04-06 15:14:23.000000000 +0000
25 +++ .A/modules/lookup_file.c    2007-01-07 21:36:35.000000000 +0000
26 @@ -157,6 +157,10 @@
27                         break;
28  
29                 case st_compare:
30 +                       if (kptr - key > KEY_MAX_LEN) {
31 +                               state = st_badent;
32 +                               break;
33 +                       }
34                         if (ch == '\n')
35                                 state = st_begin;
36                         else if (isspace(ch) && !escape) {
37 diff -Naur .B/modules/parse_sun.c .A/modules/parse_sun.c
38 --- .B/modules/parse_sun.c      2007-01-07 21:36:35.000000000 +0000
39 +++ .A/modules/parse_sun.c      2007-01-07 21:36:35.000000000 +0000
40 @@ -680,6 +680,10 @@
41             "mounting root %s, mountpoint %s, what %s, fstype %s, options %s\n",
42             root, mountpoint, what, fstype, options);
43  
44 +       /* A malformed entry of the form key /xyz will trigger this case */
45 +       if (!what || *what == '\0')
46 +               return 1;
47 +
48         if (!strcmp(fstype, "nfs")) {
49                 rv = mount_nfs->mount_mount(root, mountpoint, strlen(mountpoint),
50                                             what, fstype, options, mount_nfs->context);
51 @@ -695,6 +699,18 @@
52         return rv;
53  }
54  
55 +static int key_exists(struct multi_mnt *list, char *path, int pathlen)
56 +{
57 +       struct multi_mnt *mmptr = list;
58 +
59 +       while (mmptr && pathlen == strlen(mmptr->path)) {
60 +               if (!strncmp(mmptr->path, path, pathlen))
61 +                       return 1;
62 +               mmptr = mmptr->next;
63 +       }
64 +       return 0;
65 +}
66 +
67  /*
68   * Build list of mounts in shortest -> longest order.
69   * Pass in list head and return list head.
70 @@ -725,6 +741,12 @@
71                 mmptr = mmptr->next;
72         }
73  
74 +       /* if a multimount entry has duplicate keys, it is invalid */
75 +       if (key_exists(mmptr, path, plen)) {
76 +               free(new);
77 +               return NULL;
78 +       }
79 +
80         if (old)
81                 old->next = new;
82         new->next = mmptr;