summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-01 13:35:28 -0800
committerJeremy Allison <jra@samba.org>2008-12-01 13:35:28 -0800
commit4659215a00da0e2ef65d98e6feb020c89563cdba (patch)
tree2d1fa73b83daafcdc2c67cda94f62962f4fd455c
parentff7de4afe199b7e4a1b40a00bf5f817172ebbcbf (diff)
downloadsamba-4659215a00da0e2ef65d98e6feb020c89563cdba.tar.gz
samba-4659215a00da0e2ef65d98e6feb020c89563cdba.tar.bz2
samba-4659215a00da0e2ef65d98e6feb020c89563cdba.zip
s3:smbd: return DELETE_PENDING on path based operations on streams, when the main file was deleted.
metze
-rw-r--r--source3/smbd/trans2.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 8532c85d7b..cc7b87f448 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3999,6 +3999,46 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return;
}
+ if ((conn->fs_capabilities & FILE_NAMED_STREAMS)
+ && is_ntfs_stream_name(fname)) {
+ char *base;
+ SMB_STRUCT_STAT bsbuf;
+
+ status = split_ntfs_stream_name(talloc_tos(), fname,
+ &base, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(10, ("create_file_unixpath: "
+ "split_ntfs_stream_name failed: %s\n",
+ nt_errstr(status)));
+ reply_nterror(req, status);
+ return;
+ }
+
+ SMB_ASSERT(!is_ntfs_stream_name(base)); /* paranoia.. */
+
+ if (INFO_LEVEL_IS_UNIX(info_level)) {
+ /* Always do lstat for UNIX calls. */
+ if (SMB_VFS_LSTAT(conn,base,&bsbuf)) {
+ DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_LSTAT of %s failed (%s)\n",base,strerror(errno)));
+ reply_unixerror(req,ERRDOS,ERRbadpath);
+ return;
+ }
+ } else {
+ if (SMB_VFS_STAT(conn,base,&bsbuf) != 0) {
+ DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s failed (%s)\n",base,strerror(errno)));
+ reply_unixerror(req,ERRDOS,ERRbadpath);
+ return;
+ }
+ }
+
+ fileid = vfs_file_id_from_sbuf(conn, &bsbuf);
+ get_file_infos(fileid, &delete_pending, NULL);
+ if (delete_pending) {
+ reply_nterror(req, NT_STATUS_DELETE_PENDING);
+ return;
+ }
+ }
+
if (INFO_LEVEL_IS_UNIX(info_level)) {
/* Always do lstat for UNIX calls. */
if (SMB_VFS_LSTAT(conn,fname,&sbuf)) {