]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
example/winexe: pass struct smb_transports through some more layers
authorStefan Metzmacher <metze@samba.org>
Sun, 6 Apr 2025 17:05:19 +0000 (19:05 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Apr 2025 10:17:30 +0000 (10:17 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
examples/winexe/winexe.c

index 3ea42a87f2d312a30c0da6387779ba7f3fd13936..b09c57c1bf6edd8310d05f88a7b8fc282632b80a 100644 (file)
@@ -282,7 +282,7 @@ static void parse_args(int argc, const char *argv[],
 
 static NTSTATUS winexe_svc_upload(
        const char *hostname,
-       int port,
+       const struct smb_transports *transports,
        const char *service_filename,
        const DATA_BLOB *svc32_exe,
        const DATA_BLOB *svc64_exe,
@@ -293,7 +293,6 @@ static NTSTATUS winexe_svc_upload(
        uint16_t fnum = 0xffff;
        NTSTATUS status;
        const DATA_BLOB *binary = NULL;
-       struct smb_transports ts = smbsock_transports_from_port(port);
 
        status = cli_full_connection_creds(
                talloc_tos(),
@@ -301,7 +300,7 @@ static NTSTATUS winexe_svc_upload(
                NULL,
                hostname,
                NULL,
-               &ts,
+               transports,
                "ADMIN$",
                "?????",
                credentials,
@@ -386,7 +385,7 @@ done:
 static NTSTATUS winexe_svc_install(
        struct cli_state *cli,
        const char *hostname,
-       int port,
+       const struct smb_transports *transports,
        const char *service_name,
        const char *service_filename,
        const DATA_BLOB *svc32_exe,
@@ -601,7 +600,7 @@ static NTSTATUS winexe_svc_install(
        if (need_start) {
                status = winexe_svc_upload(
                        hostname,
-                       port,
+                       transports,
                        service_filename,
                        svc32_exe,
                        svc64_exe,
@@ -1881,7 +1880,7 @@ int main(int argc, char *argv[])
        status = winexe_svc_install(
                cli,
                options.hostname,
-               options.port,
+               &ts,
                service_name,
                service_filename,
                winexesvc32_exe,