diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-22 11:31:37 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-22 11:31:37 +0000 |
commit | 2e8cedba6480d0c1f89d3490888cadac769d09ca (patch) | |
tree | 2e974c68a0b9ba107332173766aa9d400aa15abe /source3/lib | |
parent | f20e6f6b261c3976b412845000b3f170f8ad6a9f (diff) | |
download | samba-2e8cedba6480d0c1f89d3490888cadac769d09ca.tar.gz samba-2e8cedba6480d0c1f89d3490888cadac769d09ca.tar.bz2 samba-2e8cedba6480d0c1f89d3490888cadac769d09ca.zip |
loadparm.c :
added "domain other sids" parameter
pipenetlog.c :
using "domain other sids" parameter in SAM Logon response.
using new name_to_rid() function for r_uid and r_gid.
pipentlsa.c :
minor mods to do with new name_to_rid() function.
pipesrvsvc.c :
in the "net share enum" response, allocate some more space for the buffer.
there can be only 32 share entries in the response anyway. this needs
to be dealt with.
pipeutil.c :
modified name_to_rid() function to use new parameters "domain admin users"
and "domain guest users", but will otherwise do unix uid + 1000.
moved make_dom_gids() here.
proto.h:
the usual.
smb.h smbparse.c :
renamed sid_no to sid_rev_num in DOM_SID, and gid to r_gid in DOM_GID.
util.c :
moved make_dom_gids() from here.
created char *unistrn2(uint16* uni_buffer, int max_len)
(This used to be commit ec60e48d7982240b7755d246b2f1e8989467f66f)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 83 |
1 files changed, 20 insertions, 63 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 96c0774e92..93f02785b9 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -4294,6 +4294,26 @@ Return a ascii version of a unicode string Hack alert: uses fixed buffer(s) and only handles ascii strings ********************************************************************/ #define MAXUNI 1024 +char *unistrn2(uint16 *buf, int len) +{ + static char lbufs[8][MAXUNI]; + static int nexti; + char *lbuf = lbufs[nexti]; + char *p; + nexti = (nexti+1)%8; + for (p = lbuf; *buf && p-lbuf < MAXUNI-2 && len >= 0; len--, p++, buf++) + { + *p = *buf; + } + *p = 0; + return lbuf; +} + +/******************************************************************* +Return a ascii version of a unicode string +Hack alert: uses fixed buffer(s) and only handles ascii strings +********************************************************************/ +#define MAXUNI 1024 char *unistr2(uint16 *buf) { static char lbufs[8][MAXUNI]; @@ -4510,66 +4530,3 @@ char *tab_depth(int depth) } -/* array lookup of well-known RID aliases. the purpose of these escapes me.. */ -static struct -{ - uint32 rid; - char *rid_name; - -} rid_lookups[] = -{ - { DOMAIN_ALIAS_RID_ADMINS , "admins" }, - { DOMAIN_ALIAS_RID_USERS , "users" }, - { DOMAIN_ALIAS_RID_GUESTS , "guests" }, - { DOMAIN_ALIAS_RID_POWER_USERS , "power_users" }, - - { DOMAIN_ALIAS_RID_ACCOUNT_OPS , "account_ops" }, - { DOMAIN_ALIAS_RID_SYSTEM_OPS , "system_ops" }, - { DOMAIN_ALIAS_RID_PRINT_OPS , "print_ops" }, - { DOMAIN_ALIAS_RID_BACKUP_OPS , "backup_ops" }, - { DOMAIN_ALIAS_RID_REPLICATOR , "replicator" }, - { 0 , NULL } -}; - -int make_domain_gids(char *gids_str, DOM_GID *gids) -{ - char *ptr; - pstring s2; - int count; - - DEBUG(4,("make_domain_gids: %s\n", gids_str)); - - if (gids_str == NULL || *gids_str == 0) return 0; - - for (count = 0, ptr = gids_str; next_token(&ptr, s2, NULL) && count < LSA_MAX_GROUPS; count++) - { - /* the entries are of the form GID/ATTR, ATTR being optional.*/ - char *attr; - uint32 rid = 0; - int i; - - attr = strchr(s2,'/'); - if (attr) *attr++ = 0; - if (!attr || !*attr) attr = "7"; /* default value for attribute is 7 */ - - /* look up the RID string and see if we can turn it into a rid number */ - for (i = 0; rid_lookups[i].rid_name != NULL; i++) - { - if (strequal(rid_lookups[i].rid_name, s2)) - { - rid = rid_lookups[i].rid; - break; - } - } - - if (rid == 0) rid = atoi(s2); - - gids[count].gid = rid; - gids[count].attr = atoi(attr); - - DEBUG(5,("group id: %d attr: %d\n", gids[count].gid, gids[count].attr)); - } - - return count; -} - |