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>
Thu, 10 Mar 2016 05:52:31 +0000 (06:52 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail
source4/librpc/rpc/dcerpc_util.c

index 7f6c124ea94df83b7bcbed8b208c0f9aba373ceb..c15d26354f31ff716e53592727791a28f784e80b 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\(nt4_dc\) # We fail this test currently
 ^samba3.rpc.samr.passwords.lockout.*\(nt4_dc\)$ # We fail this test currently
 ^samba3.rpc.spoolss.printer.addprinter.driver_info_winreg # knownfail or flapping?
index ff3e60ef9bb38cbd0e549c3b7cb6feddd02e4876..9adaa613b9bd1cb24d7ec84933824e6bfebf993a 100644 (file)
@@ -776,6 +776,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;