diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-07-08 00:40:57 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-07-08 00:40:57 +0000 |
commit | 8dc39c1112487a7c98cd48ebe9742af07fd3e1c6 (patch) | |
tree | 99c9fa900ca0913e209c82d17deb9ab4cc1f0372 /source3/lib | |
parent | d29d29e4a2ecee741bdb3d37be77aeeab48f185f (diff) | |
download | samba-8dc39c1112487a7c98cd48ebe9742af07fd3e1c6.tar.gz samba-8dc39c1112487a7c98cd48ebe9742af07fd3e1c6.tar.bz2 samba-8dc39c1112487a7c98cd48ebe9742af07fd3e1c6.zip |
(this should have been part of the previous commit)
Add a function to display 'sid types' as strings - makes rpcclient outptut
and DEBUG() logs much eaiser to understand.
Move the enum for SID types to smb.h, becouse is really isn't LSA specific any
more.
Andrew Bartlett
(This used to be commit fc9739861104df4ddc93efab3275275307e4fbb9)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_sid.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 7d3bd848ef..3293026c7d 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -43,7 +43,6 @@ DOM_SID global_sid_Network; /* Network rids */ static DOM_SID global_sid_Creator_Owner; /* Creator Owner */ static DOM_SID global_sid_Creator_Group; /* Creator Group */ static DOM_SID global_sid_Anonymous; /* Anonymous login */ -static const DOM_SID *global_sid_everyone = &global_sid_World; /* * An NT compatible anonymous token. @@ -57,6 +56,43 @@ NT_USER_TOKEN anonymous_token = { }; /**************************************************************************** + Lookup string names for SID types. +****************************************************************************/ + +const static struct { + enum SID_NAME_USE sid_type; + char *string; +} sid_name_type[] = { + {SID_NAME_USER, "user"}, + {SID_NAME_DOM_GRP, "domain group"}, + {SID_NAME_DOMAIN, "domain"}, + {SID_NAME_ALIAS, "local group"}, + {SID_NAME_WKN_GRP, "well-known group"}, + {SID_NAME_DELETED, "deleted account"}, + {SID_NAME_INVALID, "invalid account"}, + {SID_NAME_UNKNOWN, "UNKNOWN"}, + + {SID_NAME_USE_NONE, NULL} +}; + +const char *sid_type_lookup(uint32 sid_type) +{ + int i = 0; + + /* Look through list */ + while(sid_name_type[i].sid_type != 0) { + if (sid_name_type[i].sid_type == sid_type) + return sid_name_type[i].string; + i++; + } + + /* Default return */ + return "SID *TYPE* is INVALID"; + +} + + +/**************************************************************************** Creates some useful well known sids ****************************************************************************/ |