2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
32 #include "afs/afsrpc.h"
35 smb_ioctlProc_t *smb_ioctlProcsp[SMB_IOCTL_MAXPROCS];
41 for (i=0; i<SMB_IOCTL_MAXPROCS; i++)
42 smb_ioctlProcsp[i] = NULL;
44 smb_ioctlProcsp[VIOCGETAL] = smb_IoctlGetACL;
45 smb_ioctlProcsp[VIOC_FILE_CELL_NAME] = smb_IoctlGetFileCellName;
46 smb_ioctlProcsp[VIOCSETAL] = smb_IoctlSetACL;
47 smb_ioctlProcsp[VIOC_FLUSHVOLUME] = smb_IoctlFlushVolume;
48 smb_ioctlProcsp[VIOCFLUSH] = smb_IoctlFlushFile;
49 smb_ioctlProcsp[VIOCSETVOLSTAT] = smb_IoctlSetVolumeStatus;
50 smb_ioctlProcsp[VIOCGETVOLSTAT] = smb_IoctlGetVolumeStatus;
51 smb_ioctlProcsp[VIOCWHEREIS] = smb_IoctlWhereIs;
52 smb_ioctlProcsp[VIOC_AFS_STAT_MT_PT] = smb_IoctlStatMountPoint;
53 smb_ioctlProcsp[VIOC_AFS_DELETE_MT_PT] = smb_IoctlDeleteMountPoint;
54 smb_ioctlProcsp[VIOCCKSERV] = smb_IoctlCheckServers;
55 smb_ioctlProcsp[VIOC_GAG] = smb_IoctlGag;
56 smb_ioctlProcsp[VIOCCKBACK] = smb_IoctlCheckVolumes;
57 smb_ioctlProcsp[VIOCSETCACHESIZE] = smb_IoctlSetCacheSize;
58 smb_ioctlProcsp[VIOCGETCACHEPARMS] = smb_IoctlGetCacheParms;
59 smb_ioctlProcsp[VIOCGETCELL] = smb_IoctlGetCell;
60 smb_ioctlProcsp[VIOCNEWCELL] = smb_IoctlNewCell;
61 smb_ioctlProcsp[VIOC_GET_WS_CELL] = smb_IoctlGetWsCell;
62 smb_ioctlProcsp[VIOC_AFS_SYSNAME] = smb_IoctlSysName;
63 smb_ioctlProcsp[VIOC_GETCELLSTATUS] = smb_IoctlGetCellStatus;
64 smb_ioctlProcsp[VIOC_SETCELLSTATUS] = smb_IoctlSetCellStatus;
65 smb_ioctlProcsp[VIOC_SETSPREFS] = smb_IoctlSetSPrefs;
66 smb_ioctlProcsp[VIOC_GETSPREFS] = smb_IoctlGetSPrefs;
67 smb_ioctlProcsp[VIOC_STOREBEHIND] = smb_IoctlStoreBehind;
68 smb_ioctlProcsp[VIOC_AFS_CREATE_MT_PT] = smb_IoctlCreateMountPoint;
69 smb_ioctlProcsp[VIOC_TRACECTL] = smb_IoctlTraceControl;
70 smb_ioctlProcsp[VIOCSETTOK] = smb_IoctlSetToken;
71 smb_ioctlProcsp[VIOCGETTOK] = smb_IoctlGetTokenIter;
72 smb_ioctlProcsp[VIOCNEWGETTOK] = smb_IoctlGetToken;
73 smb_ioctlProcsp[VIOCDELTOK] = smb_IoctlDelToken;
74 smb_ioctlProcsp[VIOCDELALLTOK] = smb_IoctlDelAllToken;
75 smb_ioctlProcsp[VIOC_SYMLINK] = smb_IoctlSymlink;
76 smb_ioctlProcsp[VIOC_LISTSYMLINK] = smb_IoctlListlink;
77 smb_ioctlProcsp[VIOC_DELSYMLINK] = smb_IoctlDeletelink;
78 smb_ioctlProcsp[VIOC_MAKESUBMOUNT] = smb_IoctlMakeSubmount;
79 smb_ioctlProcsp[VIOC_GETRXKCRYPT] = smb_IoctlGetRxkcrypt;
80 smb_ioctlProcsp[VIOC_SETRXKCRYPT] = smb_IoctlSetRxkcrypt;
81 smb_ioctlProcsp[VIOC_ISSYMLINK] = smb_IoctlIslink;
82 smb_ioctlProcsp[VIOC_TRACEMEMDUMP] = smb_IoctlMemoryDump;
83 smb_ioctlProcsp[VIOC_ISSYMLINK] = smb_IoctlIslink;
84 smb_ioctlProcsp[VIOC_FLUSHALL] = smb_IoctlFlushAllVolumes;
85 smb_ioctlProcsp[VIOCGETFID] = smb_IoctlGetFid;
86 smb_ioctlProcsp[VIOCGETOWNER] = smb_IoctlGetOwner;
87 smb_ioctlProcsp[VIOC_RXSTAT_PROC] = smb_IoctlRxStatProcess;
88 smb_ioctlProcsp[VIOC_RXSTAT_PEER] = smb_IoctlRxStatPeer;
89 smb_ioctlProcsp[VIOC_UUIDCTL] = smb_IoctlUUIDControl;
90 smb_ioctlProcsp[VIOC_PATH_AVAILABILITY] = smb_IoctlPathAvailability;
91 smb_ioctlProcsp[VIOC_GETFILETYPE] = smb_IoctlGetFileType;
92 smb_ioctlProcsp[VIOC_VOLSTAT_TEST] = smb_IoctlVolStatTest;
93 smb_ioctlProcsp[VIOC_UNICODECTL] = smb_IoctlUnicodeControl;
94 smb_ioctlProcsp[VIOC_SETOWNER] = smb_IoctlSetOwner;
95 smb_ioctlProcsp[VIOC_SETGROUP] = smb_IoctlSetGroup;
96 smb_ioctlProcsp[VIOCNEWCELL2] = smb_IoctlNewCell2;
97 smb_ioctlProcsp[VIOC_SETUNIXMODE] = smb_IoctlSetUnixMode;
98 smb_ioctlProcsp[VIOC_GETUNIXMODE] = smb_IoctlGetUnixMode;
99 smb_ioctlProcsp[VIOC_SETVERIFYDATA] = smb_IoctlSetVerifyData;
100 smb_ioctlProcsp[VIOC_GETVERIFYDATA] = smb_IoctlGetVerifyData;
103 /* called to make a fid structure into an IOCTL fid structure */
105 smb_SetupIoctlFid(smb_fid_t *fidp, cm_space_t *prefix)
108 cm_space_t *copyPrefix;
110 lock_ObtainMutex(&fidp->mx);
111 fidp->flags |= SMB_FID_IOCTL;
112 fidp->scp = &cm_data.fakeSCache;
113 cm_HoldSCache(fidp->scp);
114 if (fidp->ioctlp == NULL) {
115 iop = malloc(sizeof(*iop));
116 memset(iop, 0, sizeof(*iop));
121 copyPrefix = cm_GetSpace();
122 memcpy(copyPrefix->data, prefix->data, CM_UTILS_SPACESIZE);
123 fidp->ioctlp->prefix = copyPrefix;
125 lock_ReleaseMutex(&fidp->mx);
128 /* called when we receive a read call, does the send of the received data if
129 * this is the first read call. This is the function that actually makes the
130 * call to the ioctl code.
133 smb_IoctlPrepareRead(struct smb_fid *fidp, smb_ioctl_t *ioctlp, cm_user_t *userp, afs_uint32 pflags)
136 smb_ioctlProc_t *procp = NULL;
139 if (ioctlp->ioctl.flags & CM_IOCTLFLAG_DATAIN) {
140 ioctlp->ioctl.flags &= ~CM_IOCTLFLAG_DATAIN;
141 ioctlp->ioctl.flags |= CM_IOCTLFLAG_DATAOUT;
143 /* do the call now, or fail if we didn't get an opcode, or
144 * enough of an opcode.
146 if (ioctlp->ioctl.inCopied < sizeof(afs_int32))
147 return CM_ERROR_INVAL;
148 memcpy(&opcode, ioctlp->ioctl.inDatap, sizeof(afs_int32));
149 ioctlp->ioctl.inDatap += sizeof(afs_int32);
151 osi_Log1(afsd_logp, "smb_IoctlPrepareRead opcode 0x%x", opcode);
152 /* check for opcode out of bounds */
153 if (opcode < 0 || opcode >= SMB_IOCTL_MAXPROCS) {
154 osi_Log0(afsd_logp, "smb_IoctlPrepareRead - invalid opcode");
155 return CM_ERROR_TOOBIG;
158 /* check for no such proc */
159 procp = smb_ioctlProcsp[opcode];
161 osi_Log0(afsd_logp, "smb_IoctlPrepareRead - unassigned opcode");
162 return CM_ERROR_INVAL;
164 /* otherwise, make the call */
165 ioctlp->ioctl.outDatap += sizeof(afs_int32); /* reserve room for return code */
166 code = (*procp)(ioctlp, userp, pflags);
167 osi_Log1(afsd_logp, "smb_IoctlPrepareRead operation returns code 0x%x", code);
169 /* copy in return code */
170 memcpy(ioctlp->ioctl.outAllocp, &code, sizeof(afs_int32));
171 } else if (!(ioctlp->ioctl.flags & CM_IOCTLFLAG_DATAOUT)) {
172 osi_Log0(afsd_logp, "Ioctl invalid state - dataout expected");
173 return CM_ERROR_INVAL;
179 /* called when we receive a write call. If this is the first write call after
180 * a series of reads (or the very first call), then we start a new call.
181 * We also ensure that things are properly initialized for the start of a call.
184 smb_IoctlPrepareWrite(smb_fid_t *fidp, smb_ioctl_t *ioctlp)
186 /* make sure the buffer(s) are allocated */
187 if (!ioctlp->ioctl.inAllocp)
188 ioctlp->ioctl.inAllocp = malloc(SMB_IOCTL_MAXDATA);
189 if (!ioctlp->ioctl.outAllocp)
190 ioctlp->ioctl.outAllocp = malloc(SMB_IOCTL_MAXDATA);
192 /* Fixes fs la problem. We do a StrToOEM later and if this data isn't initialized we get memory issues. */
193 (void) memset(ioctlp->ioctl.inAllocp, 0, SMB_IOCTL_MAXDATA);
194 (void) memset(ioctlp->ioctl.outAllocp, 0, SMB_IOCTL_MAXDATA);
196 /* and make sure that we've reset our state for the new incoming request */
197 if (!(ioctlp->ioctl.flags & CM_IOCTLFLAG_DATAIN)) {
198 ioctlp->ioctl.inCopied = 0;
199 ioctlp->ioctl.outCopied = 0;
200 ioctlp->ioctl.inDatap = ioctlp->ioctl.inAllocp;
201 ioctlp->ioctl.outDatap = ioctlp->ioctl.outAllocp;
202 ioctlp->ioctl.flags |= CM_IOCTLFLAG_DATAIN;
203 ioctlp->ioctl.flags &= ~CM_IOCTLFLAG_DATAOUT;
207 /* called from smb_ReceiveCoreRead when we receive a read on the ioctl fid */
209 smb_IoctlRead(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
213 afs_int32 leftToCopy;
217 cm_user_t *userp = NULL;
222 count = smb_GetSMBParm(inp, 1);
224 /* Get the user and determine if it is the local machine account */
225 smbp = (smb_t *) inp;
226 uidp = smb_FindUID(vcp, smbp->uid, 0);
229 osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
231 osi_LogSaveClientString(afsd_logp, uidp->unp->name));
233 osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
234 uidp->userID, userp);
236 isSystem = smb_userIsLocalSystem(uidp);
237 userp = smb_GetUserFromUID(uidp);
239 osi_Log3(afsd_logp, "smb_IoctlRead uid %d user %x name %s",
241 osi_LogSaveClientString(afsd_logp, uidp->unp->name));
243 osi_Log2(afsd_logp, "smb_IoctlRead uid %d user %x no name",
244 uidp->userID, userp);
246 smb_ReleaseUID(uidp);
248 osi_Log1(afsd_logp, "smb_IoctlRead no uid user %x no name", userp);
249 return CM_ERROR_BADSMB;
253 userp = cm_rootUserp;
258 code = smb_LookupTIDPath(vcp, ((smb_t *)inp)->tid, &iop->tidPathp);
260 cm_ReleaseUser(userp);
261 return CM_ERROR_NOSUCHPATH;
264 /* turn the connection around, if required */
265 code = smb_IoctlPrepareRead(fidp, iop, userp, isSystem ? AFSCALL_FLAG_LOCAL_SYSTEM : 0);
268 cm_ReleaseUser(userp);
272 leftToCopy = (afs_int32)((iop->ioctl.outDatap - iop->ioctl.outAllocp) - iop->ioctl.outCopied);
273 if (leftToCopy < 0) {
274 osi_Log0(afsd_logp, "smb_IoctlRead leftToCopy went negative");
275 cm_ReleaseUser(userp);
276 return CM_ERROR_INVAL;
278 if (count > leftToCopy)
281 /* now set the parms for a read of count bytes */
282 smb_SetSMBParm(outp, 0, count);
283 smb_SetSMBParm(outp, 1, 0);
284 smb_SetSMBParm(outp, 2, 0);
285 smb_SetSMBParm(outp, 3, 0);
286 smb_SetSMBParm(outp, 4, 0);
288 smb_SetSMBDataLength(outp, count+3);
290 op = smb_GetSMBData(outp, NULL);
292 *op++ = (char)(count & 0xff);
293 *op++ = (char)((count >> 8) & 0xff);
295 /* now copy the data into the response packet */
296 memcpy(op, iop->ioctl.outCopied + iop->ioctl.outAllocp, count);
298 /* and adjust the counters */
299 iop->ioctl.outCopied += count;
301 cm_ReleaseUser(userp);
306 /* called from smb_ReceiveCoreWrite when we receive a write call on the IOCTL
310 smb_IoctlWrite(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
316 int inDataBlockCount;
319 count = smb_GetSMBParm(inp, 1);
322 smb_IoctlPrepareWrite(fidp, iop);
324 op = smb_GetSMBData(inp, NULL);
325 op = smb_ParseDataBlock(op, NULL, &inDataBlockCount);
327 if (count + iop->ioctl.inCopied > SMB_IOCTL_MAXDATA) {
328 code = CM_ERROR_TOOBIG;
333 memcpy(iop->ioctl.inDatap + iop->ioctl.inCopied, op, count);
336 iop->ioctl.inCopied += count;
339 /* return # of bytes written */
341 smb_SetSMBParm(outp, 0, count);
342 smb_SetSMBDataLength(outp, 0);
348 /* called from smb_ReceiveV3WriteX when we receive a write call on the IOCTL
352 smb_IoctlV3Write(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
358 int inDataBlockCount;
361 count = smb_GetSMBParm(inp, 10);
364 smb_IoctlPrepareWrite(fidp, iop);
366 op = inp->data + smb_GetSMBParm(inp, 11);
367 inDataBlockCount = count;
369 if (count + iop->ioctl.inCopied > SMB_IOCTL_MAXDATA) {
370 code = CM_ERROR_TOOBIG;
375 memcpy(iop->ioctl.inDatap + iop->ioctl.inCopied, op, count);
378 iop->ioctl.inCopied += count;
381 /* return # of bytes written */
383 smb_SetSMBParm(outp, 2, count);
384 smb_SetSMBParm(outp, 3, 0); /* reserved */
385 smb_SetSMBParm(outp, 4, 0); /* reserved */
386 smb_SetSMBParm(outp, 5, 0); /* reserved */
387 smb_SetSMBDataLength(outp, 0);
394 /* called from V3 read to handle IOCTL descriptor reads */
396 smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
399 unsigned short count;
408 count = smb_GetSMBParm(inp, 5);
410 /* Get the user and determine if it is the local machine account */
411 uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
413 isSystem = smb_userIsLocalSystem(uidp);
414 userp = smb_GetUserFromUID(uidp);
416 osi_Log3(afsd_logp, "smb_IoctlV3Read uid %d user %x name %s",
418 osi_LogSaveClientString(afsd_logp, uidp->unp->name));
420 osi_Log2(afsd_logp, "smb_IoctlV3Read uid %d user %x no name",
421 uidp->userID, userp);
424 osi_Log0(afsd_logp, "smb_IoctlV3Read no uid");
425 return CM_ERROR_BADSMB;
429 userp = cm_rootUserp;
435 code = smb_LookupTIDPath(vcp, ((smb_t *)inp)->tid, &iop->tidPathp);
438 smb_ReleaseUID(uidp);
439 cm_ReleaseUser(userp);
440 return CM_ERROR_NOSUCHPATH;
443 code = smb_IoctlPrepareRead(fidp, iop, userp, isSystem ? AFSCALL_FLAG_LOCAL_SYSTEM : 0);
446 smb_ReleaseUID(uidp);
449 cm_ReleaseUser(userp);
453 leftToCopy = (long)((iop->ioctl.outDatap - iop->ioctl.outAllocp) - iop->ioctl.outCopied);
454 if (leftToCopy < 0) {
455 osi_Log0(afsd_logp, "smb_IoctlV3Read leftToCopy went negative");
456 cm_ReleaseUser(userp);
457 return CM_ERROR_INVAL;
459 if (count > leftToCopy)
460 count = (unsigned short)leftToCopy;
462 /* 0 and 1 are reserved for request chaining, were setup by our caller,
463 * and will be further filled in after we return.
465 smb_SetSMBParm(outp, 2, 0); /* remaining bytes, for pipes */
466 smb_SetSMBParm(outp, 3, 0); /* resvd */
467 smb_SetSMBParm(outp, 4, 0); /* resvd */
468 smb_SetSMBParm(outp, 5, count); /* # of bytes we're going to read */
469 /* fill in #6 when we have all the parameters' space reserved */
470 smb_SetSMBParm(outp, 7, 0); /* resv'd */
471 smb_SetSMBParm(outp, 8, 0); /* resv'd */
472 smb_SetSMBParm(outp, 9, 0); /* resv'd */
473 smb_SetSMBParm(outp, 10, 0); /* resv'd */
474 smb_SetSMBParm(outp, 11, 0); /* reserved */
476 /* get op ptr after putting in the last parm, since otherwise we don't
477 * know where the data really is.
479 op = smb_GetSMBData(outp, NULL);
481 /* now fill in offset from start of SMB header to first data byte (to op) */
482 smb_SetSMBParm(outp, 6, ((int) (op - outp->data)));
484 /* set the packet data length the count of the # of bytes */
485 smb_SetSMBDataLength(outp, count);
487 /* now copy the data into the response packet */
488 memcpy(op, iop->ioctl.outCopied + iop->ioctl.outAllocp, count);
490 /* and adjust the counters */
491 iop->ioctl.outCopied += count;
493 /* and cleanup things */
494 cm_ReleaseUser(userp);
499 /* called from Read Raw to handle IOCTL descriptor reads */
501 smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp,
514 /* Get the user and determine if it is the local machine account */
515 uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
517 isSystem = smb_userIsLocalSystem(uidp);
518 userp = smb_GetUserFromUID(uidp);
520 osi_Log3(afsd_logp, "smb_IoctlRawRead uid %d user %x name %s",
522 osi_LogSaveClientString(afsd_logp, uidp->unp->name));
524 osi_Log2(afsd_logp, "smb_IoctlRawRead uid %d user %x no name",
525 uidp->userID, userp);
527 smb_ReleaseUID(uidp);
529 osi_Log0(afsd_logp, "smb_IoctlRawRead no uid");
533 userp = cm_rootUserp;
537 code = smb_LookupTIDPath(vcp, ((smb_t *)inp)->tid, &iop->tidPathp);
539 code = CM_ERROR_NOSUCHPATH;
543 code = smb_IoctlPrepareRead(fidp, iop, userp, isSystem ? AFSCALL_FLAG_LOCAL_SYSTEM : 0);
548 leftToCopy = (long)((iop->ioctl.outDatap - iop->ioctl.outAllocp) - iop->ioctl.outCopied);
549 if (leftToCopy < 0) {
550 osi_Log0(afsd_logp, "smb_IoctlReadRaw leftToCopy went negative");
551 code = CM_ERROR_INVAL;
556 memset(ncbp, 0, sizeof(NCB));
558 ncbp->ncb_length = (unsigned short) leftToCopy;
559 ncbp->ncb_lsn = (unsigned char) vcp->lsn;
560 ncbp->ncb_command = NCBSEND;
561 /*ncbp->ncb_lana_num = smb_LANadapter;*/
562 ncbp->ncb_lana_num = vcp->lana;
564 ncbp->ncb_buffer = iop->ioctl.outCopied + iop->ioctl.outAllocp;
565 code = Netbios(ncbp);
568 osi_Log1(afsd_logp, "ReadRaw send failure code %d", code);
571 cm_ReleaseUser(userp);
576 /* parse the passed-in file name and do a namei on it. If we fail,
577 * return an error code, otherwise return the vnode located in *scpp.
579 #define CM_PARSE_FLAG_LITERAL 1
582 smb_ParseIoctlPath(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
583 cm_scache_t **scpp, afs_uint32 flags)
586 cm_scache_t *substRootp = NULL;
587 cm_scache_t *iscp = NULL;
589 clientchar_t *relativePath = NULL;
590 clientchar_t *lastComponent = NULL;
591 afs_uint32 follow = (flags & CM_PARSE_FLAG_LITERAL ? CM_FLAG_NOMOUNTCHASE : CM_FLAG_FOLLOW);
593 inPath = ioctlp->ioctl.inDatap;
594 /* setup the next data value for the caller to use */
595 ioctlp->ioctl.inDatap += (long)strlen(ioctlp->ioctl.inDatap) + 1;
597 osi_Log1(afsd_logp, "cm_ParseIoctlPath %s", osi_LogSaveString(afsd_logp,inPath));
599 /* This is usually the file name, but for StatMountPoint it is the path. */
600 /* ioctlp->ioctl.inDatap can be either of the form:
603 * \\netbios-name\submount\path\.
604 * \\netbios-name\submount\path\file
607 /* We do not perform path name translation on the ioctl path data
608 * because these paths were not translated by Windows through the
609 * file system API. Therefore, they are not OEM characters but
610 * whatever the display character set is.
613 // TranslateExtendedChars(relativePath);
615 /* This is usually nothing, but for StatMountPoint it is the file name. */
616 // TranslateExtendedChars(ioctlp->ioctl.inDatap);
618 /* If the string starts with our UTF-8 prefix (which is the
619 sequence [ESC,'%','G'] as used by ISO-2022 to designate UTF-8
620 strings), we assume that the provided path is UTF-8. Otherwise
621 we have to convert the string to UTF-8, since that is what we
622 want to use everywhere else.*/
624 if (memcmp(inPath, utf8_prefix, utf8_prefix_size) == 0) {
625 /* String is UTF-8 */
626 inPath += utf8_prefix_size;
627 ioctlp->ioctl.flags |= CM_IOCTLFLAG_USEUTF8;
629 relativePath = cm_Utf8ToClientStringAlloc(inPath, -1, NULL);
633 /* Not a UTF-8 string */
634 /* TODO: If this is an OEM string, we should convert it to
636 if (smb_StoreAnsiFilenames) {
637 cch = cm_AnsiToClientString(inPath, -1, NULL, 0);
641 relativePath = malloc(cch * sizeof(clientchar_t));
642 cm_AnsiToClientString(inPath, -1, relativePath, cch);
644 TranslateExtendedChars(inPath);
646 cch = cm_OemToClientString(inPath, -1, NULL, 0);
650 relativePath = malloc(cch * sizeof(clientchar_t));
651 cm_OemToClientString(inPath, -1, relativePath, cch);
655 if (relativePath[0] == relativePath[1] &&
656 relativePath[1] == '\\' &&
657 !cm_ClientStrCmpNI(cm_NetbiosNameC, relativePath+2,
658 (int)cm_ClientStrLen(cm_NetbiosNameC)))
660 clientchar_t shareName[256];
661 clientchar_t *sharePath;
664 /* We may have found a UNC path.
665 * If the first component is the NetbiosName,
666 * then throw out the second component (the submount)
667 * since it had better expand into the value of ioctl->tidPathp
670 p = relativePath + 2 + cm_ClientStrLen(cm_NetbiosNameC) + 1; /* buffer overflow vuln.? */
671 if ( !cm_ClientStrCmpNI(_C("all"), p, 3) )
674 for (i = 0; *p && *p != '\\'; i++,p++ ) {
677 p++; /* skip past trailing slash */
678 shareName[i] = 0; /* terminate string */
680 shareFound = smb_FindShare(ioctlp->fidp->vcp, ioctlp->uidp, shareName, &sharePath);
682 /* we found a sharename, therefore use the resulting path */
683 code = cm_NameI(cm_RootSCachep(userp, reqp), ioctlp->prefix->wdata,
684 CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
685 userp, sharePath, reqp, &substRootp);
688 osi_Log1(afsd_logp,"cm_ParseIoctlPath [1] code 0x%x", code);
694 lastComponent = cm_ClientStrRChr(p, '\\');
695 if (lastComponent && (lastComponent - p) > 1 &&
696 cm_ClientStrLen(lastComponent) > 1) {
697 *lastComponent = '\0';
700 code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
701 userp, NULL, reqp, &iscp);
703 code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | follow,
704 userp, NULL, reqp, scpp);
706 cm_ReleaseSCache(iscp);
708 code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD,
709 userp, NULL, reqp, scpp);
711 cm_ReleaseSCache(substRootp);
713 osi_Log1(afsd_logp,"cm_ParseIoctlPath [2] code 0x%x", code);
719 /* otherwise, treat the name as a cellname mounted off the afs root.
720 * This requires that we reconstruct the shareName string with
721 * leading and trailing slashes.
723 p = relativePath + 2 + cm_ClientStrLen(cm_NetbiosNameC) + 1;
724 if ( !cm_ClientStrCmpNI(_C("all"), p, 3) )
728 for (i = 1; *p && *p != '\\'; i++,p++ ) {
731 p++; /* skip past trailing slash */
732 shareName[i++] = '/'; /* add trailing slash */
733 shareName[i] = 0; /* terminate string */
736 code = cm_NameI(cm_RootSCachep(userp, reqp), ioctlp->prefix->wdata,
737 CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
738 userp, shareName, reqp, &substRootp);
740 osi_Log1(afsd_logp,"cm_ParseIoctlPath [3] code 0x%x", code);
746 lastComponent = cm_ClientStrRChr(p, '\\');
747 if (lastComponent && (lastComponent - p) > 1 &&
748 cm_ClientStrLen(lastComponent) > 1) {
749 *lastComponent = '\0';
752 code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
753 userp, NULL, reqp, &iscp);
755 code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | follow,
756 userp, NULL, reqp, scpp);
758 cm_ReleaseSCache(iscp);
760 code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD,
761 userp, NULL, reqp, scpp);
765 cm_ReleaseSCache(substRootp);
766 osi_Log1(afsd_logp,"cm_ParseIoctlPath code [4] 0x%x", code);
773 code = cm_NameI(cm_RootSCachep(userp, reqp), ioctlp->prefix->wdata,
774 CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
775 userp, ioctlp->tidPathp, reqp, &substRootp);
777 osi_Log1(afsd_logp,"cm_ParseIoctlPath [6] code 0x%x", code);
783 lastComponent = cm_ClientStrRChr(relativePath, '\\');
784 if (lastComponent && (lastComponent - relativePath) > 1 &&
785 cm_ClientStrLen(lastComponent) > 1) {
786 *lastComponent = '\0';
789 code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
790 userp, NULL, reqp, &iscp);
792 code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | follow,
793 userp, NULL, reqp, scpp);
795 cm_ReleaseSCache(iscp);
797 code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD | follow,
798 userp, NULL, reqp, scpp);
801 cm_ReleaseSCache(substRootp);
802 osi_Log1(afsd_logp,"cm_ParseIoctlPath [7] code 0x%x", code);
810 cm_ReleaseSCache(substRootp);
815 /* Ensure that the status object is up to date */
816 lock_ObtainWrite(&(*scpp)->rw);
817 code = cm_SyncOp( *scpp, NULL, userp, reqp, 0,
818 CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
820 cm_SyncOpDone( *scpp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
821 lock_ReleaseWrite(&(*scpp)->rw);
823 /* and return success */
824 osi_Log1(afsd_logp,"cm_ParseIoctlPath [8] code 0x%x", code);
830 #define LEAF_SIZE 256
831 /* parse the passed-in file name and do a namei on its parent. If we fail,
832 * return an error code, otherwise return the vnode located in *scpp.
835 smb_ParseIoctlParent(smb_ioctl_t *ioctlp, cm_user_t *userp, cm_req_t *reqp,
836 cm_scache_t **scpp, clientchar_t *leafp)
839 clientchar_t tbuffer[1024];
840 clientchar_t *tp, *jp;
841 cm_scache_t *substRootp = NULL;
842 clientchar_t *inpathp = NULL;
845 inpathdatap = ioctlp->ioctl.inDatap;
847 /* If the string starts with our UTF-8 prefix (which is the
848 sequence [ESC,'%','G'] as used by ISO-2022 to designate UTF-8
849 strings), we assume that the provided path is UTF-8. Otherwise
850 we have to convert the string to UTF-8, since that is what we
851 want to use everywhere else.*/
853 if (memcmp(inpathdatap, utf8_prefix, utf8_prefix_size) == 0) {
855 /* String is UTF-8 */
856 inpathdatap += utf8_prefix_size;
857 ioctlp->ioctl.flags |= CM_IOCTLFLAG_USEUTF8;
859 inpathp = cm_Utf8ToClientStringAlloc(inpathdatap, -1, NULL);
863 /* Not a UTF-8 string */
864 /* TODO: If this is an OEM string, we should convert it to
866 if (smb_StoreAnsiFilenames) {
867 cch = cm_AnsiToClientString(inpathdatap, -1, NULL, 0);
871 inpathp = malloc(cch * sizeof(clientchar_t));
872 cm_AnsiToClientString(inpathdatap, -1, inpathp, cch);
874 TranslateExtendedChars(inpathdatap);
876 cch = cm_OemToClientString(inpathdatap, -1, NULL, 0);
880 inpathp = malloc(cch * sizeof(clientchar_t));
881 cm_OemToClientString(inpathdatap, -1, inpathp, cch);
885 cm_ClientStrCpy(tbuffer, lengthof(tbuffer), inpathp);
886 tp = cm_ClientStrRChr(tbuffer, '\\');
887 jp = cm_ClientStrRChr(tbuffer, '/');
890 else if (jp && (tp - tbuffer) < (jp - tbuffer))
893 cm_ClientStrCpy(tbuffer, lengthof(tbuffer), _C("\\"));
895 cm_ClientStrCpy(leafp, LEAF_SIZE, inpathp);
900 cm_ClientStrCpy(leafp, LEAF_SIZE, tp+1);
904 inpathp = NULL; /* We don't need this from this point on */
906 if (tbuffer[0] == tbuffer[1] &&
907 tbuffer[1] == '\\' &&
908 !cm_ClientStrCmpNI(cm_NetbiosNameC, tbuffer+2,
909 (int)cm_ClientStrLen(cm_NetbiosNameC)))
911 clientchar_t shareName[256];
912 clientchar_t *sharePath;
915 /* We may have found a UNC path.
916 * If the first component is the NetbiosName,
917 * then throw out the second component (the submount)
918 * since it had better expand into the value of ioctl->tidPathp
921 p = tbuffer + 2 + cm_ClientStrLen(cm_NetbiosNameC) + 1;
922 if ( !cm_ClientStrCmpNI(_C("all"), p, 3) )
925 for (i = 0; *p && *p != '\\'; i++,p++ ) {
928 p++; /* skip past trailing slash */
929 shareName[i] = 0; /* terminate string */
931 shareFound = smb_FindShare(ioctlp->fidp->vcp, ioctlp->uidp, shareName, &sharePath);
933 /* we found a sharename, therefore use the resulting path */
934 code = cm_NameI(cm_RootSCachep(userp, reqp), ioctlp->prefix->wdata,
935 CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
936 userp, sharePath, reqp, &substRootp);
938 if (code) return code;
940 code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
941 userp, NULL, reqp, scpp);
942 cm_ReleaseSCache(substRootp);
943 if (code) return code;
945 /* otherwise, treat the name as a cellname mounted off the afs root.
946 * This requires that we reconstruct the shareName string with
947 * leading and trailing slashes.
949 p = tbuffer + 2 + cm_ClientStrLen(cm_NetbiosNameC) + 1;
950 if ( !cm_ClientStrCmpNI(_C("all"), p, 3) )
954 for (i = 1; *p && *p != '\\'; i++,p++ ) {
957 p++; /* skip past trailing slash */
958 shareName[i++] = '/'; /* add trailing slash */
959 shareName[i] = 0; /* terminate string */
961 code = cm_NameI(cm_RootSCachep(userp, reqp), ioctlp->prefix->wdata,
962 CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
963 userp, shareName, reqp, &substRootp);
964 if (code) return code;
966 code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
967 userp, NULL, reqp, scpp);
968 cm_ReleaseSCache(substRootp);
969 if (code) return code;
972 code = cm_NameI(cm_RootSCachep(userp, reqp), ioctlp->prefix->wdata,
973 CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
974 userp, ioctlp->tidPathp, reqp, &substRootp);
975 if (code) return code;
977 code = cm_NameI(substRootp, tbuffer, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
978 userp, NULL, reqp, scpp);
979 cm_ReleaseSCache(substRootp);
980 if (code) return code;
983 /* # of bytes of path */
984 code = (long)strlen(ioctlp->ioctl.inDatap) + 1;
985 ioctlp->ioctl.inDatap += code;
987 /* Ensure that the status object is up to date */
988 lock_ObtainWrite(&(*scpp)->rw);
989 code = cm_SyncOp( *scpp, NULL, userp, reqp, 0,
990 CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
992 cm_SyncOpDone( *scpp, NULL, CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
993 lock_ReleaseWrite(&(*scpp)->rw);
995 /* and return success */
1000 smb_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1007 struct ClearToken ct;
1013 int release_userp = 0;
1014 clientchar_t *uname = NULL;
1015 clientchar_t *smbname = NULL;
1016 clientchar_t *wdir = NULL;
1017 clientchar_t *rpc_sid = NULL;
1020 saveDataPtr = ioctlp->ioctl.inDatap;
1022 cm_SkipIoctlPath(&ioctlp->ioctl);
1024 tp = ioctlp->ioctl.inDatap;
1027 memcpy(&ticketLen, tp, sizeof(ticketLen));
1028 tp += sizeof(ticketLen);
1029 if (ticketLen < MINKTCTICKETLEN || ticketLen > MAXKTCTICKETLEN)
1030 return CM_ERROR_INVAL;
1032 /* remember ticket and skip over it for now */
1036 /* clear token size */
1037 memcpy(&ctSize, tp, sizeof(ctSize));
1038 tp += sizeof(ctSize);
1039 if (ctSize != sizeof(struct ClearToken))
1040 return CM_ERROR_INVAL;
1043 memcpy(&ct, tp, ctSize);
1045 if (ct.AuthHandle == -1)
1046 ct.AuthHandle = 999; /* more rxvab compat stuff */
1048 /* more stuff, if any */
1049 if (ioctlp->ioctl.inCopied > tp - saveDataPtr) {
1050 /* flags: logon flag */
1051 memcpy(&flags, tp, sizeof(int));
1056 fschar_t * cellnamep;
1057 clientchar_t * temp;
1059 temp = cm_ParseIoctlStringAlloc(&ioctlp->ioctl, tp);
1060 cellnamep = cm_ClientStringToFsStringAlloc(temp, -1, NULL);
1061 cellp = cm_GetCell(cellnamep, CM_FLAG_CREATE | CM_FLAG_NOPROBE);
1067 code = CM_ERROR_NOSUCHCELL;
1070 tp += strlen(tp) + 1;
1073 uname = cm_ParseIoctlStringAlloc(&ioctlp->ioctl, tp);
1074 tp += strlen(tp) + 1;
1076 if (flags & PIOCTL_LOGON) {
1077 /* SMB user name with which to associate tokens */
1078 smbname = cm_ParseIoctlStringAlloc(&ioctlp->ioctl, tp);
1079 osi_Log2(smb_logp,"smb_IoctlSetToken for user [%S] smbname [%S]",
1080 osi_LogSaveClientString(smb_logp,uname),
1081 osi_LogSaveClientString(smb_logp,smbname));
1082 fprintf(stderr, "SMB name = %S\n", smbname);
1083 tp += strlen(tp) + 1;
1085 osi_Log1(smb_logp,"smb_IoctlSetToken for user [%S]",
1086 osi_LogSaveClientString(smb_logp, uname));
1090 memcpy(&uuid, tp, sizeof(uuid));
1091 if (!cm_FindTokenEvent(uuid, sessionKey, &rpc_sid)) {
1092 code = CM_ERROR_INVAL;
1097 if (!(pflags & AFSCALL_FLAG_LOCAL_SYSTEM)) {
1098 osi_Log1(smb_logp,"smb_IoctlSetToken Rpc Sid [%S]",
1099 osi_LogSaveClientString(smb_logp, rpc_sid));
1100 if (!cm_ClientStrCmp(NTSID_LOCAL_SYSTEM, rpc_sid))
1101 pflags |= AFSCALL_FLAG_LOCAL_SYSTEM;
1106 if (!(pflags & AFSCALL_FLAG_LOCAL_SYSTEM) && (flags & PIOCTL_LOGON)) {
1107 code = CM_ERROR_NOACCESS;
1111 cellp = cm_data.rootCellp;
1112 osi_Log0(smb_logp,"smb_IoctlSetToken - no name specified");
1115 if ((pflags & AFSCALL_FLAG_LOCAL_SYSTEM) && (flags & PIOCTL_LOGON)) {
1117 DWORD dwSize1 = 0, dwSize2 = 0;
1118 wchar_t *pszRefDomain = NULL;
1119 SID_NAME_USE snu = SidTypeGroup;
1120 clientchar_t * secSidString = NULL;
1124 * The specified smbname is may not be a SID for the user.
1125 * See if we can obtain the SID for the specified name.
1126 * If we can, use that instead of the name provided.
1129 LookupAccountNameW( NULL /* System Name to begin Search */,
1134 gle = GetLastError();
1135 if (gle == ERROR_INSUFFICIENT_BUFFER) {
1136 pSid = LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, dwSize1);
1138 * Although dwSize2 is supposed to include the terminating
1139 * NUL character, on Win7 it does not.
1141 pszRefDomain = malloc((dwSize2 + 1) * sizeof(wchar_t));
1144 if ( pSid && pszRefDomain ) {
1145 if (LookupAccountNameW( NULL /* System Name to begin Search */,
1148 pszRefDomain, &dwSize2,
1150 ConvertSidToStringSidW(pSid, &secSidString);
1154 userp = smb_FindCMUserBySID( secSidString, ioctlp->fidp->vcp->rname,
1155 SMB_FLAG_CREATE|SMB_FLAG_AFSLOGON);
1156 LocalFree(secSidString);
1158 /* Free the SID so we can reuse the variable */
1165 * If the SID for the name could not be found,
1166 * perhaps it already is a SID
1168 if (!ConvertStringSidToSidW( smbname, &pSid)) {
1169 userp = smb_FindCMUserBySID( smbname, ioctlp->fidp->vcp->rname,
1170 SMB_FLAG_CREATE|SMB_FLAG_AFSLOGON);
1172 userp = smb_FindCMUserByName( smbname, ioctlp->fidp->vcp->rname,
1173 SMB_FLAG_CREATE|SMB_FLAG_AFSLOGON);
1185 /* store the token */
1186 lock_ObtainMutex(&userp->mx);
1187 ucellp = cm_GetUCell(userp, cellp);
1188 osi_Log1(smb_logp,"smb_IoctlSetToken ucellp %lx", ucellp);
1189 ucellp->ticketLen = ticketLen;
1190 if (ucellp->ticketp)
1191 free(ucellp->ticketp); /* Discard old token if any */
1192 ucellp->ticketp = malloc(ticketLen);
1193 memcpy(ucellp->ticketp, ticket, ticketLen);
1195 * Get the session key from the RPC, rather than from the pioctl.
1198 memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey));
1200 memcpy(ucellp->sessionKey.data, sessionKey, sizeof(sessionKey));
1201 ucellp->kvno = ct.AuthHandle;
1202 ucellp->expirationTime = ct.EndTimestamp;
1205 ucellp->uid = ANONYMOUSID;
1208 cm_ClientStringToFsString(uname, -1, ucellp->userName, MAXKTCNAMELEN);
1210 cm_UsernameToId(uname, ucellp, &ucellp->uid);
1213 _InterlockedOr(&ucellp->flags, CM_UCELLFLAG_RXKAD);
1214 lock_ReleaseMutex(&userp->mx);
1216 if ((pflags & AFSCALL_FLAG_LOCAL_SYSTEM) && (flags & PIOCTL_LOGON)) {
1217 ioctlp->ioctl.flags |= CM_IOCTLFLAG_LOGON;
1220 cm_ResetACLCache(cellp, userp);
1223 SecureZeroMemory(sessionKey, sizeof(sessionKey));
1226 cm_ReleaseUser(userp);
1240 smb_IoctlGetSMBName(smb_ioctl_t *ioctlp, cm_user_t *userp, afs_uint32 pflags)
1242 smb_user_t *uidp = ioctlp->uidp;
1244 if (uidp && uidp->unp) {
1247 cch = cm_ClientStringToUtf8(uidp->unp->name,
1249 ioctlp->ioctl.outDatap,
1250 (int)(SMB_IOCTL_MAXDATA -
1251 (ioctlp->ioctl.outDatap - ioctlp->ioctl.outAllocp))
1252 / sizeof(cm_utf8char_t));
1254 ioctlp->ioctl.outDatap += cch * sizeof(cm_utf8char_t);
1261 smb_IoctlGetACL(smb_ioctl_t *ioctlp, cm_user_t *userp, afs_uint32 pflags)
1266 cm_ioctlQueryOptions_t *optionsp;
1267 afs_uint32 flags = 0;
1271 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1272 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1273 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1275 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1277 cm_SkipIoctlPath(&ioctlp->ioctl);
1278 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1279 optionsp->fid.vnode, optionsp->fid.unique);
1280 code = cm_GetSCache(&fid, &scp, userp, &req);
1282 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1288 code = cm_IoctlGetACL(&ioctlp->ioctl, userp, scp, &req);
1290 cm_ReleaseSCache(scp);
1295 smb_IoctlSetACL(smb_ioctl_t *ioctlp, cm_user_t *userp, afs_uint32 pflags)
1300 afs_uint32 flags = 0;
1304 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1308 code = cm_IoctlSetACL(&ioctlp->ioctl, userp, scp, &req);
1310 cm_ReleaseSCache(scp);
1315 smb_IoctlGetFileCellName(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1320 cm_ioctlQueryOptions_t *optionsp;
1321 afs_uint32 flags = 0;
1325 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1326 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1327 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1329 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1331 cm_SkipIoctlPath(&ioctlp->ioctl);
1332 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1333 optionsp->fid.vnode, optionsp->fid.unique);
1334 code = cm_GetSCache(&fid, &scp, userp, &req);
1336 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1341 code = cm_IoctlGetFileCellName(&ioctlp->ioctl, userp, scp, &req);
1343 cm_ReleaseSCache(scp);
1349 smb_IoctlFlushAllVolumes(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1355 cm_SkipIoctlPath(&ioctlp->ioctl); /* we don't care about the path */
1357 return cm_IoctlFlushAllVolumes(&ioctlp->ioctl, userp, &req);
1361 smb_IoctlFlushVolume(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1366 cm_ioctlQueryOptions_t *optionsp;
1367 afs_uint32 flags = 0;
1371 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1372 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1373 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1375 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1377 cm_SkipIoctlPath(&ioctlp->ioctl);
1378 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1379 optionsp->fid.vnode, optionsp->fid.unique);
1380 code = cm_GetSCache(&fid, &scp, userp, &req);
1382 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1387 code = cm_IoctlFlushVolume(&ioctlp->ioctl, userp, scp, &req);
1389 cm_ReleaseSCache(scp);
1395 smb_IoctlFlushFile(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1400 cm_ioctlQueryOptions_t *optionsp;
1401 afs_uint32 flags = 0;
1405 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1406 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1407 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1409 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1411 cm_SkipIoctlPath(&ioctlp->ioctl);
1412 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1413 optionsp->fid.vnode, optionsp->fid.unique);
1414 code = cm_GetSCache(&fid, &scp, userp, &req);
1416 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1421 code = cm_IoctlFlushFile(&ioctlp->ioctl, userp, scp, &req);
1423 cm_ReleaseSCache(scp);
1428 smb_IoctlSetVolumeStatus(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1436 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, 0);
1437 if (code) return code;
1439 code = cm_IoctlSetVolumeStatus(&ioctlp->ioctl, userp, scp, &req);
1440 cm_ReleaseSCache(scp);
1446 smb_IoctlGetVolumeStatus(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1450 cm_ioctlQueryOptions_t *optionsp;
1451 afs_uint32 flags = 0;
1456 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1457 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1458 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1460 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1462 cm_SkipIoctlPath(&ioctlp->ioctl);
1463 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1464 optionsp->fid.vnode, optionsp->fid.unique);
1465 code = cm_GetSCache(&fid, &scp, userp, &req);
1467 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1472 code = cm_IoctlGetVolumeStatus(&ioctlp->ioctl, userp, scp, &req);
1474 cm_ReleaseSCache(scp);
1480 smb_IoctlGetFid(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1485 cm_ioctlQueryOptions_t * optionsp;
1486 afs_uint32 flags = 0;
1490 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1491 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1492 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1494 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1498 code = cm_IoctlGetFid(&ioctlp->ioctl, userp, scp, &req);
1500 cm_ReleaseSCache(scp);
1506 smb_IoctlGetFileType(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1511 cm_ioctlQueryOptions_t * optionsp;
1512 afs_uint32 flags = 0;
1516 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1517 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1518 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1520 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1522 cm_SkipIoctlPath(&ioctlp->ioctl);
1523 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1524 optionsp->fid.vnode, optionsp->fid.unique);
1525 code = cm_GetSCache(&fid, &scp, userp, &req);
1527 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1532 code = cm_IoctlGetFileType(&ioctlp->ioctl, userp, scp, &req);
1534 cm_ReleaseSCache(scp);
1540 smb_IoctlGetOwner(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1545 cm_ioctlQueryOptions_t *optionsp;
1546 afs_uint32 flags = 0;
1550 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1551 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1552 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1554 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1556 cm_SkipIoctlPath(&ioctlp->ioctl);
1557 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1558 optionsp->fid.vnode, optionsp->fid.unique);
1559 code = cm_GetSCache(&fid, &scp, userp, &req);
1561 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1566 code = cm_IoctlGetOwner(&ioctlp->ioctl, userp, scp, &req);
1568 cm_ReleaseSCache(scp);
1574 smb_IoctlWhereIs(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1579 cm_ioctlQueryOptions_t *optionsp;
1580 afs_uint32 flags = 0;
1584 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1585 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1586 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1588 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1590 cm_SkipIoctlPath(&ioctlp->ioctl);
1591 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1592 optionsp->fid.vnode, optionsp->fid.unique);
1593 code = cm_GetSCache(&fid, &scp, userp, &req);
1595 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
1600 code = cm_IoctlWhereIs(&ioctlp->ioctl, userp, scp, &req);
1602 cm_ReleaseSCache(scp);
1609 smb_IoctlStatMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1617 code = smb_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
1621 code = cm_IoctlStatMountPoint(&ioctlp->ioctl, userp, dscp, &req);
1623 cm_ReleaseSCache(dscp);
1629 smb_IoctlDeleteMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1637 code = smb_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
1641 code = cm_IoctlDeleteMountPoint(&ioctlp->ioctl, userp, dscp, &req);
1643 cm_ReleaseSCache(dscp);
1649 smb_IoctlCheckServers(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1651 cm_SkipIoctlPath(&ioctlp->ioctl); /* we don't care about the path */
1653 return cm_IoctlCheckServers(&ioctlp->ioctl, userp);
1657 smb_IoctlGag(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1659 /* we don't print anything superfluous, so we don't support the gag call */
1660 return CM_ERROR_INVAL;
1664 smb_IoctlCheckVolumes(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1666 cm_SkipIoctlPath(&ioctlp->ioctl);
1668 return cm_IoctlCheckVolumes(&ioctlp->ioctl, userp);
1671 afs_int32 smb_IoctlSetCacheSize(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1673 cm_SkipIoctlPath(&ioctlp->ioctl);
1675 return cm_IoctlSetCacheSize(&ioctlp->ioctl, userp);
1680 smb_IoctlTraceControl(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1682 cm_SkipIoctlPath(&ioctlp->ioctl);
1684 return cm_IoctlTraceControl(&ioctlp->ioctl, userp);
1688 smb_IoctlGetCacheParms(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1690 cm_SkipIoctlPath(&ioctlp->ioctl);
1692 return cm_IoctlGetCacheParms(&ioctlp->ioctl, userp);
1696 smb_IoctlGetCell(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1698 cm_SkipIoctlPath(&ioctlp->ioctl);
1700 return cm_IoctlGetCell(&ioctlp->ioctl, userp);
1704 smb_IoctlNewCell(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1706 cm_SkipIoctlPath(&ioctlp->ioctl);
1708 return cm_IoctlNewCell(&ioctlp->ioctl, userp);
1712 smb_IoctlNewCell2(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1714 cm_SkipIoctlPath(&ioctlp->ioctl);
1716 return cm_IoctlNewCell2(&ioctlp->ioctl, userp);
1720 smb_IoctlGetWsCell(smb_ioctl_t *ioctlp, cm_user_t *userp, afs_uint32 pflags)
1722 cm_SkipIoctlPath(&ioctlp->ioctl);
1724 return cm_IoctlGetWsCell(&ioctlp->ioctl, userp);
1728 smb_IoctlSysName(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1730 cm_SkipIoctlPath(&ioctlp->ioctl);
1732 return cm_IoctlSysName(&ioctlp->ioctl, userp);
1736 smb_IoctlGetCellStatus(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1738 cm_SkipIoctlPath(&ioctlp->ioctl);
1740 return cm_IoctlGetCellStatus(&ioctlp->ioctl, userp);
1744 smb_IoctlSetCellStatus(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1746 cm_SkipIoctlPath(&ioctlp->ioctl);
1748 return cm_IoctlSetCellStatus(&ioctlp->ioctl, userp);
1752 smb_IoctlSetSPrefs(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1754 cm_SkipIoctlPath(&ioctlp->ioctl);
1756 return cm_IoctlSetSPrefs(&ioctlp->ioctl, userp);
1760 smb_IoctlGetSPrefs(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1762 cm_SkipIoctlPath(&ioctlp->ioctl);
1764 return cm_IoctlGetSPrefs(&ioctlp->ioctl, userp);
1768 smb_IoctlStoreBehind(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1770 /* we ignore default asynchrony since we only have one way
1771 * of doing this today.
1777 smb_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1781 clientchar_t leaf[LEAF_SIZE];
1786 code = smb_ParseIoctlParent(ioctlp, userp, &req, &dscp, leaf);
1790 code = cm_IoctlCreateMountPoint(&ioctlp->ioctl, userp, dscp, &req, leaf);
1792 cm_ReleaseSCache(dscp);
1797 smb_IoctlSymlink(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1801 clientchar_t leaf[LEAF_SIZE];
1806 code = smb_ParseIoctlParent(ioctlp, userp, &req, &dscp, leaf);
1807 if (code) return code;
1809 code = cm_IoctlSymlink(&ioctlp->ioctl, userp, dscp, &req, leaf);
1811 cm_ReleaseSCache(dscp);
1817 smb_IoctlListlink(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1825 code = smb_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
1826 if (code) return code;
1828 code = cm_IoctlListlink(&ioctlp->ioctl, userp, dscp, &req);
1830 cm_ReleaseSCache(dscp);
1835 smb_IoctlIslink(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1836 {/*CHECK FOR VALID SYMLINK*/
1843 code = smb_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
1844 if (code) return code;
1846 code = cm_IoctlIslink(&ioctlp->ioctl, userp, dscp, &req);
1848 cm_ReleaseSCache(dscp);
1854 smb_IoctlDeletelink(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1862 code = smb_ParseIoctlPath(ioctlp, userp, &req, &dscp, 0);
1863 if (code) return code;
1865 code = cm_IoctlDeletelink(&ioctlp->ioctl, userp, dscp, &req);
1867 cm_ReleaseSCache(dscp);
1873 smb_IoctlGetTokenIter(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1875 cm_SkipIoctlPath(&ioctlp->ioctl);
1877 return cm_IoctlGetTokenIter(&ioctlp->ioctl, userp);
1881 smb_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1883 cm_SkipIoctlPath(&ioctlp->ioctl);
1885 return cm_IoctlGetToken(&ioctlp->ioctl, userp);
1890 smb_IoctlDelToken(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1892 cm_SkipIoctlPath(&ioctlp->ioctl);
1894 return cm_IoctlDelToken(&ioctlp->ioctl, userp);
1899 smb_IoctlDelAllToken(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1901 cm_SkipIoctlPath(&ioctlp->ioctl);
1903 return cm_IoctlDelAllToken(&ioctlp->ioctl, userp);
1908 smb_IoctlMakeSubmount(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1910 cm_SkipIoctlPath(&ioctlp->ioctl);
1912 return cm_IoctlMakeSubmount(&ioctlp->ioctl, userp);
1916 smb_IoctlGetRxkcrypt(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1918 cm_SkipIoctlPath(&ioctlp->ioctl);
1920 return cm_IoctlGetRxkcrypt(&ioctlp->ioctl, userp);
1924 smb_IoctlSetRxkcrypt(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1926 cm_SkipIoctlPath(&ioctlp->ioctl);
1928 return cm_IoctlSetRxkcrypt(&ioctlp->ioctl, userp);
1932 smb_IoctlRxStatProcess(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1934 cm_SkipIoctlPath(&ioctlp->ioctl);
1936 return cm_IoctlRxStatProcess(&ioctlp->ioctl, userp);
1941 smb_IoctlRxStatPeer(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1943 cm_SkipIoctlPath(&ioctlp->ioctl);
1945 return cm_IoctlRxStatPeer(&ioctlp->ioctl, userp);
1949 smb_IoctlUnicodeControl(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1951 cm_SkipIoctlPath(&ioctlp->ioctl);
1953 return cm_IoctlUnicodeControl(&ioctlp->ioctl, userp);
1957 smb_IoctlUUIDControl(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1959 cm_SkipIoctlPath(&ioctlp->ioctl);
1961 return cm_IoctlUUIDControl(&ioctlp->ioctl, userp);
1966 smb_IoctlMemoryDump(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1968 cm_SkipIoctlPath(&ioctlp->ioctl);
1970 return cm_IoctlMemoryDump(&ioctlp->ioctl, userp);
1974 smb_IoctlPathAvailability(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
1979 cm_ioctlQueryOptions_t *optionsp;
1980 afs_uint32 flags = 0;
1984 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
1985 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
1986 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
1988 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
1990 cm_SkipIoctlPath(&ioctlp->ioctl);
1991 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
1992 optionsp->fid.vnode, optionsp->fid.unique);
1993 code = cm_GetSCache(&fid, &scp, userp, &req);
1995 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
2000 code = cm_IoctlPathAvailability(&ioctlp->ioctl, userp, scp, &req);
2001 cm_ReleaseSCache(scp);
2006 smb_IoctlVolStatTest(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2012 cm_SkipIoctlPath(&ioctlp->ioctl);
2014 return cm_IoctlVolStatTest(&ioctlp->ioctl, userp, &req);
2020 * This pioctl requires the use of the cm_ioctlQueryOptions_t structure.
2024 smb_IoctlSetOwner(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2029 cm_ioctlQueryOptions_t *optionsp;
2030 afs_uint32 flags = 0;
2034 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
2036 if (CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
2037 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
2039 if (CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
2041 cm_SkipIoctlPath(&ioctlp->ioctl);
2042 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
2043 optionsp->fid.vnode, optionsp->fid.unique);
2044 code = cm_GetSCache(&fid, &scp, userp, &req);
2046 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
2051 cm_IoctlSkipQueryOptions(&ioctlp->ioctl, userp);
2054 code = cm_IoctlSetOwner(&ioctlp->ioctl, userp, scp, &req);
2056 cm_ReleaseSCache(scp);
2064 * This pioctl requires the use of the cm_ioctlQueryOptions_t structure.
2068 smb_IoctlSetGroup(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2073 cm_ioctlQueryOptions_t *optionsp;
2074 afs_uint32 flags = 0;
2078 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
2080 if (CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
2081 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
2083 if (CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
2085 cm_SkipIoctlPath(&ioctlp->ioctl);
2086 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
2087 optionsp->fid.vnode, optionsp->fid.unique);
2088 code = cm_GetSCache(&fid, &scp, userp, &req);
2090 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
2095 cm_IoctlSkipQueryOptions(&ioctlp->ioctl, userp);
2098 code = cm_IoctlSetGroup(&ioctlp->ioctl, userp, scp, &req);
2100 cm_ReleaseSCache(scp);
2107 smb_IoctlGetUnixMode(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2112 cm_ioctlQueryOptions_t *optionsp;
2113 afs_uint32 flags = 0;
2117 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
2118 if (optionsp && CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
2119 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
2121 if (optionsp && CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
2123 cm_SkipIoctlPath(&ioctlp->ioctl);
2124 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
2125 optionsp->fid.vnode, optionsp->fid.unique);
2126 code = cm_GetSCache(&fid, &scp, userp, &req);
2128 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
2133 code = cm_IoctlGetUnixMode(&ioctlp->ioctl, userp, scp, &req);
2135 cm_ReleaseSCache(scp);
2144 * This pioctl requires the use of the cm_ioctlQueryOptions_t structure.
2147 smb_IoctlSetUnixMode(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2152 cm_ioctlQueryOptions_t *optionsp;
2153 afs_uint32 flags = 0;
2157 optionsp = cm_IoctlGetQueryOptions(&ioctlp->ioctl, userp);
2159 if (CM_IOCTL_QOPTS_HAVE_LITERAL(optionsp))
2160 flags |= (optionsp->literal ? CM_PARSE_FLAG_LITERAL : 0);
2162 if (CM_IOCTL_QOPTS_HAVE_FID(optionsp)) {
2164 cm_SkipIoctlPath(&ioctlp->ioctl);
2165 cm_SetFid(&fid, optionsp->fid.cell, optionsp->fid.volume,
2166 optionsp->fid.vnode, optionsp->fid.unique);
2167 code = cm_GetSCache(&fid, &scp, userp, &req);
2169 code = smb_ParseIoctlPath(ioctlp, userp, &req, &scp, flags);
2174 cm_IoctlSkipQueryOptions(&ioctlp->ioctl, userp);
2177 code = cm_IoctlSetUnixMode(&ioctlp->ioctl, userp, scp, &req);
2179 cm_ReleaseSCache(scp);
2185 smb_IoctlGetVerifyData(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2187 cm_SkipIoctlPath(&ioctlp->ioctl);
2189 return cm_IoctlGetVerifyData(&ioctlp->ioctl);
2193 smb_IoctlSetVerifyData(struct smb_ioctl *ioctlp, struct cm_user *userp, afs_uint32 pflags)
2195 cm_SkipIoctlPath(&ioctlp->ioctl);
2197 return cm_IoctlSetVerifyData(&ioctlp->ioctl);