s4-smbtorture: remove trailing whitespace in libnet torture tests.
[gd/samba-autobuild/.git] / source4 / torture / libnet / libnet_rpc.c
index f25c1ecc482ebaa5707a0c9d551a91df9edd5488..d30053d79ce511254dab870f6b4ba0f100cfe828 100644 (file)
@@ -1,35 +1,31 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    Test suite for libnet calls.
 
    Copyright (C) Rafal Szczesniak 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "lib/cmdline/popt_common.h"
-#include "auth/credentials/credentials.h"
 #include "libnet/libnet.h"
 #include "libcli/security/security.h"
-#include "librpc/ndr/libndr.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "librpc/gen_ndr/ndr_srvsvc.h"
-#include "librpc/rpc/dcerpc.h"
 #include "torture/rpc/rpc.h"
-#include "torture/torture.h"
 #include "param/param.h"
 
 
@@ -41,11 +37,13 @@ static bool test_connect_service(struct libnet_context *ctx,
                                 bool badcreds, NTSTATUS expected_status)
 {
        NTSTATUS status;
-       struct libnet_RpcConnect connect;
-       connect.level            = level;
-       connect.in.binding       = binding_string;
-       connect.in.name          = hostname;
-       connect.in.dcerpc_iface  = iface;
+       struct libnet_RpcConnect connect_r;
+       ZERO_STRUCT(connect_r);
+
+       connect_r.level            = level;
+       connect_r.in.binding       = binding_string;
+       connect_r.in.name          = hostname;
+       connect_r.in.dcerpc_iface  = iface;
 
        /* if bad credentials are needed, set baduser%badpassword instead
           of default commandline-passed credentials */
@@ -54,12 +52,12 @@ static bool test_connect_service(struct libnet_context *ctx,
                cli_credentials_set_password(ctx->cred, "badpassword", CRED_SPECIFIED);
        }
 
-       status = libnet_RpcConnect(ctx, ctx, &connect);
+       status = libnet_RpcConnect(ctx, ctx, &connect_r);
 
        if (!NT_STATUS_EQUAL(status, expected_status)) {
                d_printf("Connecting to rpc service %s on %s.\n\tFAILED. Expected: %s."
                       "Received: %s\n",
-                      connect.in.dcerpc_iface->name, connect.in.binding, nt_errstr(expected_status),
+                      connect_r.in.dcerpc_iface->name, connect_r.in.binding, nt_errstr(expected_status),
                       nt_errstr(status));
 
                return false;
@@ -68,15 +66,15 @@ static bool test_connect_service(struct libnet_context *ctx,
        d_printf("PASSED. Expected: %s, received: %s\n", nt_errstr(expected_status),
               nt_errstr(status));
 
-       if (connect.level == LIBNET_RPC_CONNECT_DC_INFO && NT_STATUS_IS_OK(status)) {
+       if (connect_r.level == LIBNET_RPC_CONNECT_DC_INFO && NT_STATUS_IS_OK(status)) {
                d_printf("Domain Controller Info:\n");
-               d_printf("\tDomain Name:\t %s\n", connect.out.domain_name);
-               d_printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect.out.domain_sid));
-               d_printf("\tRealm:\t\t %s\n", connect.out.realm);
-               d_printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect.out.guid));
+               d_printf("\tDomain Name:\t %s\n", connect_r.out.domain_name);
+               d_printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect_r.out.domain_sid));
+               d_printf("\tRealm:\t\t %s\n", connect_r.out.realm);
+               d_printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect_r.out.guid));
 
        } else if (!NT_STATUS_IS_OK(status)) {
-               d_printf("Error string: %s\n", connect.out.error_string);
+               d_printf("Error string: %s\n", connect_r.out.error_string);
        }
 
        return true;
@@ -91,7 +89,7 @@ static bool torture_rpc_connect(struct torture_context *torture,
 
        ctx = libnet_context_init(torture->ev, torture->lp_ctx);
        ctx->cred = cmdline_credentials;
-       
+
        d_printf("Testing connection to LSA interface\n");
        if (!test_connect_service(ctx, &ndr_table_lsarpc, bindstr,
                                  hostname, level, false, NT_STATUS_OK)) {
@@ -154,7 +152,7 @@ bool torture_rpc_connect_pdc(struct torture_context *torture)
        NTSTATUS status;
        struct dcerpc_binding *binding;
        const char *domain_name;
-       
+
        status = torture_rpc_binding(torture, &binding);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
@@ -174,7 +172,7 @@ bool torture_rpc_connect_dc(struct torture_context *torture)
        NTSTATUS status;
        struct dcerpc_binding *binding;
        const char *domain_name;
-       
+
        status = torture_rpc_binding(torture, &binding);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
@@ -194,7 +192,7 @@ bool torture_rpc_connect_dc_info(struct torture_context *torture)
        NTSTATUS status;
        struct dcerpc_binding *binding;
        const char *domain_name;
-       
+
        status = torture_rpc_binding(torture, &binding);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
@@ -214,7 +212,7 @@ bool torture_rpc_connect_binding(struct torture_context *torture)
        NTSTATUS status;
        struct dcerpc_binding *binding;
        const char *bindstr;
-       
+
        status = torture_rpc_binding(torture, &binding);
        if (!NT_STATUS_IS_OK(status)) {
                return false;