summaryrefslogtreecommitdiff
path: root/source3/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
commit1069cfe4ade88a032164c1242c9480a544584655 (patch)
tree1a4eef94986ffe072371e2fbdebf3cca7452aef6 /source3/smbd/reply.c
parent2411c6cb90e485bd289b8b654db1c632556bfb2d (diff)
downloadsamba-1069cfe4ade88a032164c1242c9480a544584655.tar.gz
samba-1069cfe4ade88a032164c1242c9480a544584655.tar.bz2
samba-1069cfe4ade88a032164c1242c9480a544584655.zip
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. (This used to be commit 6022873cc155bdbbd3fb620689715f07a24d6ed1)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 381ddfe151..61ec611b6b 100644
--- a/source3/smbd/reply.c
+++ b/source3/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",