]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpcclient: Use struct initializers in cmd_srvsvc_net_file_enum()
authorVolker Lendecke <vl@samba.org>
Wed, 22 Apr 2020 11:21:40 +0000 (13:21 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 6 Aug 2020 13:32:40 +0000 (13:32 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14355

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 8c080f28c37a4ada4f3605123a357666881fa3a0)

source3/rpcclient/cmd_srvsvc.c

index 9c000608463b8a528db5aa329b2beafa821f3a6b..a9de4608fb9b5699ccedd846ae11de1233446856 100644 (file)
@@ -643,9 +643,13 @@ static WERROR cmd_srvsvc_net_file_enum(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         int argc, const char **argv)
 {
-       uint32_t info_level = 3;
-       struct srvsvc_NetFileInfoCtr info_ctr;
-       struct srvsvc_NetFileCtr3 ctr3;
+       struct srvsvc_NetFileCtr3 ctr3 = { 0 };
+       struct srvsvc_NetFileInfoCtr info_ctr = {
+               .level = 3,
+               .ctr = {
+                       .ctr3 = &ctr3,
+               },
+       };
        WERROR result;
        NTSTATUS status;
        uint32_t preferred_len = 0xffff;
@@ -658,14 +662,9 @@ static WERROR cmd_srvsvc_net_file_enum(struct rpc_pipe_client *cli,
                return WERR_OK;
        }
 
-       if (argc == 2)
-               info_level = atoi(argv[1]);
-
-       ZERO_STRUCT(info_ctr);
-       ZERO_STRUCT(ctr3);
-
-       info_ctr.level = info_level;
-       info_ctr.ctr.ctr3 = &ctr3;
+       if (argc == 2) {
+               info_ctr.level = atoi(argv[1]);
+       }
 
        status = dcerpc_srvsvc_NetFileEnum(b, mem_ctx,
                                           cli->desthost,