shadow_copy2: break overly long lines in shadow_copy2_snapshot_to_gmt()

According to coding guidelines.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add comment header describing shadow_copy2_strip_snapshot()

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add header comment explaining have_snapdir()

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add comment block explaining shadow_copy2_find_snapdir()

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add comment block explaining shadow_copy2_insert_string()

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add comment block explaining shadow_copy2_convert()

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add comment explaining the SMB level GMT format pattern

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: introduce config struct and function shadow_copy2_connect()

This moves the parsing of the config to a central place.
So users of configuation don't need to call lp_parm_... all the time.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: introduce the bool "snapdir_absolute" in the config.

Not exposed but to be used internally.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: disable "snapdir:crossmountpoints" if the snapdir is absolute.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: re-add the basedir option.

Disable basedir if it is not an absolute path or if
snapdirseverywhere or crossmountpoints is enabled.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: introduce "shadow:mountpoint" option

Possiblity to explicitly set the share's mount point.
This is useful mainly for debugging and testing purposes.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add rel_connectpath to config.

This is the share root, relative to the basedir.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: add snapshot_basepath to the config.

This is the absolute version of snapdir.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: log resulting config at the end of shadow_copy2_connect()

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: implement disk_free

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: in the classical case, use configured path in shadow_copy2_find_snapdir()

There is no point in searching for snapdir if not in snapdirseverywhere mode.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: make shadow_copy2_find_snapdir() return const char *

instead of char *. This eliminates compiler warnings.
snapdir is a const string in all occasions.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: shadow_copy2_insert_string(): do not prepend a "/" in absolute mode

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
shadow_copy2: factor shadow_copy2_posix_gmt_string() out of shadow_copy2_insert_string()

for re-use..

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>