From 281629ac063d431cc8a9b7975520ee7fa65a5568 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 10 May 2001 00:48:06 +0000 Subject: Added sid_peek_rid() function to return the rid of a sid. Saves mucking around with copying a sid to a temporary variable and using sid_split_rid(). (This used to be commit 9ee43d61be1284b72fd04054c44545847c73120f) --- source3/lib/util_sid.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/lib/util_sid.c') diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index de86b956c3..70341507cb 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -444,6 +444,19 @@ BOOL sid_split_rid(DOM_SID *sid, uint32 *rid) return False; } +/***************************************************************** + Return the last rid from the end of a sid +*****************************************************************/ + +BOOL sid_peek_rid(DOM_SID *sid, uint32 *rid) +{ + if (sid->num_auths > 0) { + *rid = sid->sub_auths[sid->num_auths - 1]; + return True; + } + return False; +} + /***************************************************************** Copies a sid *****************************************************************/ -- cgit