summaryrefslogtreecommitdiff
path: root/source3/libads/ads_utils.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-10-01 18:26:00 +0000
committerGerald Carter <jerry@samba.org>2002-10-01 18:26:00 +0000
commitf2d1f19a66ebaf9b88d23c0faa2412536cc74cda (patch)
tree781120ed548c3f38de9d40795a426de525e7865b /source3/libads/ads_utils.c
parent2fb5c7c580a3fff3c7d477b65a1c4852af86433b (diff)
downloadsamba-f2d1f19a66ebaf9b88d23c0faa2412536cc74cda.tar.gz
samba-f2d1f19a66ebaf9b88d23c0faa2412536cc74cda.tar.bz2
samba-f2d1f19a66ebaf9b88d23c0faa2412536cc74cda.zip
syncing up with HEAD. Seems to be a lot of differences creeping in
(i ignored the new SAMBA stuff, but the rest of this looks like it should have been merged already). (This used to be commit 3de09e5cf1f667e410ee8b9516a956860ce7290f)
Diffstat (limited to 'source3/libads/ads_utils.c')
-rw-r--r--source3/libads/ads_utils.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/libads/ads_utils.c b/source3/libads/ads_utils.c
index fc8a270021..626c177926 100644
--- a/source3/libads/ads_utils.c
+++ b/source3/libads/ads_utils.c
@@ -3,7 +3,8 @@
ads (active directory) utility library
Copyright (C) Stefan (metze) Metzmacher 2002
-
+ Copyright (C) Andrew Tridgell 2001
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -21,9 +22,6 @@
#include "includes.h"
-#ifdef HAVE_ADS
-
-
/*
translated the ACB_CTRL Flags to UserFlags (userAccountControl)
*/
@@ -168,4 +166,16 @@ uint32 ads_gtype2atype(uint32 gtype)
return atype;
}
-#endif
+/* turn a sAMAccountType into a SID_NAME_USE */
+enum SID_NAME_USE ads_atype_map(uint32 atype)
+{
+ switch (atype & 0xF0000000) {
+ case ATYPE_GLOBAL_GROUP:
+ return SID_NAME_DOM_GRP;
+ case ATYPE_ACCOUNT:
+ return SID_NAME_USER;
+ default:
+ DEBUG(1,("hmm, need to map account type 0x%x\n", atype));
+ }
+ return SID_NAME_UNKNOWN;
+}