clientchar_t *inPathp)
{
clientchar_t *lastSlashp;
-
+ clientchar_t *streamp = NULL;
+ clientchar_t *typep = NULL;
+
lastSlashp = cm_ClientStrRChr(inPathp, '\\');
- if (lastComponentp)
+ if (lastComponentp) {
*lastComponentp = lastSlashp;
+ }
if (lastSlashp) {
+ /*
+ * If the name contains a stream name and a type
+ * and the stream name is the nul-string and the
+ * type is $DATA, then strip "::$DATA" from the
+ * last component string that is returned.
+ *
+ * Otherwise, return the full path name and allow
+ * the file name to be rejected because it contains
+ * a colon.
+ */
+ typep = cm_ClientStrRChr(lastSlashp, L':');
+ if (typep && cm_ClientStrCmpI(typep, L":$DATA") == 0) {
+ *typep = '\0';
+ streamp = cm_ClientStrRChr(lastSlashp, L':');
+ if (streamp && cm_ClientStrCmpI(streamp, L":") == 0)
+ *streamp = '\0';
+ else
+ *typep = ':';
+ }
+
while (1) {
if (inPathp == lastSlashp)
break;
}
#endif
+ share = smb_GetSMBParm(inp, 0);
+ attribute = smb_GetSMBParm(inp, 1);
+
+ spacep = inp->spacep;
+ /* smb_StripLastComponent will strip "::$DATA" if present */
+ smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
+
if (!cm_IsValidClientString(pathp)) {
#ifdef DEBUG
clientchar_t * hexp;
return CM_ERROR_BADNTFILENAME;
}
- share = smb_GetSMBParm(inp, 0);
- attribute = smb_GetSMBParm(inp, 1);
-
- spacep = inp->spacep;
- smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
if (lastNamep && cm_ClientStrCmp(lastNamep, _C(SMB_IOCTL_FILENAME)) == 0) {
/* special case magic file name for receiving IOCTL requests
* (since IOCTL calls themselves aren't getting through).
if (!pathp)
return CM_ERROR_BADSMB;
+ spacep = inp->spacep;
+ /* smb_StripLastComponent will strip "::$DATA" if present */
+ smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
+
if (!cm_IsValidClientString(pathp)) {
#ifdef DEBUG
clientchar_t * hexp;
return CM_ERROR_BADNTFILENAME;
}
- spacep = inp->spacep;
- smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
-
userp = smb_GetUserFromVCP(vcp, inp);
caseFold = CM_FLAG_CASEFOLD;
}
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
if (lastNamep &&
return code;
}
} else {
+ /* macintosh is expensive to program for it */
+ cm_FreeSpace(spacep);
+
#ifdef DFS_SUPPORT
if (scp->fileType == CM_SCACHETYPE_DFSLINK) {
int pnc = cm_VolStatus_Notify_DFS_Mapping(scp, tidPathp, lastNamep);
return CM_ERROR_NOSUCHPATH;
}
#endif /* DFS_SUPPORT */
-
- /* macintosh is expensive to program for it */
- cm_FreeSpace(spacep);
}
/* if we get here, if code is 0, the file exists and is represented by
osi_hyper_t thyper;
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
code = cm_NameI(cm_data.rootSCachep, spacep->wdata,
*/
if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastComp, pathp);
#ifndef SPECIAL_FOLDERS
/* Make sure that lastComp is not NULL */
*/
if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastComp, pathp);
#ifndef SPECIAL_FOLDERS
/* Make sure that lastComp is not NULL */
cm_ReleaseSCache(scp);
scp = 0;
}
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(pathName, &lastComponent, temp);
code = cm_NameI(cm_data.rootSCachep, pathName,
/* try to get the vnode for the path name next */
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, NULL, pathp);
code = smb_LookupTIDPath(vcp, p->tid, &tidPathp);
if (code) {
code = 0;
} else {
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, NULL, pathp);
code = smb_LookupTIDPath(vcp, p->tid, &tidPathp);
if (code) {
}
spacep = inp->spacep;
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastNamep, pathp);
if (lastNamep &&
realPathp[nameLength/sizeof(clientchar_t)] = 0;
spacep = inp->spacep;
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastNamep, realPathp);
osi_Log1(smb_logp,"NTCreateX for [%S]",osi_LogSaveClientString(smb_logp,realPathp));
memcpy(realPathp, pathp, nameLength);
realPathp[nameLength/sizeof(clientchar_t)] = 0;
spacep = cm_GetSpace();
+ /* smb_StripLastComponent will strip "::$DATA" if present */
smb_StripLastComponent(spacep->wdata, &lastNamep, realPathp);
osi_Log1(smb_logp,"NTTranCreate %S",osi_LogSaveStringW(smb_logp,realPathp));