2 * Copyright (c) 2000-2001 Boris Popov
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Boris Popov.
16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #include <sys/cdefs.h>
38 __FBSDID("$FreeBSD$");
40 #include <sys/param.h>
41 #include <sys/systm.h>
42 #include <sys/kernel.h>
43 #include <sys/malloc.h>
47 #include <sys/sysctl.h>
48 #include <sys/socketvar.h>
50 #include <sys/iconv.h>
52 #include <netsmb/smb.h>
53 #include <netsmb/smb_subr.h>
54 #include <netsmb/smb_conn.h>
55 #include <netsmb/smb_tran.h>
56 #include <netsmb/smb_trantcp.h>
58 static struct smb_connobj smb_vclist;
59 static int smb_vcnext = 1; /* next unique id for VC */
61 SYSCTL_NODE(_net, OID_AUTO, smb, CTLFLAG_RW, NULL, "SMB protocol");
63 MALLOC_DEFINE(M_SMBCONN, "smb_conn", "SMB connection");
65 static void smb_co_init(struct smb_connobj *cp, int level, char *ilockname,
67 static void smb_co_done(struct smb_connobj *cp);
68 static int smb_co_lockstatus(struct smb_connobj *cp);
70 static int smb_vc_disconnect(struct smb_vc *vcp);
71 static void smb_vc_free(struct smb_connobj *cp);
72 static void smb_vc_gone(struct smb_connobj *cp, struct smb_cred *scred);
73 static smb_co_free_t smb_share_free;
74 static smb_co_gone_t smb_share_gone;
76 static int smb_sysctl_treedump(SYSCTL_HANDLER_ARGS);
78 SYSCTL_PROC(_net_smb, OID_AUTO, treedump, CTLFLAG_RD | CTLTYPE_OPAQUE,
79 NULL, 0, smb_sysctl_treedump, "S,treedump", "Requester tree");
85 smb_co_init(&smb_vclist, SMBL_SM, "smbsm ilock", "smbsm");
86 smb_co_unlock(&smb_vclist, 0);
94 /* XXX: hold the mutex */
95 if (smb_vclist.co_usecount > 1) {
96 SMBERROR("%d connections still active\n", smb_vclist.co_usecount - 1);
99 lockmgr(&smb_vclist.co_lock, LK_DRAIN, NULL);
100 smb_co_done(&smb_vclist);
105 smb_sm_lockvclist(int flags)
108 return smb_co_lock(&smb_vclist, flags | LK_CANRECURSE);
112 smb_sm_unlockvclist(void)
115 smb_co_unlock(&smb_vclist, LK_RELEASE);
119 smb_sm_lookupint(struct smb_vcspec *vcspec, struct smb_sharespec *shspec,
120 struct smb_cred *scred, struct smb_vc **vcpp)
122 struct smb_connobj *scp;
127 vcspec->shspec = shspec;
130 SMBCO_FOREACH(scp, &smb_vclist) {
131 vcp = (struct smb_vc *)scp;
132 error = smb_vc_lock(vcp, LK_EXCLUSIVE);
136 if ((vcp->obj.co_flags & SMBV_PRIVATE) ||
137 !CONNADDREQ(vcp->vc_paddr, vcspec->sap) ||
138 strcmp(vcp->vc_username, vcspec->username) != 0)
140 if (vcspec->owner != SMBM_ANY_OWNER) {
141 if (vcp->vc_uid != vcspec->owner)
145 if (vcspec->group != SMBM_ANY_GROUP) {
146 if (vcp->vc_grp != vcspec->group)
150 if (vcspec->mode & SMBM_EXACT) {
151 if (!exact || (vcspec->mode & SMBM_MASK) !=
155 if (smb_vc_access(vcp, scred, vcspec->mode) != 0)
159 error = (int)smb_vc_lookupshare(vcp, shspec, scred,
169 smb_vc_unlock(vcp, 0);
179 smb_sm_lookup(struct smb_vcspec *vcspec, struct smb_sharespec *shspec,
180 struct smb_cred *scred, struct smb_vc **vcpp)
183 struct smb_share *ssp = NULL;
188 error = smb_sm_lockvclist(LK_EXCLUSIVE);
191 error = smb_sm_lookupint(vcspec, shspec, scred, vcpp);
192 if (error == 0 || (vcspec->flags & SMBV_CREATE) == 0) {
193 smb_sm_unlockvclist();
196 error = smb_sm_lookupint(vcspec, NULL, scred, &vcp);
198 error = smb_vc_create(vcspec, scred, &vcp);
201 error = smb_vc_connect(vcp, scred);
207 error = smb_share_create(vcp, shspec, scred, &ssp);
210 error = smb_smb_treeconnect(ssp, scred);
214 smb_share_put(ssp, scred);
216 smb_sm_unlockvclist();
220 smb_vc_lock(vcp, LK_EXCLUSIVE);
221 smb_vc_put(vcp, scred);
227 * Common code for connection object
230 smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname)
232 SLIST_INIT(&cp->co_children);
233 smb_sl_init(&cp->co_interlock, ilockname);
234 lockinit(&cp->co_lock, PZERO, lockname, 0, 0);
235 cp->co_level = level;
237 if (smb_co_lock(cp, LK_EXCLUSIVE) != 0)
238 panic("smb_co_init: lock failed");
242 smb_co_done(struct smb_connobj *cp)
244 smb_sl_destroy(&cp->co_interlock);
245 lockmgr(&cp->co_lock, LK_RELEASE, NULL);
246 lockdestroy(&cp->co_lock);
250 smb_co_gone(struct smb_connobj *cp, struct smb_cred *scred)
252 struct smb_connobj *parent;
255 cp->co_gone(cp, scred);
256 parent = cp->co_parent;
258 smb_co_lock(parent, LK_EXCLUSIVE);
259 SLIST_REMOVE(&parent->co_children, cp, smb_connobj, co_next);
260 smb_co_put(parent, scred);
267 smb_co_ref(struct smb_connobj *cp)
276 smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred)
280 if (cp->co_usecount > 1) {
285 if (cp->co_usecount == 0) {
286 SMBERROR("negative use_count for object %d", cp->co_level);
291 cp->co_flags |= SMBO_GONE;
293 lockmgr(&cp->co_lock, LK_DRAIN | LK_INTERLOCK, &cp->co_interlock);
294 smb_co_gone(cp, scred);
298 smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred)
302 if ((flags & LK_INTERLOCK) == 0)
305 error = smb_co_lock(cp, flags | LK_INTERLOCK);
316 smb_co_put(struct smb_connobj *cp, struct smb_cred *scred)
320 if (cp->co_usecount > 1) {
322 } else if (cp->co_usecount == 1) {
324 cp->co_flags |= SMBO_GONE;
326 SMBERROR("negative usecount");
328 lockmgr(&cp->co_lock, LK_RELEASE | LK_INTERLOCK, &cp->co_interlock);
329 if ((cp->co_flags & SMBO_GONE) == 0)
331 lockmgr(&cp->co_lock, LK_DRAIN, NULL);
332 smb_co_gone(cp, scred);
336 smb_co_lockstatus(struct smb_connobj *cp)
338 return lockstatus(&cp->co_lock);
342 smb_co_lock(struct smb_connobj *cp, int flags)
345 if (cp->co_flags & SMBO_GONE)
347 if ((flags & LK_TYPE_MASK) == 0)
348 flags |= LK_EXCLUSIVE;
349 if (smb_co_lockstatus(cp) == LK_EXCLUSIVE &&
350 (flags & LK_CANRECURSE) == 0) {
351 SMBERROR("recursive lock for object %d\n", cp->co_level);
354 return lockmgr(&cp->co_lock, flags, &cp->co_interlock);
358 smb_co_unlock(struct smb_connobj *cp, int flags)
360 (void)lockmgr(&cp->co_lock, flags | LK_RELEASE, &cp->co_interlock);
364 smb_co_addchild(struct smb_connobj *parent, struct smb_connobj *child)
367 KASSERT(smb_co_lockstatus(parent) == LK_EXCLUSIVE,
368 ("smb_co_addchild: parent not locked"));
369 KASSERT(smb_co_lockstatus(child) == LK_EXCLUSIVE,
370 ("smb_co_addchild: child not locked"));
373 SLIST_INSERT_HEAD(&parent->co_children, child, co_next);
374 child->co_parent = parent;
378 * Session implementation
382 smb_vc_create(struct smb_vcspec *vcspec,
383 struct smb_cred *scred, struct smb_vc **vcpp)
386 struct ucred *cred = scred->scr_cred;
387 uid_t uid = vcspec->owner;
388 gid_t gid = vcspec->group;
389 uid_t realuid = cred->cr_uid;
390 char *domain = vcspec->domain;
393 isroot = smb_suser(cred) == 0;
395 * Only superuser can create VCs with different uid and gid
397 if (uid != SMBM_ANY_OWNER && uid != realuid && !isroot)
399 if (gid != SMBM_ANY_GROUP && !groupmember(gid, cred) && !isroot)
402 vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, M_WAITOK);
403 smb_co_init(VCTOCP(vcp), SMBL_VC, "smb_vc ilock", "smb_vc");
404 vcp->obj.co_free = smb_vc_free;
405 vcp->obj.co_gone = smb_vc_gone;
406 vcp->vc_number = smb_vcnext++;
407 vcp->vc_timo = SMB_DEFRQTIMO;
408 vcp->vc_smbuid = SMB_UID_UNKNOWN;
409 vcp->vc_mode = vcspec->rights & SMBM_MASK;
410 vcp->obj.co_flags = vcspec->flags & (SMBV_PRIVATE | SMBV_SINGLESHARE);
411 vcp->vc_tdesc = &smb_tran_nbtcp_desc;
413 vcp->vc_mackey = NULL;
414 vcp->vc_mackeylen = 0;
416 if (uid == SMBM_ANY_OWNER)
418 if (gid == SMBM_ANY_GROUP)
419 gid = cred->cr_groups[0];
423 smb_sl_init(&vcp->vc_stlock, "vcstlock");
426 vcp->vc_paddr = sodupsockaddr(vcspec->sap, M_WAITOK);
427 if (vcp->vc_paddr == NULL)
429 vcp->vc_laddr = sodupsockaddr(vcspec->lap, M_WAITOK);
430 if (vcp->vc_laddr == NULL)
432 vcp->vc_pass = smb_strdup(vcspec->pass);
433 if (vcp->vc_pass == NULL)
435 vcp->vc_domain = smb_strdup((domain && domain[0]) ? domain :
437 if (vcp->vc_domain == NULL)
439 vcp->vc_srvname = smb_strdup(vcspec->srvname);
440 if (vcp->vc_srvname == NULL)
442 vcp->vc_username = smb_strdup(vcspec->username);
443 if (vcp->vc_username == NULL)
445 error = (int)iconv_open("tolower", vcspec->localcs, &vcp->vc_tolower);
448 error = (int)iconv_open("toupper", vcspec->localcs, &vcp->vc_toupper);
451 if (vcspec->servercs[0]) {
452 error = (int)iconv_open(vcspec->servercs, vcspec->localcs,
456 error = (int)iconv_open(vcspec->localcs, vcspec->servercs,
461 error = (int)smb_iod_create(vcp);
465 smb_co_addchild(&smb_vclist, VCTOCP(vcp));
469 smb_vc_put(vcp, scred);
474 smb_vc_free(struct smb_connobj *cp)
476 struct smb_vc *vcp = CPTOVC(cp);
479 smb_iod_destroy(vcp->vc_iod);
480 SMB_STRFREE(vcp->vc_username);
481 SMB_STRFREE(vcp->vc_srvname);
482 SMB_STRFREE(vcp->vc_pass);
483 SMB_STRFREE(vcp->vc_domain);
485 free(vcp->vc_mackey, M_SMBTEMP);
487 free(vcp->vc_paddr, M_SONAME);
489 free(vcp->vc_laddr, M_SONAME);
491 iconv_close(vcp->vc_tolower);
493 iconv_close(vcp->vc_toupper);
495 iconv_close(vcp->vc_tolocal);
496 if (vcp->vc_toserver)
497 iconv_close(vcp->vc_toserver);
498 smb_co_done(VCTOCP(vcp));
499 smb_sl_destroy(&vcp->vc_stlock);
500 free(vcp, M_SMBCONN);
504 * Called when use count of VC dropped to zero.
505 * VC should be locked on enter with LK_DRAIN.
508 smb_vc_gone(struct smb_connobj *cp, struct smb_cred *scred)
510 struct smb_vc *vcp = CPTOVC(cp);
512 smb_vc_disconnect(vcp);
516 smb_vc_ref(struct smb_vc *vcp)
518 smb_co_ref(VCTOCP(vcp));
522 smb_vc_rele(struct smb_vc *vcp, struct smb_cred *scred)
524 smb_co_rele(VCTOCP(vcp), scred);
528 smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred)
530 return smb_co_get(VCTOCP(vcp), flags, scred);
534 smb_vc_put(struct smb_vc *vcp, struct smb_cred *scred)
536 smb_co_put(VCTOCP(vcp), scred);
540 smb_vc_lock(struct smb_vc *vcp, int flags)
542 return smb_co_lock(VCTOCP(vcp), flags);
546 smb_vc_unlock(struct smb_vc *vcp, int flags)
548 smb_co_unlock(VCTOCP(vcp), flags);
552 smb_vc_access(struct smb_vc *vcp, struct smb_cred *scred, mode_t mode)
554 struct ucred *cred = scred->scr_cred;
556 if (smb_suser(cred) == 0 || cred->cr_uid == vcp->vc_uid)
559 if (!groupmember(vcp->vc_grp, cred))
561 return (vcp->vc_mode & mode) == mode ? 0 : EACCES;
565 smb_vc_cmpshare(struct smb_share *ssp, struct smb_sharespec *dp)
569 if (strcmp(ssp->ss_name, dp->name) != 0)
571 if (dp->owner != SMBM_ANY_OWNER) {
572 if (ssp->ss_uid != dp->owner)
576 if (dp->group != SMBM_ANY_GROUP) {
577 if (ssp->ss_grp != dp->group)
582 if (dp->mode & SMBM_EXACT) {
585 return (dp->mode & SMBM_MASK) == ssp->ss_mode ? 0 : 1;
587 if (smb_share_access(ssp, dp->scred, dp->mode) != 0)
593 * Lookup share in the given VC. Share referenced and locked on return.
594 * VC expected to be locked on entry and will be left locked on exit.
597 smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *dp,
598 struct smb_cred *scred, struct smb_share **sspp)
600 struct smb_connobj *scp = NULL;
601 struct smb_share *ssp = NULL;
606 SMBCO_FOREACH(scp, VCTOCP(vcp)) {
607 ssp = (struct smb_share *)scp;
608 error = smb_share_lock(ssp, LK_EXCLUSIVE);
611 if (smb_vc_cmpshare(ssp, dp) == 0)
613 smb_share_unlock(ssp, 0);
625 smb_vc_connect(struct smb_vc *vcp, struct smb_cred *scred)
628 return smb_iod_request(vcp->vc_iod, SMBIOD_EV_CONNECT | SMBIOD_EV_SYNC, NULL);
632 * Destroy VC to server, invalidate shares linked with it.
633 * Transport should be locked on entry.
636 smb_vc_disconnect(struct smb_vc *vcp)
639 smb_iod_request(vcp->vc_iod, SMBIOD_EV_DISCONNECT | SMBIOD_EV_SYNC, NULL);
643 static char smb_emptypass[] = "";
646 smb_vc_getpass(struct smb_vc *vcp)
650 return smb_emptypass;
654 smb_vc_getinfo(struct smb_vc *vcp, struct smb_vc_info *vip)
656 bzero(vip, sizeof(struct smb_vc_info));
657 vip->itype = SMB_INFO_VC;
658 vip->usecount = vcp->obj.co_usecount;
659 vip->uid = vcp->vc_uid;
660 vip->gid = vcp->vc_grp;
661 vip->mode = vcp->vc_mode;
662 vip->flags = vcp->obj.co_flags;
663 vip->sopt = vcp->vc_sopt;
664 vip->iodstate = vcp->vc_iod->iod_state;
665 bzero(&vip->sopt.sv_skey, sizeof(vip->sopt.sv_skey));
666 snprintf(vip->srvname, sizeof(vip->srvname), "%s", vcp->vc_srvname);
667 snprintf(vip->vcname, sizeof(vip->vcname), "%s", vcp->vc_username);
672 smb_vc_nextmid(struct smb_vc *vcp)
676 SMB_CO_LOCK(&vcp->obj);
678 SMB_CO_UNLOCK(&vcp->obj);
683 * Share implementation
686 * Allocate share structure and attach it to the given VC
687 * Connection expected to be locked on entry. Share will be returned
691 smb_share_create(struct smb_vc *vcp, struct smb_sharespec *shspec,
692 struct smb_cred *scred, struct smb_share **sspp)
694 struct smb_share *ssp;
695 struct ucred *cred = scred->scr_cred;
696 uid_t realuid = cred->cr_uid;
697 uid_t uid = shspec->owner;
698 gid_t gid = shspec->group;
701 isroot = smb_suser(cred) == 0;
703 * Only superuser can create shares with different uid and gid
705 if (uid != SMBM_ANY_OWNER && uid != realuid && !isroot)
707 if (gid != SMBM_ANY_GROUP && !groupmember(gid, cred) && !isroot)
709 error = smb_vc_lookupshare(vcp, shspec, scred, &ssp);
711 smb_share_put(ssp, scred);
714 if (uid == SMBM_ANY_OWNER)
716 if (gid == SMBM_ANY_GROUP)
717 gid = cred->cr_groups[0];
718 ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, M_WAITOK);
719 smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss ilock", "smbss");
720 ssp->obj.co_free = smb_share_free;
721 ssp->obj.co_gone = smb_share_gone;
722 smb_sl_init(&ssp->ss_stlock, "ssstlock");
723 ssp->ss_name = smb_strdup(shspec->name);
724 if (shspec->pass && shspec->pass[0])
725 ssp->ss_pass = smb_strdup(shspec->pass);
726 ssp->ss_type = shspec->stype;
727 ssp->ss_tid = SMB_TID_UNKNOWN;
730 ssp->ss_mode = shspec->rights & SMBM_MASK;
731 smb_co_addchild(VCTOCP(vcp), SSTOCP(ssp));
737 smb_share_free(struct smb_connobj *cp)
739 struct smb_share *ssp = CPTOSS(cp);
741 SMB_STRFREE(ssp->ss_name);
742 SMB_STRFREE(ssp->ss_pass);
743 smb_sl_destroy(&ssp->ss_stlock);
744 smb_co_done(SSTOCP(ssp));
745 free(ssp, M_SMBCONN);
749 smb_share_gone(struct smb_connobj *cp, struct smb_cred *scred)
751 struct smb_share *ssp = CPTOSS(cp);
753 smb_smb_treedisconnect(ssp, scred);
757 smb_share_ref(struct smb_share *ssp)
759 smb_co_ref(SSTOCP(ssp));
763 smb_share_rele(struct smb_share *ssp, struct smb_cred *scred)
765 smb_co_rele(SSTOCP(ssp), scred);
769 smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred)
771 return smb_co_get(SSTOCP(ssp), flags, scred);
775 smb_share_put(struct smb_share *ssp, struct smb_cred *scred)
777 smb_co_put(SSTOCP(ssp), scred);
781 smb_share_lock(struct smb_share *ssp, int flags)
783 return smb_co_lock(SSTOCP(ssp), flags);
787 smb_share_unlock(struct smb_share *ssp, int flags)
789 smb_co_unlock(SSTOCP(ssp), flags);
793 smb_share_access(struct smb_share *ssp, struct smb_cred *scred, mode_t mode)
795 struct ucred *cred = scred->scr_cred;
797 if (smb_suser(cred) == 0 || cred->cr_uid == ssp->ss_uid)
800 if (!groupmember(ssp->ss_grp, cred))
802 return (ssp->ss_mode & mode) == mode ? 0 : EACCES;
806 smb_share_invalidate(struct smb_share *ssp)
808 ssp->ss_tid = SMB_TID_UNKNOWN;
812 smb_share_valid(struct smb_share *ssp)
814 return ssp->ss_tid != SMB_TID_UNKNOWN &&
815 ssp->ss_vcgenid == SSTOVC(ssp)->vc_genid;
819 smb_share_getpass(struct smb_share *ssp)
828 return smb_emptypass;
832 smb_share_getinfo(struct smb_share *ssp, struct smb_share_info *sip)
834 bzero(sip, sizeof(struct smb_share_info));
835 sip->itype = SMB_INFO_SHARE;
836 sip->usecount = ssp->obj.co_usecount;
837 sip->tid = ssp->ss_tid;
838 sip->type= ssp->ss_type;
839 sip->uid = ssp->ss_uid;
840 sip->gid = ssp->ss_grp;
841 sip->mode= ssp->ss_mode;
842 sip->flags = ssp->obj.co_flags;
843 snprintf(sip->sname, sizeof(sip->sname), "%s", ssp->ss_name);
848 * Dump an entire tree into sysctl call
851 smb_sysctl_treedump(SYSCTL_HANDLER_ARGS)
853 struct thread *td = req->td;
854 struct smb_cred scred;
855 struct smb_connobj *scp1, *scp2;
857 struct smb_share *ssp;
858 struct smb_vc_info vci;
859 struct smb_share_info ssi;
862 smb_makescred(&scred, td, td->td_ucred);
863 error = sysctl_wire_old_buffer(req, 0);
866 error = smb_sm_lockvclist(LK_SHARED);
869 SMBCO_FOREACH(scp1, &smb_vclist) {
870 vcp = (struct smb_vc *)scp1;
871 error = smb_vc_lock(vcp, LK_SHARED);
874 smb_vc_getinfo(vcp, &vci);
875 error = SYSCTL_OUT(req, &vci, sizeof(struct smb_vc_info));
877 smb_vc_unlock(vcp, 0);
880 SMBCO_FOREACH(scp2, VCTOCP(vcp)) {
881 ssp = (struct smb_share *)scp2;
882 error = smb_share_lock(ssp, LK_SHARED);
887 smb_share_getinfo(ssp, &ssi);
888 smb_share_unlock(ssp, 0);
889 error = SYSCTL_OUT(req, &ssi, sizeof(struct smb_share_info));
893 smb_vc_unlock(vcp, 0);
898 itype = SMB_INFO_NONE;
899 error = SYSCTL_OUT(req, &itype, sizeof(itype));
901 smb_sm_unlockvclist();