diff options
Diffstat (limited to 'usr/src/uts/common/fs/smbsrv/smb_session.c')
-rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb_session.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb_session.c b/usr/src/uts/common/fs/smbsrv/smb_session.c index 68a597eeed..14971d067e 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_session.c +++ b/usr/src/uts/common/fs/smbsrv/smb_session.c @@ -30,8 +30,8 @@ #include <sys/socketvar.h> #include <sys/sdt.h> #include <smbsrv/netbios.h> -#include <smbsrv/smb_incl.h> -#include <smbsrv/smb_i18n.h> +#include <smbsrv/smb_kproto.h> +#include <smbsrv/string.h> #include <inet/tcp.h> static volatile uint64_t smb_kids; @@ -219,10 +219,9 @@ smb_session_request(struct smb_session *session) char client_name[NETBIOS_NAME_SZ]; struct mbuf_chain mbc; char *names = NULL; - mts_wchar_t *wbuf = NULL; + smb_wchar_t *wbuf = NULL; smb_xprt_t hdr; char *p; - unsigned int cpid = oem_get_smb_cpid(); int rc1, rc2; session->keep_alive = smb_keep_alive; @@ -283,10 +282,10 @@ smb_session_request(struct smb_session *session) * multi-byte format. We also need to strip off any * spaces added as part of the NetBIOS name encoding. */ - wbuf = kmem_alloc((SMB_PI_MAX_HOST * sizeof (mts_wchar_t)), KM_SLEEP); - (void) oemstounicodes(wbuf, client_name, SMB_PI_MAX_HOST, cpid); - (void) mts_wcstombs(session->workstation, wbuf, SMB_PI_MAX_HOST); - kmem_free(wbuf, (SMB_PI_MAX_HOST * sizeof (mts_wchar_t))); + wbuf = kmem_alloc((SMB_PI_MAX_HOST * sizeof (smb_wchar_t)), KM_SLEEP); + (void) oemtoucs(wbuf, client_name, SMB_PI_MAX_HOST, OEM_CPG_850); + (void) smb_wcstombs(session->workstation, wbuf, SMB_PI_MAX_HOST); + kmem_free(wbuf, (SMB_PI_MAX_HOST * sizeof (smb_wchar_t))); if ((p = strchr(session->workstation, ' ')) != 0) *p = '\0'; @@ -1039,8 +1038,8 @@ smb_session_lookup_user(smb_session_t *session, char *domain, char *name) user = smb_llist_head(ulist); while (user) { ASSERT(user->u_magic == SMB_USER_MAGIC); - if (!utf8_strcasecmp(user->u_name, name) && - !utf8_strcasecmp(user->u_domain, domain)) { + if (!smb_strcasecmp(user->u_name, name, 0) && + !smb_strcasecmp(user->u_domain, domain, 0)) { if (smb_user_hold(user)) break; } @@ -1123,14 +1122,14 @@ smb_session_isclient(smb_session_t *sn, const char *client) client += strspn(client, "\\"); - if (utf8_strcasecmp(client, sn->workstation) == 0) + if (smb_strcasecmp(client, sn->workstation, 0) == 0) return (B_TRUE); ipaddr = &sn->ipaddr; if (smb_inet_ntop(ipaddr, buf, SMB_IPSTRLEN(ipaddr->a_family)) == NULL) return (B_FALSE); - if (utf8_strcasecmp(client, buf) == 0) + if (smb_strcasecmp(client, buf, 0) == 0) return (B_TRUE); return (B_FALSE); @@ -1161,13 +1160,12 @@ smb_request_alloc(smb_session_t *session, int req_length) bzero(sr, sizeof (smb_request_t)); mutex_init(&sr->sr_mutex, NULL, MUTEX_DEFAULT, NULL); + smb_srm_init(sr); sr->session = session; sr->sr_server = session->s_server; sr->sr_gmtoff = session->s_server->si_gmtoff; sr->sr_cache = session->s_server->si_cache_request; sr->sr_cfg = &session->s_cfg; - sr->request_storage.forw = &sr->request_storage; - sr->request_storage.back = &sr->request_storage; sr->command.max_bytes = req_length; sr->reply.max_bytes = smb_maxbufsize; sr->sr_req_length = req_length; @@ -1204,8 +1202,7 @@ smb_request_free(smb_request_t *sr) sr->session = NULL; - /* Release any temp storage */ - smbsr_free_malloc_list(&sr->request_storage); + smb_srm_fini(sr); if (sr->sr_request_buf) kmem_free(sr->sr_request_buf, sr->sr_req_length); |