&info, &fsp);
if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBopen);
if (open_was_deferred(req->mid)) {
/* We have re-scheduled this call. */
- END_PROFILE(SMBopen);
+ return;
+ }
+ if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+ /*
+ * We hit an existing file, and if we're returning DOS
+ * error codes OBJECT_NAME_COLLISION would map to
+ * ERRDOS/183, we need to return ERRDOS/80, see bug
+ * 4852.
+ */
+ reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
+ ERRDOS, ERRfilexists);
return;
}
reply_nterror(req, status);
- END_PROFILE(SMBopen);
return;
}
END_PROFILE(SMBopenX);
if (open_was_deferred(req->mid)) {
/* We have re-scheduled this call. */
- END_PROFILE(SMBopenX);
return;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
*/
reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
ERRDOS, ERRfilexists);
- END_PROFILE(SMBopenX);
return;
}
reply_nterror(req, status);
- END_PROFILE(SMBopenX);
return;
}
close(tmpfd);
if (!NT_STATUS_IS_OK(status)) {
+ END_PROFILE(SMBctemp);
if (open_was_deferred(req->mid)) {
/* We have re-scheduled this call. */
- END_PROFILE(SMBctemp);
+ return;
+ }
+ if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+ /*
+ * We hit an existing file, and if we're returning DOS
+ * error codes OBJECT_NAME_COLLISION would map to
+ * ERRDOS/183, we need to return ERRDOS/80, see bug
+ * 4852.
+ */
+ reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
+ ERRDOS, ERRfilexists);
return;
}
reply_nterror(req, status);
- END_PROFILE(SMBctemp);
return;
}
* ERRDOS/183, we need to return ERRDOS/80, see bug
* 4852.
*/
- return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+ reply_botherror(req,
+ NT_STATUS_OBJECT_NAME_COLLISION,
ERRDOS, ERRfilexists);
+ return;
}
reply_nterror(req, status);