]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbclient: Don't give up in allinfo if getting advanced info fails
authorVolker Lendecke <vl@samba.org>
Mon, 21 Aug 2023 08:01:24 +0000 (10:01 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 22 Aug 2023 16:45:31 +0000 (16:45 +0000)
Getting streams might fail, but further down getting reparse info
might succeed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/client/client.c

index 19ff37248c31c5f530c2f640a3abd4e6ab28e53a..1fb3918272b52ed0ee77ae87ec051f349857016b 100644 (file)
@@ -1697,9 +1697,11 @@ static int do_allinfo(const char *name)
        status = cli_qpathinfo_streams(cli, name, talloc_tos(), &num_streams,
                                       &streams);
        if (!NT_STATUS_IS_OK(status)) {
-               d_printf("%s getting streams for %s\n", nt_errstr(status),
-                        name);
-               return false;
+               d_fprintf(stderr,
+                         "%s getting streams for %s\n",
+                         nt_errstr(status),
+                         name);
+               num_streams = 0;
        }
 
        for (i=0; i<num_streams; i++) {
@@ -1765,15 +1767,20 @@ static int do_allinfo(const char *name)
 
        status = cli_shadow_copy_data(talloc_tos(), cli, fnum,
                                      false, &snapshots, &num_snapshots);
-       if (!NT_STATUS_IS_OK(status)) {
-               cli_close(cli, fnum);
-               return 0;
+       if (NT_STATUS_IS_OK(status)) {
+               status = cli_shadow_copy_data(talloc_tos(),
+                                             cli,
+                                             fnum,
+                                             true,
+                                             &snapshots,
+                                             &num_snapshots);
        }
-       status = cli_shadow_copy_data(talloc_tos(), cli, fnum,
-                                     true, &snapshots, &num_snapshots);
        if (!NT_STATUS_IS_OK(status)) {
-               cli_close(cli, fnum);
-               return 0;
+               d_fprintf(stderr,
+                         "%s getting shadow copy data for %s\n",
+                         nt_errstr(status),
+                         name);
+               num_snapshots = 0;
        }
 
        for (j=0; j<num_snapshots; j++) {