]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/utils: Add save and restore config switches (and help output)
authorNoel Power <noel.power@suse.com>
Thu, 11 Aug 2022 14:26:01 +0000 (15:26 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Nov 2023 04:05:34 +0000 (04:05 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/utils/smbcacls.c

index a9d01a1fd9e160a3a2d275624653a794b4ccfe57..93323aa33e9fe3abf394e2327e8d1eec73ad8c0e 100644 (file)
@@ -38,6 +38,8 @@
 static char DIRSEP_CHAR = '\\';
 
 static int inheritance = 0;
+static const char *save_file = NULL;
+static const char *restore_file = NULL;
 static int test_args;
 static int sddl;
 static int query_sec_info = -1;
@@ -1576,6 +1578,26 @@ int main(int argc, char *argv[])
                        .val        = 1,
                        .descrip    = "Supports propagation of inheritable ACE(s) when used in conjunction with add, delete, set or modify",
                },
+               {
+                       .longName   = "save",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &save_file,
+                       .val        = 1,
+                       .descrip    = "stores the DACLs in sddl format of the "
+                                     "specified file or folder for later use "
+                                     "with restore. SACLS, owner or integrity"
+                                     " labels are not stored",
+               },
+               {
+                       .longName   = "restore",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &restore_file,
+                       .val        = 1,
+                       .descrip    = "applies the stored DACLS to files in "
+                                     "directory.",
+               },
                {
                        .longName   = "numeric",
                        .shortName  = 0,