1 --- a/src/tcs/rpc/tcstp/rpc_ps.c.orig 2011-03-23 11:01:54.707428173 -0700
2 +++ b/src/tcs/rpc/tcstp/rpc_ps.c 2011-03-23 11:27:00.753845441 -0700
5 #include "rpc_tcstp_tcs.h"
12 +verify_peer(struct tcsd_thread_data *data)
15 + if (getpeerucred(data->sock, &uc)) {
16 + LogError("Failed to get peer credential (%s)",
18 + return TCSERR(TSS_E_TSP_AUTHFAIL);
20 + if (ucred_geteuid(uc) != 0) {
21 + LogError("Unauthorized attempt to modify a system key (%s)",
24 + return TCSERR(TSS_E_TSP_AUTHFAIL);
27 + return (TSS_SUCCESS);
32 tcs_wrap_RegisterKey(struct tcsd_thread_data *data)
38 + if ( (result = verify_peer(data)) != TSS_SUCCESS)
42 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
43 return TCSERR(TSS_E_INTERNAL_ERROR);
45 TCS_CONTEXT_HANDLE hContext;
49 + if ( (result = verify_peer(data)) != TSS_SUCCESS)
53 if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
54 return TCSERR(TSS_E_INTERNAL_ERROR);