int info;
SMB_OFF_T ret=-1;
NTSTATUS status = NT_STATUS_OK;
+ char *parent;
ZERO_STRUCT(sbuf1);
ZERO_STRUCT(sbuf2);
/* Grrr. We have to do this as open_file_ntcreate adds aARCH when it
creates the file. This isn't the correct thing to do in the copy
case. JRA */
- file_set_dosmode(conn, newname, fattr, &sbuf2,
- parent_dirname(newname),false);
+ if (!parent_dirname_talloc(talloc_tos(), newname, &parent, NULL)) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ file_set_dosmode(conn, newname, fattr, &sbuf2, parent, false);
+ TALLOC_FREE(parent);
if (ret < (SMB_OFF_T)sbuf1.st_size) {
return NT_STATUS_DISK_FULL;