~ubuntu-branches/debian/wheezy/autofs/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/061_multi_parse_fix

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-03-08 01:36:09 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080308013609-cvs4f2ecoyoism02
Tags: 4.1.4+debian-2.1
* Non-maintainer upload.
* High-urgency upload for RC bugfix.
* Add -DLDAP_DEPRECATED to CFLAGS, to fix compatibility with OpenLDAP
  2.4 on 64-bit architectures.  Closes: #463419.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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);