mirror of
https://git.openafs.org/openafs.git
synced 2025-01-20 16:00:12 +00:00
the-correct-mkdir-fix-20040318
Apply the correct file including the fix to the MIT recursive directory creation patch.
This commit is contained in:
parent
1d568df733
commit
8f0422422d
@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#include "smb.h"
|
#include "smb.h"
|
||||||
|
|
||||||
extern smb_vc_t *dead_vcp;
|
|
||||||
|
|
||||||
extern osi_hyper_t hzero;
|
extern osi_hyper_t hzero;
|
||||||
|
|
||||||
smb_packet_t *smb_Directory_Watches = NULL;
|
smb_packet_t *smb_Directory_Watches = NULL;
|
||||||
@ -111,7 +109,7 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
|||||||
{
|
{
|
||||||
char *tp;
|
char *tp;
|
||||||
char *usern, *pwd, *pwdx;
|
char *usern, *pwd, *pwdx;
|
||||||
smb_user_t *uidp, *dead_uidp;
|
smb_user_t *uidp;
|
||||||
unsigned short newUid;
|
unsigned short newUid;
|
||||||
unsigned long caps;
|
unsigned long caps;
|
||||||
cm_user_t *userp;
|
cm_user_t *userp;
|
||||||
@ -164,7 +162,8 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
|||||||
if (!userp)
|
if (!userp)
|
||||||
userp = cm_NewUser();
|
userp = cm_NewUser();
|
||||||
lock_ObtainMutex(&vcp->mx);
|
lock_ObtainMutex(&vcp->mx);
|
||||||
if(!vcp->uidCounter) vcp->uidCounter++; /* handle unlikely wraparounds */
|
if (!vcp->uidCounter)
|
||||||
|
vcp->uidCounter++; /* handle unlikely wraparounds */
|
||||||
newUid = (strlen(usern)==0)?0:vcp->uidCounter++;
|
newUid = (strlen(usern)==0)?0:vcp->uidCounter++;
|
||||||
lock_ReleaseMutex(&vcp->mx);
|
lock_ReleaseMutex(&vcp->mx);
|
||||||
|
|
||||||
@ -176,7 +175,7 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
|||||||
uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
|
uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
|
||||||
lock_ObtainMutex(&uidp->mx);
|
lock_ObtainMutex(&uidp->mx);
|
||||||
uidp->unp = unp;
|
uidp->unp = unp;
|
||||||
osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],TicketKTCName[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
|
osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],TicketKTCName[%s]",(int)vcp,vcp->lana,vcp->lsn,newUid,usern);
|
||||||
osi_Log4(afsd_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid);
|
osi_Log4(afsd_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid);
|
||||||
lock_ReleaseMutex(&uidp->mx);
|
lock_ReleaseMutex(&uidp->mx);
|
||||||
smb_ReleaseUID(uidp);
|
smb_ReleaseUID(uidp);
|
||||||
@ -205,7 +204,7 @@ long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou
|
|||||||
|
|
||||||
/* find the tree and free it */
|
/* find the tree and free it */
|
||||||
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
|
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
|
||||||
/* TODO: smb_ReleaseUID? */
|
/* TODO: smb_ReleaseUID() ? */
|
||||||
if (uidp) {
|
if (uidp) {
|
||||||
char *s1 = NULL, *s2 = NULL;
|
char *s1 = NULL, *s2 = NULL;
|
||||||
|
|
||||||
@ -573,8 +572,7 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
{
|
{
|
||||||
memcpy(((char *)asp->parmsp) + parmDisp, inp->data + parmOffset, parmCount);
|
memcpy(((char *)asp->parmsp) + parmDisp, inp->data + parmOffset, parmCount);
|
||||||
}
|
}
|
||||||
if( dataCount != 0 )
|
if ( dataCount != 0 ) {
|
||||||
{
|
|
||||||
memcpy(asp->datap + dataDisp, inp->data + dataOffset, dataCount);
|
memcpy(asp->datap + dataDisp, inp->data + dataOffset, dataCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +589,7 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
|
|
||||||
/* now dispatch it */
|
/* now dispatch it */
|
||||||
if ( asp->opcode >= 0 && asp->opcode < 20 && smb_tran2DispatchTable[asp->opcode].procp) {
|
if ( asp->opcode >= 0 && asp->opcode < 20 && smb_tran2DispatchTable[asp->opcode].procp) {
|
||||||
osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",vcp,vcp->lana,vcp->lsn);
|
osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",(int)vcp,vcp->lana,vcp->lsn);
|
||||||
osi_Log4(afsd_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn);
|
osi_Log4(afsd_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn);
|
||||||
code = (*smb_tran2DispatchTable[asp->opcode].procp)(vcp, asp, outp);
|
code = (*smb_tran2DispatchTable[asp->opcode].procp)(vcp, asp, outp);
|
||||||
}
|
}
|
||||||
@ -890,8 +888,8 @@ long smb_ReceiveTran2Open(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op)
|
|||||||
if (extraInfo) {
|
if (extraInfo) {
|
||||||
outp->parmsp[parmSlot] = smb_Attributes(scp); parmSlot++;
|
outp->parmsp[parmSlot] = smb_Attributes(scp); parmSlot++;
|
||||||
smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
|
smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
|
||||||
outp->parmsp[parmSlot] = dosTime & 0xffff; parmSlot++;
|
outp->parmsp[parmSlot] = (unsigned short)(dosTime & 0xffff); parmSlot++;
|
||||||
outp->parmsp[parmSlot] = (dosTime>>16) & 0xffff; parmSlot++;
|
outp->parmsp[parmSlot] = (unsigned short)((dosTime>>16) & 0xffff); parmSlot++;
|
||||||
outp->parmsp[parmSlot] = (unsigned short) (scp->length.LowPart & 0xffff);
|
outp->parmsp[parmSlot] = (unsigned short) (scp->length.LowPart & 0xffff);
|
||||||
parmSlot++;
|
parmSlot++;
|
||||||
outp->parmsp[parmSlot] = (unsigned short) ((scp->length.LowPart >> 16) & 0xffff);
|
outp->parmsp[parmSlot] = (unsigned short) ((scp->length.LowPart >> 16) & 0xffff);
|
||||||
@ -1183,6 +1181,7 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
|||||||
spacep = cm_GetSpace();
|
spacep = cm_GetSpace();
|
||||||
smb_StripLastComponent(spacep->data, &lastComp,
|
smb_StripLastComponent(spacep->data, &lastComp,
|
||||||
(char *)(&p->parmsp[3]));
|
(char *)(&p->parmsp[3]));
|
||||||
|
/* Make sure that lastComp is not NULL */
|
||||||
if (lastComp) {
|
if (lastComp) {
|
||||||
if (strcmp(lastComp, "\\desktop.ini") == 0) {
|
if (strcmp(lastComp, "\\desktop.ini") == 0) {
|
||||||
code = cm_NameI(cm_rootSCachep, spacep->data,
|
code = cm_NameI(cm_rootSCachep, spacep->data,
|
||||||
@ -1496,16 +1495,14 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
|
|||||||
|
|
||||||
/* prepare for setattr call */
|
/* prepare for setattr call */
|
||||||
attr.mask = 0;
|
attr.mask = 0;
|
||||||
lastMod = *((FILETIME *)(p->datap + 16));
|
|
||||||
/* when called as result of move a b, lastMod is (-1, -1). If the check for -1
|
|
||||||
is not present, timestamp
|
|
||||||
of the resulting file will be 1969 (-1)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
lastMod = *((FILETIME *)(p->datap + 16));
|
||||||
|
/* when called as result of move a b, lastMod is (-1, -1).
|
||||||
|
* If the check for -1 is not present, timestamp
|
||||||
|
* of the resulting file will be 1969 (-1)
|
||||||
|
*/
|
||||||
if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod)) &&
|
if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod)) &&
|
||||||
lastMod.dwLowDateTime != -1 &&
|
lastMod.dwLowDateTime != -1 && lastMod.dwHighDateTime != -1) {
|
||||||
lastMod.dwHighDateTime != -1)
|
|
||||||
{
|
|
||||||
attr.mask |= CM_ATTRMASK_CLIENTMODTIME;
|
attr.mask |= CM_ATTRMASK_CLIENTMODTIME;
|
||||||
smb_UnixTimeFromLargeSearchTime(&attr.clientModTime,
|
smb_UnixTimeFromLargeSearchTime(&attr.clientModTime,
|
||||||
&lastMod);
|
&lastMod);
|
||||||
@ -1671,7 +1668,6 @@ long smb_ApplyV3DirListPatches(cm_scache_t *dscp,
|
|||||||
/* merge in hidden (dot file) attribute */
|
/* merge in hidden (dot file) attribute */
|
||||||
if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
|
if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
|
||||||
lattr |= SMB_ATTR_HIDDEN;
|
lattr |= SMB_ATTR_HIDDEN;
|
||||||
|
|
||||||
*((u_long *)dptr) = lattr;
|
*((u_long *)dptr) = lattr;
|
||||||
dptr += 4;
|
dptr += 4;
|
||||||
}
|
}
|
||||||
@ -1722,7 +1718,6 @@ long smb_ApplyV3DirListPatches(cm_scache_t *dscp,
|
|||||||
/* merge in hidden (dot file) attribute */
|
/* merge in hidden (dot file) attribute */
|
||||||
if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
|
if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
|
||||||
attr |= SMB_ATTR_HIDDEN;
|
attr |= SMB_ATTR_HIDDEN;
|
||||||
|
|
||||||
*dptr++ = attr & 0xff;
|
*dptr++ = attr & 0xff;
|
||||||
*dptr++ = (attr >> 8) & 0xff;
|
*dptr++ = (attr >> 8) & 0xff;
|
||||||
}
|
}
|
||||||
@ -2249,7 +2244,8 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t
|
|||||||
|
|
||||||
/* Eliminate entries that don't match requested
|
/* Eliminate entries that don't match requested
|
||||||
attributes */
|
attributes */
|
||||||
if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && smb_IsDotFile(dep->name))
|
if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) &&
|
||||||
|
smb_IsDotFile(dep->name))
|
||||||
goto nextEntry; /* no hidden files */
|
goto nextEntry; /* no hidden files */
|
||||||
|
|
||||||
if (!(dsp->attribute & SMB_ATTR_DIRECTORY)) /* no directories */
|
if (!(dsp->attribute & SMB_ATTR_DIRECTORY)) /* no directories */
|
||||||
@ -2446,9 +2442,8 @@ nextEntry:
|
|||||||
* or if something went wrong, close the search.
|
* or if something went wrong, close the search.
|
||||||
*/
|
*/
|
||||||
/* ((searchFlags & 1) || ((searchFlags & 2) && eos) */
|
/* ((searchFlags & 1) || ((searchFlags & 2) && eos) */
|
||||||
/* pbh - added patch submitted to openafs-dev from James Petterson on 26 Feb, 2003 */
|
if ((searchFlags & 1) || (returnedNames == 0) || ((searchFlags & 2) &&
|
||||||
if ((searchFlags & 1) || (returnedNames == 0) || ((searchFlags & 2) && eos)
|
eos) || code != 0)
|
||||||
|| code != 0)
|
|
||||||
smb_DeleteDirSearch(dsp);
|
smb_DeleteDirSearch(dsp);
|
||||||
if (code)
|
if (code)
|
||||||
smb_SendTran2Error(vcp, p, opx, code);
|
smb_SendTran2Error(vcp, p, opx, code);
|
||||||
@ -2546,6 +2541,7 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
#ifdef NOTSERVICE
|
#ifdef NOTSERVICE
|
||||||
osi_Log0(afsd_logp, "IOCTL Open");
|
osi_Log0(afsd_logp, "IOCTL Open");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE);
|
fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE);
|
||||||
smb_SetupIoctlFid(fidp, spacep);
|
smb_SetupIoctlFid(fidp, spacep);
|
||||||
|
|
||||||
@ -2587,7 +2583,6 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
free(hexp);
|
free(hexp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
userp = smb_GetUser(vcp, inp);
|
userp = smb_GetUser(vcp, inp);
|
||||||
|
|
||||||
dscp = NULL;
|
dscp = NULL;
|
||||||
@ -2684,8 +2679,7 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
setAttr.mask = CM_ATTRMASK_LENGTH;
|
setAttr.mask = CM_ATTRMASK_LENGTH;
|
||||||
setAttr.length.LowPart = 0;
|
setAttr.length.LowPart = 0;
|
||||||
setAttr.length.HighPart = 0;
|
setAttr.length.HighPart = 0;
|
||||||
code = cm_SetAttr(scp, &setAttr, userp,
|
code = cm_SetAttr(scp, &setAttr, userp, &req);
|
||||||
&req);
|
|
||||||
}
|
}
|
||||||
} /* lookup succeeded */
|
} /* lookup succeeded */
|
||||||
}
|
}
|
||||||
@ -2991,11 +2985,9 @@ long smb_ReceiveV3SetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
|
|||||||
code = cm_SetAttr(scp, &attrs, userp, &req);
|
code = cm_SetAttr(scp, &attrs, userp, &req);
|
||||||
|
|
||||||
osi_Log1(afsd_logp, "SMB receive V3SetAttributes [fid=%ld]", fid);
|
osi_Log1(afsd_logp, "SMB receive V3SetAttributes [fid=%ld]", fid);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
osi_Log1(afsd_logp, "**smb_UnixTimeFromSearchTime failed searchTime=%ld", searchTime);
|
osi_Log1(afsd_logp, "**smb_UnixTimeFromSearchTime failed searchTime=%ld", searchTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else code = 0;
|
else code = 0;
|
||||||
|
|
||||||
@ -3228,9 +3220,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
free(hexp);
|
free(hexp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
userp = smb_GetUser(vcp, inp);
|
userp = smb_GetUser(vcp, inp);
|
||||||
|
|
||||||
if (!userp) {
|
if (!userp) {
|
||||||
osi_Log1(afsd_logp, "NTCreateX Invalid user [%d]", ((smb_t *) inp)->uid);
|
osi_Log1(afsd_logp, "NTCreateX Invalid user [%d]", ((smb_t *) inp)->uid);
|
||||||
free(realPathp);
|
free(realPathp);
|
||||||
@ -3424,7 +3414,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
else {
|
else {
|
||||||
char *tp, *pp;
|
char *tp, *pp;
|
||||||
char *cp; /* This component */
|
char *cp; /* This component */
|
||||||
int clen; /* length of component */
|
int clen = 0; /* length of component */
|
||||||
cm_scache_t *tscp;
|
cm_scache_t *tscp;
|
||||||
int isLast = 0;
|
int isLast = 0;
|
||||||
|
|
||||||
@ -3446,6 +3436,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
tp = strchr(pp, '\\');
|
tp = strchr(pp, '\\');
|
||||||
if(!tp) {
|
if(!tp) {
|
||||||
strcpy(cp,pp);
|
strcpy(cp,pp);
|
||||||
|
clen = strlen(cp);
|
||||||
isLast = 1; /* indicate last component. the supplied path never ends in a slash */
|
isLast = 1; /* indicate last component. the supplied path never ends in a slash */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -3507,7 +3498,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
free(realPathp);
|
free(realPathp);
|
||||||
return CM_ERROR_ISDIR;
|
return CM_ERROR_ISDIR;
|
||||||
}
|
}
|
||||||
/* (only applies for single component case) */
|
/* (only applies to single component case) */
|
||||||
if (realDirFlag == 1 && scp->fileType == CM_SCACHETYPE_FILE) {
|
if (realDirFlag == 1 && scp->fileType == CM_SCACHETYPE_FILE) {
|
||||||
cm_ReleaseSCache(scp);
|
cm_ReleaseSCache(scp);
|
||||||
if (dscp) cm_ReleaseSCache(dscp);
|
if (dscp) cm_ReleaseSCache(dscp);
|
||||||
@ -3597,11 +3588,15 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
|||||||
unsigned int extendedRespRequired;
|
unsigned int extendedRespRequired;
|
||||||
int realDirFlag;
|
int realDirFlag;
|
||||||
unsigned int desiredAccess;
|
unsigned int desiredAccess;
|
||||||
/*unsigned int allocSize;*/
|
#ifdef DEBUG_VERBOSE
|
||||||
/*unsigned int shareAccess;*/
|
unsigned int allocSize;
|
||||||
|
unsigned int shareAccess;
|
||||||
|
#endif
|
||||||
unsigned int extAttributes;
|
unsigned int extAttributes;
|
||||||
unsigned int createDisp;
|
unsigned int createDisp;
|
||||||
/*unsigned int sdLen;*/
|
#ifdef DEBUG_VERBOSE
|
||||||
|
unsigned int sdLen;
|
||||||
|
#endif
|
||||||
unsigned int createOptions;
|
unsigned int createOptions;
|
||||||
int initialModeBits;
|
int initialModeBits;
|
||||||
unsigned short baseFid;
|
unsigned short baseFid;
|
||||||
@ -3644,19 +3639,25 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
|||||||
return CM_ERROR_INVAL;
|
return CM_ERROR_INVAL;
|
||||||
baseFid = (unsigned short)lparmp[1];
|
baseFid = (unsigned short)lparmp[1];
|
||||||
desiredAccess = lparmp[2];
|
desiredAccess = lparmp[2];
|
||||||
/*allocSize = lparmp[3];*/
|
#ifdef DEBUG_VERBOSE
|
||||||
|
allocSize = lparmp[3];
|
||||||
|
#endif /* DEBUG_VERSOSE */
|
||||||
extAttributes = lparmp[5];
|
extAttributes = lparmp[5];
|
||||||
/*shareAccess = lparmp[6];*/
|
#ifdef DEBUG_VEROSE
|
||||||
|
shareAccess = lparmp[6];
|
||||||
|
#endif
|
||||||
createDisp = lparmp[7];
|
createDisp = lparmp[7];
|
||||||
createOptions = lparmp[8];
|
createOptions = lparmp[8];
|
||||||
/*sdLen = lparmp[9];*/
|
#ifdef DEBUG_VERBOSE
|
||||||
|
sdLen = lparmp[9];
|
||||||
|
#endif
|
||||||
nameLength = lparmp[11];
|
nameLength = lparmp[11];
|
||||||
|
|
||||||
/*
|
#ifdef DEBUG_VERBOSE
|
||||||
osi_Log4(afsd_logp,"NTTransCreate with da[%x],ea[%x],sa[%x],cd[%x]",desiredAccess,extAttributes,shareAccess,createDisp);
|
osi_Log4(afsd_logp,"NTTransCreate with da[%x],ea[%x],sa[%x],cd[%x]",desiredAccess,extAttributes,shareAccess,createDisp);
|
||||||
osi_Log2(afsd_logp,"... co[%x],sdl[%x],as[%x]",createOptions,sdLen,allocSize);
|
osi_Log2(afsd_logp,"... co[%x],sdl[%x],as[%x]",createOptions,sdLen,allocSize);
|
||||||
osi_Log1(afsd_logp,"... flags[%x]",flags);
|
osi_Log1(afsd_logp,"... flags[%x]",flags);
|
||||||
*/
|
#endif
|
||||||
|
|
||||||
/* mustBeDir is never set; createOptions directory bit seems to be
|
/* mustBeDir is never set; createOptions directory bit seems to be
|
||||||
* more important
|
* more important
|
||||||
@ -3688,6 +3689,7 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
|||||||
* Nothing here to handle SMB_IOCTL_FILENAME.
|
* Nothing here to handle SMB_IOCTL_FILENAME.
|
||||||
* Will add it if necessary.
|
* Will add it if necessary.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef DEBUG_VERBOSE
|
#ifdef DEBUG_VERBOSE
|
||||||
{
|
{
|
||||||
char *hexp, *asciip;
|
char *hexp, *asciip;
|
||||||
@ -3930,7 +3932,7 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
|||||||
/* set inp->fid so that later read calls in same msg can find fid */
|
/* set inp->fid so that later read calls in same msg can find fid */
|
||||||
inp->fid = fidp->fid;
|
inp->fid = fidp->fid;
|
||||||
|
|
||||||
/* check whether we are required to send and extended response */
|
/* check whether we are required to send an extended response */
|
||||||
if (!extendedRespRequired) {
|
if (!extendedRespRequired) {
|
||||||
/* out parms */
|
/* out parms */
|
||||||
parmOffset = 8*4 + 39;
|
parmOffset = 8*4 + 39;
|
||||||
@ -3979,9 +3981,7 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
|||||||
*((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY);
|
*((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY);
|
||||||
outData += 2; /* is a dir? */
|
outData += 2; /* is a dir? */
|
||||||
lock_ReleaseMutex(&scp->mx);
|
lock_ReleaseMutex(&scp->mx);
|
||||||
|
} else {
|
||||||
} else { /* extended response required */
|
|
||||||
|
|
||||||
/* out parms */
|
/* out parms */
|
||||||
parmOffset = 8*4 + 39;
|
parmOffset = 8*4 + 39;
|
||||||
parmOffset += 1; /* pad to 4 */
|
parmOffset += 1; /* pad to 4 */
|
||||||
@ -4041,7 +4041,6 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out
|
|||||||
cm_ReleaseUser(userp);
|
cm_ReleaseUser(userp);
|
||||||
|
|
||||||
/* free(realPathp); Can't free realPathp here because fidp->NTopen_wholepathp points there */
|
/* free(realPathp); Can't free realPathp here because fidp->NTopen_wholepathp points there */
|
||||||
|
|
||||||
/* leave scp held since we put it in fidp->scp */
|
/* leave scp held since we put it in fidp->scp */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -4060,7 +4059,6 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp,
|
|||||||
watchtree = smb_GetSMBParm(inp, 22) && 0xffff; /* TODO: should this be 0xff ? */
|
watchtree = smb_GetSMBParm(inp, 22) && 0xffff; /* TODO: should this be 0xff ? */
|
||||||
|
|
||||||
fidp = smb_FindFID(vcp, fid, 0);
|
fidp = smb_FindFID(vcp, fid, 0);
|
||||||
|
|
||||||
if (!fidp) {
|
if (!fidp) {
|
||||||
osi_Log1(afsd_logp, "ERROR: NotifyChange given invalid fid [%d]", fid);
|
osi_Log1(afsd_logp, "ERROR: NotifyChange given invalid fid [%d]", fid);
|
||||||
return CM_ERROR_BADFD;
|
return CM_ERROR_BADFD;
|
||||||
@ -4086,7 +4084,6 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp,
|
|||||||
smb_ReleaseFID(fidp);
|
smb_ReleaseFID(fidp);
|
||||||
|
|
||||||
outp->flags |= SMB_PACKETFLAG_NOSEND;
|
outp->flags |= SMB_PACKETFLAG_NOSEND;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4402,7 +4399,7 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
|
|||||||
if (fidp) {
|
if (fidp) {
|
||||||
osi_Log3(afsd_logp, "Cancelling change notification for fid %d wtree %d file %s",
|
osi_Log3(afsd_logp, "Cancelling change notification for fid %d wtree %d file %s",
|
||||||
fid, watchtree,
|
fid, watchtree,
|
||||||
osi_LogSaveString(afsd_logp, fidp->NTopen_wholepathp));
|
osi_LogSaveString(afsd_logp, (fidp)?fidp->NTopen_wholepathp:""));
|
||||||
|
|
||||||
scp = fidp->scp;
|
scp = fidp->scp;
|
||||||
lock_ObtainMutex(&scp->mx);
|
lock_ObtainMutex(&scp->mx);
|
||||||
@ -4445,7 +4442,6 @@ void smb3_Init()
|
|||||||
|
|
||||||
cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
|
cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
|
||||||
{
|
{
|
||||||
cm_user_t *userp;
|
|
||||||
/*int newUid;*/
|
/*int newUid;*/
|
||||||
smb_username_t *unp;
|
smb_username_t *unp;
|
||||||
|
|
||||||
@ -4454,9 +4450,9 @@ cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
|
|||||||
lock_ObtainMutex(&unp->mx);
|
lock_ObtainMutex(&unp->mx);
|
||||||
unp->userp = cm_NewUser();
|
unp->userp = cm_NewUser();
|
||||||
lock_ReleaseMutex(&unp->mx);
|
lock_ReleaseMutex(&unp->mx);
|
||||||
osi_LogEvent("AFS smb_FindCMUserByName New User",NULL,"name[%s] machine[%s]",usern,machine);
|
osi_LogEvent("AFS smb_FindCMUserByName : New User",NULL,"name[%s] machine[%s]",usern,machine);
|
||||||
} else {
|
} else {
|
||||||
osi_LogEvent("AFS smb_FindCMUserByName Found",NULL,"name[%s] machine[%s]",usern,machine);
|
osi_LogEvent("AFS smb_FindCMUserByName : Found",NULL,"name[%s] machine[%s]",usern,machine);
|
||||||
}
|
}
|
||||||
return unp->userp;
|
return unp->userp;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user