summaryrefslogtreecommitdiff
path: root/source3/lib/util_sid.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-29 22:16:31 +0100
committerVolker Lendecke <vl@samba.org>2007-12-29 23:12:51 +0100
commita59280792cab616f5b269960ab68bc44ccc1fd38 (patch)
treea2770e3303c0ca9e788f05d83663acc0c27fcc65 /source3/lib/util_sid.c
parent99bd615a80e8f983d386e260e747db102ec38cf3 (diff)
downloadsamba-a59280792cab616f5b269960ab68bc44ccc1fd38.tar.gz
samba-a59280792cab616f5b269960ab68bc44ccc1fd38.tar.bz2
samba-a59280792cab616f5b269960ab68bc44ccc1fd38.zip
Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid (This used to be commit 8aec5d09ba023413bd8ecbdfbc7d23904df94389)
Diffstat (limited to 'source3/lib/util_sid.c')
-rw-r--r--source3/lib/util_sid.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index 52f65aa77d..222b32ed3a 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -382,7 +382,7 @@ bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid)
{
size_t i;
- if (len < sid_size(sid))
+ if (len < ndr_size_dom_sid(sid, 0))
return False;
SCVAL(outbuf,0,sid->sid_rev_num);
@@ -495,18 +495,6 @@ bool sid_equal(const DOM_SID *sid1, const DOM_SID *sid2)
}
/*****************************************************************
- Calculates size of a sid.
-*****************************************************************/
-
-size_t sid_size(const DOM_SID *sid)
-{
- if (sid == NULL)
- return 0;
-
- return sid->num_auths * sizeof(uint32) + 8;
-}
-
-/*****************************************************************
Returns true if SID is internal (and non-mappable).
*****************************************************************/
@@ -535,7 +523,7 @@ bool non_mappable_sid(DOM_SID *sid)
char *sid_binstring(const DOM_SID *sid)
{
char *buf, *s;
- int len = sid_size(sid);
+ int len = ndr_size_dom_sid(sid, 0);
buf = (char *)SMB_MALLOC(len);
if (!buf)
return NULL;
@@ -553,7 +541,7 @@ char *sid_binstring(const DOM_SID *sid)
char *sid_binstring_hex(const DOM_SID *sid)
{
char *buf, *s;
- int len = sid_size(sid);
+ int len = ndr_size_dom_sid(sid, 0);
buf = (char *)SMB_MALLOC(len);
if (!buf)
return NULL;