summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-10 00:48:06 +0000
committerTim Potter <tpot@samba.org>2001-05-10 00:48:06 +0000
commit281629ac063d431cc8a9b7975520ee7fa65a5568 (patch)
tree129debd1c50813eac77025a69674b17a3cd3471e
parent9051f1e2c70e5fcfab2068a201509bc9129d20ad (diff)
downloadsamba-281629ac063d431cc8a9b7975520ee7fa65a5568.tar.gz
samba-281629ac063d431cc8a9b7975520ee7fa65a5568.tar.bz2
samba-281629ac063d431cc8a9b7975520ee7fa65a5568.zip
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)
-rw-r--r--source3/lib/util_sid.c13
1 files changed, 13 insertions, 0 deletions
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
@@ -445,6 +445,19 @@ BOOL sid_split_rid(DOM_SID *sid, uint32 *rid)
}
/*****************************************************************
+ 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
*****************************************************************/