clitar.c: implement reset mode
authorAurélien Aptel <aurelien.aptel@gmail.com>
Tue, 16 Jul 2013 12:47:29 +0000 (14:47 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 19 Feb 2014 17:22:27 +0000 (18:22 +0100)
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/client/clitar.c

index bda416e157ee9d6ca962dc88adb450cd6383b299..07edfe281f7ce97baf9d20aa07db84319a4697b5 100644 (file)
@@ -471,7 +471,7 @@ int cmd_tarmode(void)
  *
  * Update the file attributes with the one provided.
  */
-static void set_remote_attr(char *filename, uint16 new_attr, int mode)
+static void set_remote_attr(const char *filename, uint16 new_attr, int mode)
 {
     extern struct cli_state *cli;
     uint16 old_attr;
@@ -717,6 +717,10 @@ static int tar_get_file(struct tar *t, const char *full_dos_path,
         goto out;
     }
 
+    if (t->mode.reset) {
+        set_remote_attr(full_dos_path, FILE_ATTRIBUTE_ARCHIVE, ATTR_UNSET);
+    }
+
     full_unix_path = talloc_asprintf(ctx, ".%s", full_dos_path);
     string_replace(full_unix_path, '\\', '/');
     entry = archive_entry_new();