smb_sam.c (a0aa776e20803c84edd153d9cb584fd67163aef3) smb_sam.c (bbf6f00c25b6a2bed23c35eac6d62998ecdb338c)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 95 unchanged lines hidden (view full) ---

104 bzero(account, sizeof (smb_account_t));
105
106 if (domain != NULL) {
107 if (!smb_domain_lookup_name(domain, &di) ||
108 (di.di_type != SMB_DOMAIN_LOCAL))
109 return (NT_STATUS_NOT_FOUND);
110
111 /* Only Netbios hostname is accepted */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 95 unchanged lines hidden (view full) ---

104 bzero(account, sizeof (smb_account_t));
105
106 if (domain != NULL) {
107 if (!smb_domain_lookup_name(domain, &di) ||
108 (di.di_type != SMB_DOMAIN_LOCAL))
109 return (NT_STATUS_NOT_FOUND);
110
111 /* Only Netbios hostname is accepted */
112 if (utf8_strcasecmp(domain, di.di_nbname) != 0)
112 if (smb_strcasecmp(domain, di.di_nbname, 0) != 0)
113 return (NT_STATUS_NONE_MAPPED);
114 } else {
115 if (!smb_domain_lookup_type(SMB_DOMAIN_LOCAL, &di))
116 return (NT_STATUS_CANT_ACCESS_DOMAIN_INFO);
117 }
118
113 return (NT_STATUS_NONE_MAPPED);
114 } else {
115 if (!smb_domain_lookup_type(SMB_DOMAIN_LOCAL, &di))
116 return (NT_STATUS_CANT_ACCESS_DOMAIN_INFO);
117 }
118
119 if (utf8_strcasecmp(name, di.di_nbname) == 0) {
119 if (smb_strcasecmp(name, di.di_nbname, 0) == 0) {
120 /* This is the local domain name */
121 account->a_type = SidTypeDomain;
122 account->a_name = strdup("");
123 account->a_domain = strdup(di.di_nbname);
124 account->a_sid = smb_sid_dup(di.di_binsid);
125 account->a_domsid = smb_sid_dup(di.di_binsid);
126 account->a_rid = (uint32_t)-1;
127

--- 341 unchanged lines hidden (view full) ---

469}
470
471static smb_lwka_t *
472smb_lwka_lookup_name(char *name)
473{
474 int i;
475
476 for (i = 0; i < SMB_LWKA_NUM; i++) {
120 /* This is the local domain name */
121 account->a_type = SidTypeDomain;
122 account->a_name = strdup("");
123 account->a_domain = strdup(di.di_nbname);
124 account->a_sid = smb_sid_dup(di.di_binsid);
125 account->a_domsid = smb_sid_dup(di.di_binsid);
126 account->a_rid = (uint32_t)-1;
127

--- 341 unchanged lines hidden (view full) ---

469}
470
471static smb_lwka_t *
472smb_lwka_lookup_name(char *name)
473{
474 int i;
475
476 for (i = 0; i < SMB_LWKA_NUM; i++) {
477 if (utf8_strcasecmp(name, lwka_tbl[i].lwka_name) == 0)
477 if (smb_strcasecmp(name, lwka_tbl[i].lwka_name, 0) == 0)
478 return (&lwka_tbl[i]);
479 }
480
481 return (NULL);
482}
483
484static smb_lwka_t *
485smb_lwka_lookup_sid(smb_sid_t *sid)

--- 15 unchanged lines hidden ---
478 return (&lwka_tbl[i]);
479 }
480
481 return (NULL);
482}
483
484static smb_lwka_t *
485smb_lwka_lookup_sid(smb_sid_t *sid)

--- 15 unchanged lines hidden ---