net: add basic support for sealed RPC connections (using NET_FLAGS_SEAL).
authorGünther Deschner <gd@samba.org>
Tue, 24 Jun 2008 08:34:16 +0000 (10:34 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 24 Jun 2008 21:45:09 +0000 (23:45 +0200)
Guenther

source/utils/net.h
source/utils/net_rpc.c

index aa4f3dbb6d3ddc93e2d760691de1f62fc8b41c42..941172a8c18a3ef1afcd93b6a9b6c3112345493e 100644 (file)
@@ -141,6 +141,8 @@ enum netdom_domain_t { ND_TYPE_NT4, ND_TYPE_AD };
 #define NET_FLAGS_PDC                          0x00000008      /* PDC only */
 #define NET_FLAGS_ANONYMOUS                    0x00000010      /* use an anonymous connection */
 #define NET_FLAGS_NO_PIPE                      0x00000020      /* don't open an RPC pipe */
+#define NET_FLAGS_SIGN                         0x00000040      /* sign RPC connection */
+#define NET_FLAGS_SEAL                         0x00000080      /* seal RPC connection */
 
 /* net share operation modes */
 #define NET_MODE_SHARE_MIGRATE 1
index 19566bdf09cf07e6a9bc5c3843f2d29ab74ccebb..08b68f012a8d4c544f218a60fe0c226eeadd40c5 100644 (file)
@@ -165,7 +165,16 @@ int run_rpc_command(struct net_context *c,
                                return -1;
                        }
                } else {
-                       pipe_hnd = cli_rpc_pipe_open_noauth(cli, pipe_idx, &nt_status);
+                       if (conn_flags & NET_FLAGS_SEAL) {
+                               pipe_hnd = cli_rpc_pipe_open_ntlmssp(cli, pipe_idx,
+                                                                    PIPE_AUTH_LEVEL_PRIVACY,
+                                                                    lp_workgroup(),
+                                                                    c->opt_user_name,
+                                                                    c->opt_password,
+                                                                    &nt_status);
+                       } else {
+                               pipe_hnd = cli_rpc_pipe_open_noauth(cli, pipe_idx, &nt_status);
+                       }
                        if (!pipe_hnd) {
                                DEBUG(0, ("Could not initialise pipe %s. Error was %s\n",
                                        cli_get_pipe_name(pipe_idx),