summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-10-20 16:25:19 +0000
committerLuke Leighton <lkcl@samba.org>1997-10-20 16:25:19 +0000
commit77a93855259fe29c8b37575aba5f07dbb70d3510 (patch)
tree9cf50bccc6c8e632ce0536766bc537af5eeaaff2 /source3/lib
parent246cd6003600d160e856c0638da91bbfc64a81e1 (diff)
downloadsamba-77a93855259fe29c8b37575aba5f07dbb70d3510.tar.gz
samba-77a93855259fe29c8b37575aba5f07dbb70d3510.tar.bz2
samba-77a93855259fe29c8b37575aba5f07dbb70d3510.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c28
1 files changed, 28 insertions, 0 deletions
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;
+}