summaryrefslogtreecommitdiff
path: root/source/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
commitc6e37d8db0cd89a84a54a0cedfeacf50fb3f7a4c (patch)
tree80969e56e17b1edb502357622984c5ff834cf892 /source/lib
parent6d67eddcdffd26b0fa7f97ed3fa08ec002566367 (diff)
downloadsamba-c6e37d8db0cd89a84a54a0cedfeacf50fb3f7a4c.tar.gz
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_....
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 9295d9ae73f..ec0f9f0efc9 100644
--- a/source/lib/util.c
+++ b/source/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;
+}