summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_lsa_hnd.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-09-11 22:02:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:51:22 -0500
commit5e1146ab5845169aba57dcd216f88589276e5df8 (patch)
treed82b7eaebe963350ba974378aff5f0e258a8f0f8 /source3/rpc_server/srv_lsa_hnd.c
parent68a2430c526ae4b94ecec9690a64936299808140 (diff)
downloadsamba-5e1146ab5845169aba57dcd216f88589276e5df8.tar.gz
samba-5e1146ab5845169aba57dcd216f88589276e5df8.tar.bz2
samba-5e1146ab5845169aba57dcd216f88589276e5df8.zip
r18404: * swap from POLICY_HND to the struct policy_handle from ndr/misc.h
* move OUR_HANDLE macro to include/rpc_misc.h (This used to be commit 2b37079af2f569df7a58878150a61980c6fe06ee)
Diffstat (limited to 'source3/rpc_server/srv_lsa_hnd.c')
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index 7da87d5b93..88c59ee895 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -103,6 +103,7 @@ BOOL create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void (*free_fn)(void *)
{
static uint32 pol_hnd_low = 0;
static uint32 pol_hnd_high = 0;
+ time_t t = time(NULL);
struct policy *pol;
@@ -127,12 +128,17 @@ BOOL create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void (*free_fn)(void *)
if (pol_hnd_low == 0)
(pol_hnd_high)++;
- SIVAL(&pol->pol_hnd.data1, 0 , 0); /* first bit must be null */
- SIVAL(&pol->pol_hnd.data2, 0 , pol_hnd_low ); /* second bit is incrementing */
- SSVAL(&pol->pol_hnd.data3, 0 , pol_hnd_high); /* second bit is incrementing */
- SSVAL(&pol->pol_hnd.data4, 0 , (pol_hnd_high>>16)); /* second bit is incrementing */
- SIVAL(pol->pol_hnd.data5, 0, time(NULL)); /* something random */
- SIVAL(pol->pol_hnd.data5, 4, sys_getpid()); /* something more random */
+ SIVAL(&pol->pol_hnd.handle_type, 0 , 0); /* first bit must be null */
+ SIVAL(&pol->pol_hnd.uuid.time_low, 0 , pol_hnd_low ); /* second bit is incrementing */
+ SSVAL(&pol->pol_hnd.uuid.time_mid, 0 , pol_hnd_high); /* second bit is incrementing */
+ SSVAL(&pol->pol_hnd.uuid.time_hi_and_version, 0 , (pol_hnd_high>>16)); /* second bit is incrementing */
+
+ /* split the current time into two 16 bit values */
+
+ SSVAL(pol->pol_hnd.uuid.clock_seq, 0, (t>>16)); /* something random */
+ SSVAL(pol->pol_hnd.uuid.node, 0, t); /* something random */
+
+ SIVAL(pol->pol_hnd.uuid.node, 2, sys_getpid()); /* something more random */
DLIST_ADD(p->pipe_handles->Policy, pol);
p->pipe_handles->count++;