From 77a93855259fe29c8b37575aba5f07dbb70d3510 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 20 Oct 1997 16:25:19 +0000 Subject: added "domain groups" parameter, allowing you to specify the groups that the user belongs to. it would be nice to know exactly what the domain groups _are_.... (This used to be commit c6e37d8db0cd89a84a54a0cedfeacf50fb3f7a4c) --- source3/lib/util.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 9295d9ae73..ec0f9f0efc 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -4508,3 +4508,31 @@ char *tab_depth(int depth) spaces[depth * 4] = 0; return spaces; } + +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; + + attr = strchr(s2,'/'); + if (attr) *attr++ = 0; + if (!attr || !*attr) attr = "7"; /* default value for attribute is 7 */ + + gids[count].gid = atoi(s2); + gids[count].attr = atoi(attr); + + DEBUG(5,("group id: %d attr: %d\n", gids[count].gid, gids[count].attr)); + } + + return count; +} -- cgit