smbclient: Handle ENUM_DIR in "notify" command
authorVolker Lendecke <vl@samba.org>
Mon, 30 Oct 2017 15:15:03 +0000 (16:15 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 5 Apr 2018 02:05:52 +0000 (04:05 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr  5 04:05:52 CEST 2018 on sn-devel-144

source3/client/client.c

index 23ed02d9cc09c7130ba63f7408403bcbe91e8605..1429b44e9cf1a75f5212749ecf123baf83133b02 100644 (file)
@@ -4568,12 +4568,17 @@ static int cmd_notify(void)
        }
 
        while (1) {
-               uint32_t i, num_changes;
-               struct notify_change *changes;
+               uint32_t i;
+               uint32_t num_changes = 0;
+               struct notify_change *changes = NULL;
 
                status = cli_notify(cli, fnum, 1000, FILE_NOTIFY_CHANGE_ALL,
                                    true,
                                    talloc_tos(), &num_changes, &changes);
+               if (NT_STATUS_EQUAL(status, STATUS_NOTIFY_ENUM_DIR)) {
+                       printf("NOTIFY_ENUM_DIR\n");
+                       status = NT_STATUS_OK;
+               }
                if (!NT_STATUS_IS_OK(status)) {
                        d_printf("notify returned %s\n",
                                 nt_errstr(status));