vfs_shadow_copy2: check crossmountpoints against snapdirseverywhere
authorUri Simchoni <uri@samba.org>
Tue, 3 Nov 2015 08:42:00 +0000 (10:42 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 21 Jan 2016 10:19:01 +0000 (11:19 +0100)
If crossmountpoints is enabled, verify that snapdirseverywhere is
enabled too, since crossmountpoints has no meaning otherwise.

This obviates the check of crossmountpoints against other config
variables.

Signed-off-by: Uri Simchoni <uri@samba.org>
source3/modules/vfs_shadow_copy2.c

index 7ea7d352b2adc8ab137ffe9368f751ba4e40e8a6..27dbe5197251890ac835af38d18b2af464d701c4 100644 (file)
@@ -1927,6 +1927,11 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
                                                "shadow", "crossmountpoints",
                                                false);
 
+       if (config->crossmountpoints && !config->snapdirseverywhere) {
+               DBG_WARNING("Warning: 'crossmountpoints' depends on "
+                           "'snapdirseverywhere'. Disabling crossmountpoints.\n");
+       }
+
        config->fixinodes = lp_parm_bool(SNUM(handle->conn),
                                         "shadow", "fixinodes",
                                         false);
@@ -2011,12 +2016,6 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
                basedir = NULL;
        }
 
-       if (config->crossmountpoints && basedir != NULL) {
-               DEBUG(1, (__location__ " Warning: 'basedir' is incompatible "
-                         "with 'crossmountpoints'. Disabling basedir.\n"));
-               basedir = NULL;
-       }
-
        if (basedir == NULL) {
                basedir = config->mount_point;
        }