diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-09-27 12:23:47 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-09-27 12:23:47 +0000 |
commit | 7e4afe538147bf31689f47232d5f2b04830dda1d (patch) | |
tree | 728ba39aa0cd91f0e4e2251f261d8f1d93d5b32e /source3/libads/ads_utils.c | |
parent | dc262e3f39ec41576a586332b01e183b5583d3a6 (diff) | |
download | samba-7e4afe538147bf31689f47232d5f2b04830dda1d.tar.gz samba-7e4afe538147bf31689f47232d5f2b04830dda1d.tar.bz2 samba-7e4afe538147bf31689f47232d5f2b04830dda1d.zip |
Move a number of ADS related functions out into utility libs, so that things
like metze's sam_ads can also use them.
Also add error checking etc to a few more functions.
Andrew Bartlett
(This used to be commit c864edf4fbf8a6c37888a14b861d7c12cf503d4f)
Diffstat (limited to 'source3/libads/ads_utils.c')
-rw-r--r-- | source3/libads/ads_utils.c | 20 |
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; +} |