summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-02-23 22:39:54 +0000
committerLuke Leighton <lkcl@samba.org>1999-02-23 22:39:54 +0000
commit1e71ecdcb21f24e70ee5edbbc05de0284fa588f4 (patch)
tree4c00ca048f4400e768c3611a35d77200a5ab1605 /source3/lib
parent5c5f5445384bf1c55ad28ee7c24b2cce14744a80 (diff)
downloadsamba-1e71ecdcb21f24e70ee5edbbc05de0284fa588f4.tar.gz
samba-1e71ecdcb21f24e70ee5edbbc05de0284fa588f4.tar.bz2
samba-1e71ecdcb21f24e70ee5edbbc05de0284fa588f4.zip
added jeremy's new c++-like code for parsing of security descriptors.
(This used to be commit ec1b7000fd88c5a08e438c7033f60e49b9ec44a8)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sid.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index dce398f36f..77997df1e6 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -225,3 +225,23 @@ int sid_size(const DOM_SID *sid)
}
return sid->num_auths * sizeof(uint32) + 8;
}
+
+
+/*****************************************************************
+ Duplicates a sid - mallocs the target.
+*****************************************************************/
+
+DOM_SID *sid_dup(DOM_SID *src)
+{
+ DOM_SID *dst;
+
+ if(!src)
+ return NULL;
+
+ if((dst = malloc(sizeof(DOM_SID))) != NULL) {
+ memset(dst, '\0', sizeof(DOM_SID));
+ sid_copy( dst, src);
+ }
+
+ return dst;
+}