svn commit: samba r2793 - in branches/SAMBA_4_0/source/auth: .
tridge at samba.org
tridge at samba.org
Sun Oct 3 06:40:41 GMT 2004
Author: tridge
Date: 2004-10-03 06:40:40 +0000 (Sun, 03 Oct 2004)
New Revision: 2793
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/auth&rev=2793&nolog=1
Log:
fixed the handling of primaryGroupID in auth_sam. There were two bugs,
the first was it didn't pass primaryGroupID as an attributed it
wanted, the second was it didn't cope with primaryGroupID not being
present.
Modified:
branches/SAMBA_4_0/source/auth/auth_sam.c
Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth_sam.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_sam.c 2004-10-03 06:39:19 UTC (rev 2792)
+++ branches/SAMBA_4_0/source/auth/auth_sam.c 2004-10-03 06:40:40 UTC (rev 2793)
@@ -222,6 +222,7 @@
"accountExpires",
"badPwdCount",
"logonCount",
+ "primaryGroupID",
NULL,
};
@@ -333,6 +334,7 @@
struct dom_sid *primary_group_sid;
const char *sidstr;
int i;
+ uint_t rid;
group_ret = samdb_search(sam_ctx,
mem_ctx, NULL, &group_msgs, group_attrs,
@@ -357,8 +359,16 @@
sidstr = ldb_msg_find_string(msgs[0], "objectSid", NULL);
user_sid = dom_sid_parse_talloc(*server_info, sidstr);
primary_group_sid = dom_sid_parse_talloc(*server_info, sidstr);
- primary_group_sid->sub_auths[primary_group_sid->num_auths-1]
- = samdb_result_uint(msgs[0], "primaryGroupID", 0);
+ rid = samdb_result_uint(msgs[0], "primaryGroupID", ~0);
+ if (rid == ~0) {
+ if (group_ret > 0) {
+ primary_group_sid = groupSIDs[0];
+ } else {
+ primary_group_sid = NULL;
+ }
+ } else {
+ primary_group_sid->sub_auths[primary_group_sid->num_auths-1] = rid;
+ }
(*server_info)->user_sid = user_sid;
(*server_info)->primary_group_sid = primary_group_sid;
More information about the samba-cvs
mailing list