Author: akhaldi
Date: Sun Mar 5 20:42:41 2017
New Revision: 74085
URL:
http://svn.reactos.org/svn/reactos?rev=74085&view=rev
Log:
[RPCRT4] Sync with Wine Staging 2.2. CORE-12823
b85c2f7 rpcrt4: Fix some spec file entries.
042b41d rpcrt4: Avoid potential overflow in rpcrt4_protseq_ncacn_np_open_endpoint.
c32cd11 rpcrt4: Acquire new credential handle for each connection.
da05dfd rpcrt4: Store security package name in rpc_server_registered_auth_info.
f8450fa rpcrt4: Handle NULL binding in RpcBindingInqAuthClient{,Ex}.
Modified:
trunk/reactos/dll/win32/rpcrt4/rpc_binding.c
trunk/reactos/dll/win32/rpcrt4/rpc_message.c
trunk/reactos/dll/win32/rpcrt4/rpc_server.c
trunk/reactos/dll/win32/rpcrt4/rpc_transport.c
trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindi…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_binding.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.c [iso-8859-1] Sun Mar 5 20:42:41 2017
@@ -1603,11 +1603,15 @@
RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG
*AuthnSvc,
ULONG *AuthzSvc, ULONG Flags )
{
- RpcBinding *bind = ClientBinding;
+ RpcBinding *bind;
TRACE("%p %p %p %p %p %p 0x%x\n", ClientBinding, Privs, ServerPrincName,
AuthnLevel,
AuthnSvc, AuthzSvc, Flags);
+ if (!ClientBinding) ClientBinding = I_RpcGetCurrentCallHandle();
+ if (!ClientBinding) return RPC_S_INVALID_BINDING;
+
+ bind = ClientBinding;
if (!bind->FromConn) return RPC_S_INVALID_BINDING;
return rpcrt4_conn_inquire_auth_client(bind->FromConn, Privs,
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_messa…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_message.c [iso-8859-1] Sun Mar 5 20:42:41 2017
@@ -1047,7 +1047,10 @@
auth_data_in->auth_type, cred, exp,
max_token, NULL, &conn->AuthInfo);
if (status != RPC_S_OK)
+ {
+ FreeCredentialsHandle(&cred);
return status;
+ }
/* FIXME: should auth_data_in->auth_context_id be checked in the !start
case? */
conn->auth_context_id = auth_data_in->auth_context_id;
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Sun Mar 5 20:42:41 2017
@@ -1287,12 +1287,10 @@
struct rpc_server_registered_auth_info
{
struct list entry;
- TimeStamp exp;
- BOOL cred_acquired;
- CredHandle cred;
+ USHORT auth_type;
+ WCHAR *package_name;
+ WCHAR *principal;
ULONG max_token;
- USHORT auth_type;
- WCHAR *principal;
};
static RPC_STATUS find_security_package(ULONG auth_type, SecPkgInfoW **packages_buf,
SecPkgInfoW **ret)
@@ -1331,36 +1329,22 @@
{
RPC_STATUS status = RPC_S_UNKNOWN_AUTHN_SERVICE;
struct rpc_server_registered_auth_info *auth_info;
+ SECURITY_STATUS sec_status;
EnterCriticalSection(&server_auth_info_cs);
LIST_FOR_EACH_ENTRY(auth_info, &server_registered_auth_info, struct
rpc_server_registered_auth_info, entry)
{
if (auth_info->auth_type == auth_type)
{
- if (!auth_info->cred_acquired)
+ sec_status = AcquireCredentialsHandleW((SEC_WCHAR *)auth_info->principal,
auth_info->package_name,
+ SECPKG_CRED_INBOUND, NULL, NULL, NULL,
NULL,
+ cred, exp);
+ if (sec_status != SEC_E_OK)
{
- SecPkgInfoW *packages, *package;
- SECURITY_STATUS sec_status;
-
- status = find_security_package(auth_info->auth_type, &packages,
&package);
- if (status != RPC_S_OK)
- break;
-
- sec_status = AcquireCredentialsHandleW((SEC_WCHAR
*)auth_info->principal, package->Name,
- SECPKG_CRED_INBOUND, NULL, NULL,
NULL, NULL,
- &auth_info->cred,
&auth_info->exp);
- FreeContextBuffer(packages);
- if (sec_status != SEC_E_OK)
- {
- status = RPC_S_SEC_PKG_ERROR;
- break;
- }
-
- auth_info->cred_acquired = TRUE;
+ status = RPC_S_SEC_PKG_ERROR;
+ break;
}
- *cred = auth_info->cred;
- *exp = auth_info->exp;
*max_token = auth_info->max_token;
status = RPC_S_OK;
break;
@@ -1378,8 +1362,7 @@
EnterCriticalSection(&server_auth_info_cs);
LIST_FOR_EACH_ENTRY_SAFE(auth_info, cursor2, &server_registered_auth_info, struct
rpc_server_registered_auth_info, entry)
{
- if (auth_info->cred_acquired)
- FreeCredentialsHandle(&auth_info->cred);
+ HeapFree(GetProcessHeap(), 0, auth_info->package_name);
HeapFree(GetProcessHeap(), 0, auth_info->principal);
HeapFree(GetProcessHeap(), 0, auth_info);
}
@@ -1415,6 +1398,7 @@
{
struct rpc_server_registered_auth_info *auth_info;
SecPkgInfoW *packages, *package;
+ WCHAR *package_name;
ULONG max_token;
RPC_STATUS status;
@@ -1424,20 +1408,27 @@
if (status != RPC_S_OK)
return status;
+ package_name = RPCRT4_strdupW(package->Name);
max_token = package->cbMaxToken;
FreeContextBuffer(packages);
+ if (!package_name)
+ return RPC_S_OUT_OF_RESOURCES;
auth_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*auth_info));
- if (!auth_info)
+ if (!auth_info) {
+ HeapFree(GetProcessHeap(), 0, package_name);
return RPC_S_OUT_OF_RESOURCES;
+ }
if (ServerPrincName && !(auth_info->principal =
RPCRT4_strdupW(ServerPrincName))) {
+ HeapFree(GetProcessHeap(), 0, package_name);
HeapFree(GetProcessHeap(), 0, auth_info);
return RPC_S_OUT_OF_RESOURCES;
}
+ auth_info->auth_type = AuthnSvc;
+ auth_info->package_name = package_name;
auth_info->max_token = max_token;
- auth_info->auth_type = AuthnSvc;
EnterCriticalSection(&server_auth_info_cs);
list_add_tail(&server_registered_auth_info, &auth_info->entry);
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_trans…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Sun Mar 5 20:42:41 2017
@@ -390,7 +390,7 @@
RPC_STATUS r;
LPSTR pname;
RpcConnection *Connection;
- char generated_endpoint[21];
+ char generated_endpoint[26];
if (!endpoint)
{
Modified: trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpcrt4.sp…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpcrt4.spec [iso-8859-1] Sun Mar 5 20:42:41 2017
@@ -118,9 +118,9 @@
118 stdcall NDRSContextMarshall2(ptr ptr ptr ptr ptr long)
119 stdcall NDRSContextMarshall(ptr ptr ptr)
120 stdcall NDRSContextMarshallEx(ptr ptr ptr ptr)
-121 stdcall NDRSContextUnmarshall2(ptr ptr ptr ptr long)
-122 stdcall NDRSContextUnmarshall(ptr ptr)
-123 stdcall NDRSContextUnmarshallEx(ptr ptr ptr)
+121 stdcall NDRSContextUnmarshall2(ptr ptr long ptr long)
+122 stdcall NDRSContextUnmarshall(ptr long)
+123 stdcall NDRSContextUnmarshallEx(ptr ptr long)
124 stub NDRcopy
125 stdcall NdrAllocate(ptr long)
126 varargs NdrAsyncClientCall(ptr ptr)
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Mar 5 20:42:41 2017
@@ -160,7 +160,7 @@
reactos/dll/win32/resutils # Synced to WineStaging-1.9.11
reactos/dll/win32/riched20 # Synced to WineStaging-1.9.23
reactos/dll/win32/riched32 # Synced to WineStaging-1.9.11
-reactos/dll/win32/rpcrt4 # Synced to WineStaging-1.9.23
+reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.2
reactos/dll/win32/rsabase # Synced to WineStaging-1.9.11
reactos/dll/win32/rsaenh # Synced to WineStaging-1.9.11
reactos/dll/win32/sccbase # Synced to WineStaging-1.9.11