s4:librpc/rpc: dcerpc_generic_session_key() should only be available on local transports
authorStefan Metzmacher <metze@samba.org>
Tue, 10 Nov 2015 09:25:10 +0000 (10:25 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 28 Mar 2016 22:41:33 +0000 (00:41 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 5a397216d40ff18fd1c0980cd9b7b7c0a970bbbb)

selftest/knownfail
source4/librpc/rpc/dcerpc_util.c

index 80649c923ca7e5c7ab188b159851acc89e76a453..ff9ea40abdd8c61204ad23ce3e2ebbcd01ecd695 100644 (file)
@@ -86,6 +86,9 @@
 ^samba4.rpc.lsalookup with seal,padcheck
 ^samba4.rpc.lsalookup with validate
 ^samba4.rpc.lsalookup with bigendian
+^samba4.rpc.lsa on ncacn_np with seal # This gives NT_STATUS_LOCAL_USER_SESSION_KEY
+^samba4.rpc.lsa with seal # This gives NT_STATUS_LOCAL_USER_SESSION_KEY
+^samba4.rpc.lsa.secrets.*seal # This gives NT_STATUS_LOCAL_USER_SESSION_KEY
 ^samba4.rpc.netlogon.*.LogonUasLogon
 ^samba4.rpc.netlogon.*.LogonUasLogoff
 ^samba4.rpc.netlogon.*.DatabaseSync
 ^samba3.smb2.replay.replay4
 ^samba3.smb2.lock.*replay
 ^samba3.raw.session.*reauth2 # maybe fix this?
+^samba3.rpc.lsa.secrets.seal # This gives NT_STATUS_LOCAL_USER_SESSION_KEY
 ^samba3.rpc.samr.passwords.badpwdcount.samr.badPwdCount\(s3dc\) # We fail this test currently
 ^samba3.rpc.samr.passwords.lockout.*\(s3dc\)$ # We fail this test currently
 ^samba3.rpc.spoolss.printer.addprinter.driver_info_winreg # knownfail or flapping?
index de960b246be53102a210861fd371a6cf0149ce49..95d600a34231e430effb73335336e0bf9196a6bc 100644 (file)
@@ -760,6 +760,16 @@ _PUBLIC_ NTSTATUS dcerpc_pipe_auth(TALLOC_CTX *mem_ctx,
 NTSTATUS dcerpc_generic_session_key(struct dcecli_connection *c,
                                    DATA_BLOB *session_key)
 {
+       *session_key = data_blob_null;
+
+       if (c != NULL) {
+               if (c->transport.transport != NCALRPC &&
+                   c->transport.transport != NCACN_UNIX_STREAM)
+               {
+                       return NT_STATUS_LOCAL_USER_SESSION_KEY;
+               }
+       }
+
        /* this took quite a few CPU cycles to find ... */
        session_key->data = discard_const_p(unsigned char, "SystemLibraryDTC");
        session_key->length = 16;