summaryrefslogtreecommitdiff
path: root/source/smbd/reply.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-19 23:25:36 +0100
committerVolker Lendecke <vl@samba.org>2008-01-19 23:25:36 +0100
commit6022873cc155bdbbd3fb620689715f07a24d6ed1 (patch)
tree754fe105f06e06d50fef5c079fe8bf5012384d82 /source/smbd/reply.c
parentd813bd9e02d9baf916eb96c478be89f0c435e07c (diff)
downloadsamba-6022873cc155bdbbd3fb620689715f07a24d6ed1.tar.gz
Add streams support
This is the core of the streams support. The main change is that in files_struct there is now a base_fsp pointer that holds the main file open while a stream is open. This is necessary to get the rather strange delete semantics right: You can't delete the main file while a stream is open without FILE_SHARE_DELETE, and while a stream is open a successful unlink of the main file leads to DELETE_PENDING for all further access on the main file or any stream.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r--source/smbd/reply.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 381ddfe1517..61ec611b6b5 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -167,6 +167,10 @@ static NTSTATUS check_path_syntax_internal(char *path,
}
*d = '\0';
+
+ if (NT_STATUS_IS_OK(ret) && !posix_path) {
+ ret = split_ntfs_stream_name(NULL, path, NULL, NULL);
+ }
return ret;
}
@@ -2289,14 +2293,22 @@ static NTSTATUS do_unlink(connection_struct *conn,
/* On open checks the open itself will check the share mode, so
don't do it here as we'll get it wrong. */
- status = open_file_ntcreate(conn, req, fname, &sbuf,
- DELETE_ACCESS,
- FILE_SHARE_NONE,
- FILE_OPEN,
- 0,
- FILE_ATTRIBUTE_NORMAL,
- req != NULL ? 0 : INTERNAL_OPEN_ONLY,
- NULL, &fsp);
+ status = create_file_unixpath
+ (conn, /* conn */
+ req, /* req */
+ fname, /* fname */
+ DELETE_ACCESS, /* access_mask */
+ FILE_SHARE_NONE, /* share_access */
+ FILE_OPEN, /* create_disposition*/
+ FILE_NON_DIRECTORY_FILE, /* create_options */
+ FILE_ATTRIBUTE_NORMAL, /* file_attributes */
+ 0, /* oplock_request */
+ 0, /* allocation_size */
+ NULL, /* sd */
+ NULL, /* ea_list */
+ &fsp, /* result */
+ NULL, /* pinfo */
+ &sbuf); /* psbuf */
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("open_file_ntcreate failed: %s\n",