diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-21 18:25:14 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-21 18:25:14 +0000 |
commit | efe9b26a7b08cc9ea02cad32a847f71773a6edc4 (patch) | |
tree | 5a3bc973513848a72ba722b0d8d3e67bd0a8c0fc /source3/lib/util.c | |
parent | 0083afc90e928f2fa55be3936d51474bb97daf2e (diff) | |
download | samba-efe9b26a7b08cc9ea02cad32a847f71773a6edc4.tar.gz samba-efe9b26a7b08cc9ea02cad32a847f71773a6edc4.tar.bz2 samba-efe9b26a7b08cc9ea02cad32a847f71773a6edc4.zip |
loadparm.c :
added "domain admin users" parameter
added "domain guest users" parameter
these two complement the "domain groups" parameter. the "domain groups"
parameter should be for your own groups, and well-known aliases.
util.c :
added ability to do "domain groups = power_users admin_users backup_ops"
which are well-known RID aliases, not well-known RID groups.
pipenetlog.c :
combine the "domain admin users"; "domain guest users" and "domain groups"
parameters to give an array of RID groups to include in the SAM Logon
response.
ipc.c smb.h :
moved REALLOC() into smb.h
added RID #defines.
proto.h:
usual.
(This used to be commit f2554f231d1f59f30224adcc02b2b3ca4c24e0dd)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index ec0f9f0efc..96c0774e92 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -4509,6 +4509,28 @@ char *tab_depth(int depth) return spaces; } + +/* 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; @@ -4523,12 +4545,26 @@ int make_domain_gids(char *gids_str, DOM_GID *gids) { /* 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 */ - gids[count].gid = atoi(s2); + /* 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)); @@ -4536,3 +4572,4 @@ int make_domain_gids(char *gids_str, DOM_GID *gids) return count; } + |