relocate packages on recipes-base/recipes-enigma2/recipes-wlan.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-connectivity / autofs / autofs-4.1.4 / 067_allow_disabling_bind_mounts.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 067_allow_disabling_bind_mounts.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
8 diff -Naur .B/modules/mount_bind.c .A/modules/mount_bind.c
9 --- .B/modules/mount_bind.c     2005-01-10 13:28:29.000000000 +0000
10 +++ .A/modules/mount_bind.c     2007-01-07 21:36:35.000000000 +0000
11 @@ -107,7 +107,7 @@
12         if (options == NULL || *options == '\0')
13                 options = "defaults";
14  
15 -       if (bind_works) {
16 +       if (bind_works && strcmp(options, "symlink") != 0) {
17                 int status, existed = 1;
18  
19                 debug(MODPREFIX "calling mkdir_path %s", fullpath);
20 diff -Naur .B/modules/mount_nfs.c .A/modules/mount_nfs.c
21 --- .B/modules/mount_nfs.c      2007-01-07 21:36:35.000000000 +0000
22 +++ .A/modules/mount_nfs.c      2007-01-07 21:36:35.000000000 +0000
23 @@ -391,7 +391,8 @@
24         char *whatstr;
25         char *nfsoptions = NULL;
26         int local, err;
27 -       int nosymlink = 0;
28 +       int nosymlink = 0;     /* Actually misnamed, should be "nobind" now */
29 +       int symlink = 0;       /* Prefer symlinks to bind mounts? */
30         int ro = 0;            /* Set if mount bind should be read-only */
31  
32         debug(MODPREFIX "root=%s name=%s what=%s, fstype=%s, options=%s",
33 @@ -405,7 +406,10 @@
34         strcpy(whatstr, what);
35  
36         /* Extract "nosymlink" pseudo-option which stops local filesystems
37 -          from being symlinked */
38 +          from being bind mounted, and "symlink" pseudo-option which does not
39 +          do the exact opposite, but rather makes any bind mount into a
40 +          symlink instead. (Both nosymlink and symlink at the same time
41 +          make no sense, of course.) */
42         if (options) {
43                 const char *comma;
44                 char *nfsp;
45 @@ -446,6 +450,8 @@
46  #endif
47                         if (strncmp("nosymlink", cp, end - cp + 1) == 0)
48                                 nosymlink = 1;
49 +                       else if (strncmp("symlink", cp, end - cp + 1) == 0)
50 +                               symlink = 1;
51                         else {
52                                 /* Check for options that also make sense
53                                    with bind mounts */
54 @@ -457,8 +463,8 @@
55                         }
56                 }
57  
58 -               debug(MODPREFIX "nfs options=\"%s\", nosymlink=%d, ro=%d",
59 -                     nfsoptions, nosymlink, ro);
60 +               debug(MODPREFIX "nfs options=\"%s\", nosymlink=%d, symlink=%d, ro=%d",
61 +                     nfsoptions, nosymlink, symlink, ro);
62         }
63  
64         local = 0;
65 @@ -490,7 +496,11 @@
66         if (local) {
67                 /* Local host -- do a "bind" */
68  
69 -               const char *bind_options = ro ? "ro" : "";
70 +               const char *bind_options;
71 +               if (symlink)
72 +                       bind_options = "symlink";
73 +               else
74 +                       bind_options = ro ? "ro" : "";
75  
76                 debug(MODPREFIX "%s is local, doing bind", name);
77