diff options
| author | Sam Hartman <hartmans@mit.edu> | 2011-09-28 20:55:53 +0000 |
|---|---|---|
| committer | Sam Hartman <hartmans@mit.edu> | 2011-09-28 20:55:53 +0000 |
| commit | 22196688fbdc5c3e196339df665dfc95bae8d5a7 (patch) | |
| tree | 00c93badb8a36190f5864192bb6febe9cac6d7ce /src/ccapi/server | |
| parent | 28a8abe349da047486cbef33cb7c44e48dd4b9b7 (diff) | |
| download | krb5-22196688fbdc5c3e196339df665dfc95bae8d5a7.tar.gz krb5-22196688fbdc5c3e196339df665dfc95bae8d5a7.tar.xz krb5-22196688fbdc5c3e196339df665dfc95bae8d5a7.zip | |
Fix ccapi rpc methods to always pass 8 byte handles instead of sizeof(void*).
ccapi server always stores all 8 bytes, whether compiled as 32 bit or 64 bit.
If 32 bit, client zero-pads handle when sending and truncates when receiving.
Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25265 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi/server')
| -rw-r--r-- | src/ccapi/server/win/ccs_os_server.cpp | 4 | ||||
| -rw-r--r-- | src/ccapi/server/win/ccs_request_proc.c | 6 | ||||
| -rw-r--r-- | src/ccapi/server/win/ccs_win_pipe.c | 8 | ||||
| -rw-r--r-- | src/ccapi/server/win/ccs_win_pipe.h | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/ccapi/server/win/ccs_os_server.cpp b/src/ccapi/server/win/ccs_os_server.cpp index e0695876d..b9c70a912 100644 --- a/src/ccapi/server/win/ccs_os_server.cpp +++ b/src/ccapi/server/win/ccs_os_server.cpp @@ -318,7 +318,7 @@ cc_int32 ccs_os_server_send_reply (ccs_pipe_t in_pipe, cc_int32 err = 0; char* uuid = ccs_win_pipe_getUuid(in_pipe); - HANDLE h = ccs_win_pipe_getHandle(in_pipe); + UINT64 h = ccs_win_pipe_getHandle(in_pipe); if (!err) { err = send_init(uuid); // Sets RPC handle to be used. @@ -619,7 +619,7 @@ RPC_STATUS send_finish() { RPC_STATUS send_connection_reply(ccs_pipe_t in_pipe) { char* uuid = ccs_win_pipe_getUuid (in_pipe); - HANDLE h = ccs_win_pipe_getHandle(in_pipe); + UINT64 h = ccs_win_pipe_getHandle(in_pipe); RPC_STATUS status = send_init(uuid); RpcTryExcept { diff --git a/src/ccapi/server/win/ccs_request_proc.c b/src/ccapi/server/win/ccs_request_proc.c index bdd691e1f..461c441ed 100644 --- a/src/ccapi/server/win/ccs_request_proc.c +++ b/src/ccapi/server/win/ccs_request_proc.c @@ -42,8 +42,8 @@ void ccs_rpc_request( long* return_status ) { /* Return code */ cc_int32 status = 0; - k5_ipc_stream stream; - DWORD* p = (DWORD*)(tspHandle); + k5_ipc_stream stream; + UINT64* p = (UINT64*)(tspHandle); WIN_PIPE* pipe = NULL; #if 0 cci_debug_printf("%s rpcmsg:%d; UUID:<%s> SST:<%s>", __FUNCTION__, rpcmsg, pszUUID, serverStartTime); @@ -70,7 +70,7 @@ void ccs_rpc_connect( const char* pszUUID, /* Data buffer */ long* return_status ) { /* Return code */ - DWORD* p = (DWORD*)(tspHandle); + UINT64* p = (UINT64*)(tspHandle); WIN_PIPE* pipe = ccs_win_pipe_new(pszUUID, *p); #if 0 cci_debug_printf("%s; rpcmsg:%d; UUID: <%s>", __FUNCTION__, rpcmsg, pszUUID); diff --git a/src/ccapi/server/win/ccs_win_pipe.c b/src/ccapi/server/win/ccs_win_pipe.c index 9cbfa9c9a..d23e4448e 100644 --- a/src/ccapi/server/win/ccs_win_pipe.c +++ b/src/ccapi/server/win/ccs_win_pipe.c @@ -33,13 +33,13 @@ /* Ref: struct ccs_win_pipe_t { char* uuid; - HANDLE clientHandle; + UINT64 clientHandle; } */ /* ------------------------------------------------------------------------ */ -struct ccs_win_pipe_t* ccs_win_pipe_new (const char* uuid, const HANDLE h) { +struct ccs_win_pipe_t* ccs_win_pipe_new (const char* uuid, const UINT64 h) { cc_int32 err = ccNoError; struct ccs_win_pipe_t* out_pipe = NULL; @@ -153,9 +153,9 @@ char* ccs_win_pipe_getUuid (const WIN_PIPE* in_pipe) { /* ------------------------------------------------------------------------ */ -HANDLE ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe) { +UINT64 ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe) { - HANDLE result = NULL; + UINT64 result = 0; if (!ccs_win_pipe_valid(in_pipe)) {cci_check_error(ccErrBadParam);} else {result = in_pipe->clientHandle;} diff --git a/src/ccapi/server/win/ccs_win_pipe.h b/src/ccapi/server/win/ccs_win_pipe.h index e5fb837ab..fef999535 100644 --- a/src/ccapi/server/win/ccs_win_pipe.h +++ b/src/ccapi/server/win/ccs_win_pipe.h @@ -44,12 +44,12 @@ struct ccs_win_pipe_t { char* uuid; - HANDLE clientHandle; + UINT64 clientHandle; }; typedef struct ccs_win_pipe_t WIN_PIPE; -struct ccs_win_pipe_t* ccs_win_pipe_new(const char* uuid, const HANDLE h); +struct ccs_win_pipe_t* ccs_win_pipe_new(const char* uuid, const UINT64 h); cc_int32 ccs_win_pipe_release (const WIN_PIPE* io_pipe); @@ -63,6 +63,6 @@ cc_int32 ccs_win_pipe_copy (WIN_PIPE** out_pipe, cc_int32 ccs_win_pipe_valid (const WIN_PIPE* in_pipe); char* ccs_win_pipe_getUuid (const WIN_PIPE* in_pipe); -HANDLE ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe); +UINT64 ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe); #endif // _ccs_win_pipe_h_ |
