Lines Matching defs:authinfo

119     smb_authinfo_t *authinfo)
126 bzero(authinfo, sizeof (smb_authinfo_t));
129 authinfo->a_usrname = strdup(
132 if (authinfo->a_usrname == NULL)
133 authinfo->a_usrname = strdup(
136 authinfo->a_usrrid = info3->UserId;
137 authinfo->a_grprid = info3->PrimaryGroupId;
138 authinfo->a_grpcnt = info3->GroupCount;
140 if (authinfo->a_grpcnt > 0) {
142 authinfo->a_grpcnt;
144 if ((authinfo->a_grps = calloc(1, size)) != NULL)
145 bcopy(info3->GroupIds, authinfo->a_grps, size);
148 authinfo->a_usersesskey = *sessionkey;
151 authinfo->a_domainname = strdup(
154 if (authinfo->a_domainname == NULL) {
156 authinfo->a_domainname = strdup(authreq->au_edomain);
160 authinfo->a_domainname = strdup(nbdomain);
164 authinfo->a_domainsid = (struct netr_sid *)smb_sid_dup(
166 authinfo->a_sidcnt = info3->SidCount;
168 if (authinfo->a_sidcnt > 0) {
169 if ((authinfo->a_extra_sids = calloc(authinfo->a_sidcnt,
173 for (i = 0; i < authinfo->a_sidcnt; i++) {
174 authinfo->a_extra_sids[i].sid =
178 authinfo->a_extra_sids[i].attributes =
184 valid = smb_authinfo_validate(authinfo);
186 smb_authinfo_free(authinfo);
193 smb_session_key_t *ssnkey, smb_authreq_t *authreq, smb_authinfo_t *authinfo)
198 bzero(authinfo, sizeof (smb_authinfo_t));
201 authinfo))
206 authinfo->a_resgrp_domainsid = (struct netr_sid *)smb_sid_dup(
209 authinfo->a_resgrpcnt = kerb_info->ResourceGroupCount;
211 if (authinfo->a_resgrpcnt > 0) {
213 authinfo->a_resgrpcnt;
215 if ((authinfo->a_resgrps = calloc(1, size)) != NULL)
216 bcopy(kerb_info->ResourceGroupIds, authinfo->a_resgrps,
220 valid = smb_authinfo_validate(authinfo);
222 smb_authinfo_free(authinfo);
228 smb_authinfo_validate(smb_authinfo_t *authinfo)
232 if ((authinfo->a_usrname == NULL) ||
233 (authinfo->a_domainname == NULL) ||
234 (authinfo->a_domainsid == NULL))
237 if ((authinfo->a_grpcnt != 0) &&
238 (authinfo->a_grps == NULL))
241 if (authinfo->a_sidcnt == 0)
244 if (authinfo->a_extra_sids == NULL)
247 for (i = 0; i < authinfo->a_sidcnt; i++) {
248 if (authinfo->a_extra_sids[i].sid == NULL)
252 if (!smb_session_key_valid(&authinfo->a_usersesskey))
255 if ((authinfo->a_resgrpcnt != 0) &&
256 (authinfo->a_resgrps == NULL))
263 smb_authinfo_free(smb_authinfo_t *authinfo)
267 if (authinfo == NULL)
270 free(authinfo->a_usrname);
271 free(authinfo->a_grps);
272 smb_session_key_destroy(&authinfo->a_usersesskey);
273 free(authinfo->a_domainname);
274 free(authinfo->a_domainsid);
276 for (i = 0; i < authinfo->a_sidcnt; i++)
277 free(authinfo->a_extra_sids[i].sid);
279 free(authinfo->a_extra_sids);
280 free(authinfo->a_resgrp_domainsid);
281 free(authinfo->a_resgrps);
282 bzero(authinfo, sizeof (smb_authinfo_t));
291 netr_isadmin(const smb_authinfo_t *authinfo)
296 if (!smb_domain_lookup_sid((smb_sid_t *)authinfo->a_domainsid, &di))
302 if ((authinfo->a_usrrid == DOMAIN_USER_RID_ADMIN) ||
303 (authinfo->a_grprid == DOMAIN_GROUP_RID_ADMINS))
306 for (i = 0; i < authinfo->a_grpcnt; i++)
307 if (authinfo->a_grps[i].rid == DOMAIN_GROUP_RID_ADMINS)
333 netr_logon(smb_authreq_t *authreq, smb_authinfo_t *authinfo)
356 status = netlogon_logon(authreq, authinfo);
909 * If the user is successfully authenticated, the output parameter 'authinfo'
913 netlogon_logon(smb_authreq_t *authreq, smb_authinfo_t *authinfo)
982 &netr_global_info, di.d_dc, authreq, authinfo);
1042 char *server, smb_authreq_t *authreq, smb_authinfo_t *authinfo)
1058 if (authinfo == NULL) {
1172 authinfo))