testparm: vfs_fruit checks
authorRalph Boehme <slow@samba.org>
Wed, 9 Mar 2016 12:53:09 +0000 (13:53 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 9 Mar 2016 23:08:11 +0000 (00:08 +0100)
- vfs_fruit requires "ea support = yes"

- OS X clients negotiate AAPL on the first tcon, so mixing shares with
  and without fruit will globally disable AAPL if the first tcon is
  without fruit

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/testparm.c

index 5912d18e08581bf66f9f8d2534800cb53e6f2602..e1d66ce68e4749ab2550f76c23cec4e5b10cf7b7 100644 (file)
@@ -345,7 +345,11 @@ static void do_per_share_checks(int s)
 {
        const char **deny_list = lp_hosts_deny(s);
        const char **allow_list = lp_hosts_allow(s);
 {
        const char **deny_list = lp_hosts_deny(s);
        const char **allow_list = lp_hosts_allow(s);
+       const char **vfs_objects = NULL;
        int i;
        int i;
+       static bool uses_fruit;
+       static bool doesnt_use_fruit;
+       static bool fruit_mix_warned;
 
        if(deny_list) {
                for (i=0; deny_list[i]; i++) {
 
        if(deny_list) {
                for (i=0; deny_list[i]; i++) {
@@ -426,6 +430,26 @@ static void do_per_share_checks(int s)
                        "parameter is ignored when using CUPS libraries.\n\n",
                        lp_servicename(talloc_tos(), s));
        }
                        "parameter is ignored when using CUPS libraries.\n\n",
                        lp_servicename(talloc_tos(), s));
        }
+
+       vfs_objects = lp_vfs_objects(s);
+       if (vfs_objects && str_list_check(vfs_objects, "fruit")) {
+               uses_fruit = true;
+               if (!lp_ea_support(s) && !lp_ea_support(-1)) {
+                       fprintf(stderr,
+                               "ERROR: Service \"%s\" uses vfs_fruit, but "
+                               "that requires \"ea support = yes\".\n\n",
+                               lp_servicename(talloc_tos(), s));
+               }
+       } else {
+               doesnt_use_fruit = true;
+       }
+
+       if (uses_fruit && doesnt_use_fruit && !fruit_mix_warned) {
+               fruit_mix_warned = true;
+               fprintf(stderr,
+                       "WARNING: some services use vfs_fruit, others don't. Mounting them "
+                       "in conjunction on OS X clients results in undefined behaviour.\n\n");
+       }
 }
 
  int main(int argc, const char *argv[])
 }
 
  int main(int argc, const char *argv[])