summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-11-27 16:38:38 +0100
committerVolker Lendecke <vl@samba.org>2021-12-10 14:02:30 +0000
commit1bab76223cd1b87a96909a66143d02b8b6b5d5f6 (patch)
tree44835151a7e198704897eb364fd63a9a8eadb3ac /librpc
parent530fb4fdfb32d38cc55ed57cc6157bf63df069a7 (diff)
downloadsamba-1bab76223cd1b87a96909a66143d02b8b6b5d5f6.tar.gz
librpc: Add named_pipe_auth_req_info5->transport
This will serve as a check to make sure that in particular a SAMR client is really root. This is for example used in get_user_info_18() handing out a machine password. The unix domain sockets for NCACN_NP can only be contacted by root, the "np\" subdirectory for those sockets is root/root 0700. Connecting to such a socket is done in two situations: First, local real root processes connecting and smbd on behalf of SMB clients connecting to \\pipe\name, smbd does become_root() there. Via the named_pipe_auth_req_info4 smbd hands over the SMB session information that the RPC server blindly trusts. The session information (i.e. the NT token) is heavily influenced by external sources like the KDC. It is highly unlikely that we get a system token via SMB, but who knows, this is information not fully controlled by smbd. This is where this additional field in named_pipe_auth_req_info5 makes a difference: This field is set to NCACN_NP by smbd's code, not directly controlled by the clients. Other clients directly connecting to a socket in "np\" is root anyway (only smbd can do become_root()) and can set this field to NCALRPC. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r--librpc/idl/named_pipe_auth.idl1
1 files changed, 1 insertions, 0 deletions
diff --git a/librpc/idl/named_pipe_auth.idl b/librpc/idl/named_pipe_auth.idl
index bc727d2e538..6f26cceab17 100644
--- a/librpc/idl/named_pipe_auth.idl
+++ b/librpc/idl/named_pipe_auth.idl
@@ -13,6 +13,7 @@ interface named_pipe_auth
const char *NAMED_PIPE_AUTH_MAGIC = "NPAM";
typedef [public] struct {
+ uint8 transport;
[charset(UTF8),string] uint8 *remote_client_name;
[charset(DOS),string] uint8 *remote_client_addr;
uint16 remote_client_port;