]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netcmd: Use correct path for state directory during offline backup
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 26 May 2021 23:47:36 +0000 (11:47 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 11 Jun 2021 07:41:38 +0000 (07:41 +0000)
During the restore process, we use make_smbconf() to create a new
smb.conf file with the default paths. The default location for 'state
directory' is 'state', but we currently rename this directory to
'statedir' on backing up, so it will end up pointing to a non-existent
directory. This commit ensures the names are consistent.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/netcmd/domain_backup.py

index a9c840d3caee35bb4b59a56ac991946cee50c9c4..b5874b305b2ab36b8d927c12e1312b8ecd1ad0ac 100644 (file)
@@ -1077,7 +1077,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
     # Find where a path should go in the fixed backup archive structure.
     def get_arc_path(self, path, conf_paths):
         backup_dirs = {"private": conf_paths.private_dir,
-                       "statedir": conf_paths.state_dir,
+                       "state": conf_paths.state_dir,
                        "etc": os.path.dirname(conf_paths.smbconf)}
         matching_dirs = [(_, p) for (_, p) in backup_dirs.items() if
                          path.startswith(p)]