From 275f32ae2df333c089343dd20fc4efee1bed2b7b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Apr 2008 11:31:17 +0200 Subject: fill in unknown fields in SMB2 READ call (This used to be commit 9b686c138037f613da15168d0722786e00f023e5) --- source4/ntvfs/ntvfs_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index e1a86c07c0..fee3269eaf 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -1214,7 +1214,8 @@ static NTSTATUS ntvfs_map_read_finish(struct ntvfs_module_context *ntvfs, break; case RAW_READ_SMB2: rd->smb2.out.data.length= rd2->generic.out.nread; - rd->smb2.out.unknown1 = 0; + rd->smb2.out.remaining = 0; + rd->smb2.out.reserved = 0; break; default: return NT_STATUS_INVALID_LEVEL; -- cgit From f78bc8c489b02b521e9ecbdbdc72d160c6911b6b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 11:54:50 +0200 Subject: Remove prototypes from build.h in preparation of removing build.h altogether. (This used to be commit dbeab2a9cdee4e5f69afeb2603ba29cbed56debd) --- source4/ntvfs/ntvfs_base.c | 10 ++++++++++ source4/ntvfs/sysdep/sys_lease.c | 1 + source4/ntvfs/sysdep/sys_notify.c | 1 + 3 files changed, 12 insertions(+) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c index 51faa44372..8f574fa96b 100644 --- a/source4/ntvfs/ntvfs_base.c +++ b/source4/ntvfs/ntvfs_base.c @@ -204,6 +204,16 @@ NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, e NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx) { static bool initialized = false; + extern NTSTATUS ntvfs_posix_init(void); + extern NTSTATUS ntvfs_cifs_init(void); + extern NTSTATUS ntvfs_nbench_init(void); + extern NTSTATUS ntvfs_unixuid_init(void); + extern NTSTATUS ntvfs_ipc_init(void); + extern NTSTATUS pvfs_acl_nfs4_init(void); + extern NTSTATUS pvfs_acl_xattr_init(void); + extern NTSTATUS ntvfs_print_init(void); + extern NTSTATUS ntvfs_simple_init(void); + extern NTSTATUS ntvfs_cifs_posix_init(void); init_module_fn static_init[] = { STATIC_ntvfs_MODULES }; init_module_fn *shared_init; diff --git a/source4/ntvfs/sysdep/sys_lease.c b/source4/ntvfs/sysdep/sys_lease.c index 28dd27a708..b8a165aa51 100644 --- a/source4/ntvfs/sysdep/sys_lease.c +++ b/source4/ntvfs/sysdep/sys_lease.c @@ -112,6 +112,7 @@ _PUBLIC_ NTSTATUS sys_lease_register(const struct sys_lease_ops *backend) _PUBLIC_ NTSTATUS sys_lease_init(void) { static bool initialized = false; + extern NTSTATUS sys_lease_linux_init(void); init_module_fn static_init[] = { STATIC_sys_lease_MODULES }; diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c index 84ba745f5b..eb5cc3793f 100644 --- a/source4/ntvfs/sysdep/sys_notify.c +++ b/source4/ntvfs/sysdep/sys_notify.c @@ -124,6 +124,7 @@ _PUBLIC_ NTSTATUS sys_notify_register(struct sys_notify_backend *backend) _PUBLIC_ NTSTATUS sys_notify_init(void) { static bool initialized = false; + extern NTSTATUS sys_notify_inotify_init(void); init_module_fn static_init[] = { STATIC_sys_notify_MODULES }; -- cgit From e9017ba418202b4b191c5a9ad4a96857558ce606 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 17:22:58 +0200 Subject: Use _OBJ_FILES variables in a couple more places. (This used to be commit 92856d5054106894b65cd1a1b5119c0facfc4cff) --- source4/ntvfs/common/config.mk | 15 ++++----------- source4/ntvfs/config.mk | 34 +++++++++++++--------------------- source4/ntvfs/posix/config.mk | 26 +++++++++++++++----------- source4/ntvfs/sysdep/config.mk | 26 ++++++++------------------ source4/ntvfs/unixuid/config.mk | 4 ++-- 5 files changed, 42 insertions(+), 63 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/common/config.mk b/source4/ntvfs/common/config.mk index 3963ebcdee..c66257b73f 100644 --- a/source4/ntvfs/common/config.mk +++ b/source4/ntvfs/common/config.mk @@ -2,17 +2,10 @@ # Start LIBRARY ntvfs_common [SUBSYSTEM::ntvfs_common] PRIVATE_PROTO_HEADER = proto.h -OBJ_FILES = \ - init.o \ - brlock.o \ - brlock_tdb.o \ - opendb.o \ - opendb_tdb.o \ - notify.o -PUBLIC_DEPENDENCIES = \ - NDR_OPENDB NDR_NOTIFY \ - sys_notify sys_lease \ - share LIBDBWRAP +PUBLIC_DEPENDENCIES = NDR_OPENDB NDR_NOTIFY sys_notify sys_lease share LIBDBWRAP PRIVATE_DEPENDENCIES = brlock_ctdb opendb_ctdb # End LIBRARY ntvfs_common ################################################ + +ntvfs_common_OBJ_FILES = $(addprefix ntvfs/common/, init.o brlock.o brlock_tdb.o opendb.o opendb_tdb.o notify.o) + diff --git a/source4/ntvfs/config.mk b/source4/ntvfs/config.mk index 2f57c787ef..93cbf64d8f 100644 --- a/source4/ntvfs/config.mk +++ b/source4/ntvfs/config.mk @@ -9,25 +9,24 @@ mkinclude sysdep/config.mk [MODULE::ntvfs_cifs] INIT_FUNCTION = ntvfs_cifs_init SUBSYSTEM = ntvfs -OBJ_FILES = \ - cifs/vfs_cifs.o PRIVATE_DEPENDENCIES = \ LIBCLI_SMB LIBCLI_RAW # End MODULE ntvfs_cifs ################################################ +ntvfs_cifs_OBJ_FILES = ntvfs/cifs/vfs_cifs.o + ################################################ # Start MODULE ntvfs_simple [MODULE::ntvfs_simple] INIT_FUNCTION = ntvfs_simple_init SUBSYSTEM = ntvfs PRIVATE_PROTO_HEADER = simple/proto.h -OBJ_FILES = \ - simple/vfs_simple.o \ - simple/svfs_util.o # End MODULE ntvfs_simple ################################################ +ntvfs_simple_OBJ_FILES = $(addprefix ntvfs/simple/, vfs_simple.o svfs_util.o) + ################################################ # Start MODULE ntvfs_cifsposix [MODULE::ntvfs_cifsposix] @@ -35,57 +34,50 @@ OBJ_FILES = \ INIT_FUNCTION = ntvfs_cifs_posix_init SUBSYSTEM = ntvfs PRIVATE_PROTO_HEADER = cifs_posix_cli/proto.h -OBJ_FILES = \ - cifs_posix_cli/vfs_cifs_posix.o \ - cifs_posix_cli/svfs_util.o # End MODULE ntvfs_cifsposix ################################################ +ntvfs_cifsposix_OBJ_FILES = \ + $(addprefix ntvfs/cifs_posix_cli/, vfs_cifs_posix.o svfs_util.o) + ################################################ # Start MODULE ntvfs_print [MODULE::ntvfs_print] INIT_FUNCTION = ntvfs_print_init SUBSYSTEM = ntvfs -OBJ_FILES = \ - print/vfs_print.o # End MODULE ntvfs_print ################################################ +ntvfs_print_OBJ_FILES = ntvfs/print/vfs_print.o + ################################################ # Start MODULE ntvfs_ipc [MODULE::ntvfs_ipc] SUBSYSTEM = ntvfs INIT_FUNCTION = ntvfs_ipc_init PRIVATE_PROTO_HEADER = ipc/proto.h -OBJ_FILES = \ - ipc/vfs_ipc.o \ - ipc/ipc_rap.o \ - ipc/rap_server.o PRIVATE_DEPENDENCIES = dcerpc_server DCERPC_COMMON # End MODULE ntvfs_ipc ################################################ +ntvfs_ipc_OBJ_FILES = $(addprefix ntvfs/ipc/, vfs_ipc.o ipc_rap.o rap_server.o) ################################################ # Start MODULE ntvfs_nbench [MODULE::ntvfs_nbench] SUBSYSTEM = ntvfs INIT_FUNCTION = ntvfs_nbench_init -OBJ_FILES = \ - nbench/vfs_nbench.o # End MODULE ntvfs_nbench ################################################ +ntvfs_nbench_OBJ_FILES = ntvfs/nbench/vfs_nbench.o ################################################ # Start SUBSYSTEM NTVFS [SUBSYSTEM::ntvfs] PRIVATE_PROTO_HEADER = ntvfs_proto.h -OBJ_FILES = \ - ntvfs_base.o \ - ntvfs_generic.o \ - ntvfs_interface.o \ - ntvfs_util.o + +ntvfs_OBJ_FILES = $(addprefix ntvfs/, ntvfs_base.o ntvfs_generic.o ntvfs_interface.o ntvfs_util.o) # PUBLIC_HEADERS += ntvfs/ntvfs.h # diff --git a/source4/ntvfs/posix/config.mk b/source4/ntvfs/posix/config.mk index 88048c2af7..865a0ffd4a 100644 --- a/source4/ntvfs/posix/config.mk +++ b/source4/ntvfs/posix/config.mk @@ -3,30 +3,31 @@ [MODULE::pvfs_acl_xattr] INIT_FUNCTION = pvfs_acl_xattr_init SUBSYSTEM = ntvfs -OBJ_FILES = \ - pvfs_acl_xattr.o PRIVATE_DEPENDENCIES = NDR_XATTR ntvfs_posix # End MODULE pvfs_acl_xattr ################################################ +pvfs_acl_xattr_OBJ_FILES = ntvfs/posix/pvfs_acl_xattr.o + ################################################ # Start MODULE pvfs_acl_nfs4 [MODULE::pvfs_acl_nfs4] INIT_FUNCTION = pvfs_acl_nfs4_init SUBSYSTEM = ntvfs -OBJ_FILES = \ - pvfs_acl_nfs4.o PRIVATE_DEPENDENCIES = NDR_NFS4ACL SAMDB ntvfs_posix # End MODULE pvfs_acl_nfs4 ################################################ +pvfs_acl_nfs4_OBJ_FILES = ntvfs/posix/pvfs_acl_nfs4.o + ################################################ [MODULE::pvfs_aio] SUBSYSTEM = ntvfs -OBJ_FILES = pvfs_aio.o PRIVATE_DEPENDENCIES = LIBAIO_LINUX ################################################ +pvfs_aio_OBJ_FILES = ntvfs/posix/pvfs_aio.o + ################################################ # Start MODULE ntvfs_posix [MODULE::ntvfs_posix] @@ -34,7 +35,13 @@ SUBSYSTEM = ntvfs OUTPUT_TYPE = MERGED_OBJ INIT_FUNCTION = ntvfs_posix_init PRIVATE_PROTO_HEADER = vfs_posix_proto.h -OBJ_FILES = \ +#PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4 +PRIVATE_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING pvfs_aio \ + LIBWBCLIENT +# End MODULE ntvfs_posix +################################################ + +ntvfs_posix_OBJ_FILES = $(addprefix ntvfs/posix/, \ vfs_posix.o \ pvfs_util.o \ pvfs_search.o \ @@ -62,8 +69,5 @@ OBJ_FILES = \ pvfs_acl.o \ pvfs_notify.o \ xattr_system.o \ - xattr_tdb.o -#PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4 -PRIVATE_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING pvfs_aio -# End MODULE ntvfs_posix -################################################ + xattr_tdb.o) + diff --git a/source4/ntvfs/sysdep/config.mk b/source4/ntvfs/sysdep/config.mk index 048226efad..de445bff7b 100644 --- a/source4/ntvfs/sysdep/config.mk +++ b/source4/ntvfs/sysdep/config.mk @@ -3,34 +3,24 @@ [MODULE::sys_notify_inotify] SUBSYSTEM = sys_notify INIT_FUNCTION = sys_notify_inotify_init -OBJ_FILES = \ - inotify.o # End MODULE sys_notify_inotify ################################################ +sys_notify_inotify_OBJ_FILES = ntvfs/sysdep/inotify.o + ################################################ # Start SUBSYSTEM sys_notify [SUBSYSTEM::sys_notify] -OBJ_FILES = \ - sys_notify.o -PUBLIC_DEPENDENCIES = # End SUBSYSTEM sys_notify ################################################ -################################################ -# Start MODULE sys_lease_linux +sys_notify_OBJ_FILES = ntvfs/sysdep/sys_notify.o + [MODULE::sys_lease_linux] SUBSYSTEM = sys_lease -INIT_FUNCTION = sys_lease_linux_init -OBJ_FILES = \ - sys_lease_linux.o -# End MODULE sys_lease_linux -################################################ -################################################ -# Start SUBSYSTEM sys_lease +sys_lease_linux_OBJ_FILES = ntvfs/sysdep/sys_lease_linux.o + [SUBSYSTEM::sys_lease] -OBJ_FILES = \ - sys_lease.o -# End SUBSYSTEM sys_lease -################################################ + +sys_lease_OBJ_FILES = ntvfs/sysdep/sys_lease.o diff --git a/source4/ntvfs/unixuid/config.mk b/source4/ntvfs/unixuid/config.mk index 91976c6811..968e56bde4 100644 --- a/source4/ntvfs/unixuid/config.mk +++ b/source4/ntvfs/unixuid/config.mk @@ -3,8 +3,8 @@ [MODULE::ntvfs_unixuid] INIT_FUNCTION = ntvfs_unixuid_init SUBSYSTEM = ntvfs -OBJ_FILES = \ - vfs_unixuid.o PRIVATE_DEPENDENCIES = SAMDB NSS_WRAPPER # End MODULE ntvfs_unixuid ################################################ + +ntvfs_unixuid_OBJ_FILES = ntvfs/unixuid/vfs_unixuid.o -- cgit From 292ed5d04f9b7442bf878c36be24a46fc0373d9c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Apr 2008 18:44:43 +0200 Subject: fixed an unitialised write warning in valgrind the 'reserved' field was not being initialised before being pushed to the wire (This used to be commit dfe4b5009885c4eeca24569f35b9fc85bfe6346b) --- source4/ntvfs/ntvfs_generic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index fee3269eaf..01c3a16433 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -209,6 +209,7 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, case RAW_OPEN_SMB2: io->smb2.out.file.ntvfs = io2->generic.out.file.ntvfs; io->smb2.out.oplock_level = 0; + io->smb2.out.reserved = 0; io->smb2.out.create_action = io2->generic.out.create_action; io->smb2.out.create_time = io2->generic.out.create_time; io->smb2.out.access_time = io2->generic.out.access_time; -- cgit From 79af7ff2f7f6fabe8a2a48386088228096e218b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Apr 2008 18:59:40 +0200 Subject: fixed a valgrind error in id mapping the status field is sent on both call and reply, but was only being initialised on reply (This used to be commit 2ebd7b80998775168959d511fbc987f8b5b7bd34) --- source4/ntvfs/posix/pvfs_acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c index 2393a2e7a3..f1e469f790 100644 --- a/source4/ntvfs/posix/pvfs_acl.c +++ b/source4/ntvfs/posix/pvfs_acl.c @@ -135,7 +135,7 @@ static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs, } sd = *psd; - ids = talloc_array(sd, struct id_mapping, 2); + ids = talloc_zero_array(sd, struct id_mapping, 2); NT_STATUS_HAVE_NO_MEMORY(ids); ids[0].unixid = talloc(ids, struct unixid); -- cgit From a195cd9d8f3d0c0185fbf82388bd1efaa63e7bd5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 16 Apr 2008 22:52:07 +0200 Subject: Use readily available event context. (This used to be commit 2823fca23a4cacc996c808f22cba50b4482b5921) --- source4/ntvfs/posix/vfs_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index ebc2d88e70..14b5210fd0 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -219,7 +219,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, pvfs->ntvfs->ctx->lp_ctx, - event_context_find(pvfs), + pvfs->ntvfs->ctx->event_ctx, pvfs->ntvfs->ctx->config); pvfs->wbc_ctx = wbc_init(pvfs, -- cgit From 1efbd5fbf6b0f606ed29a763e2adfa6f99c6beac Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 01:03:18 +0200 Subject: Remove event context tracking from the credentials struct. (This used to be commit 4d7fc946b2ec50e774689c9036423b6feef99b8e) --- source4/ntvfs/cifs/vfs_cifs.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index 2feb1a0efe..2b61268733 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -171,7 +171,6 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, if (!credentials) { return NT_STATUS_NO_MEMORY; } - cli_credentials_set_event_context(credentials, ntvfs->ctx->event_ctx); cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); cli_credentials_set_username(credentials, user, CRED_SPECIFIED); if (domain) { @@ -181,7 +180,6 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, } else if (machine_account) { DEBUG(5, ("CIFS backend: Using machine account\n")); credentials = cli_credentials_init(private); - cli_credentials_set_event_context(credentials, ntvfs->ctx->event_ctx); cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); if (domain) { cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED); -- cgit From c15ffa27cb3a1cadbbf06d564146c1ab8dec952b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 01:19:53 +0200 Subject: Explicitly require event context to be specified. (This used to be commit a95a71fe45ef6a578569931a7c38061783d07db3) --- source4/ntvfs/common/notify.c | 4 ++++ source4/ntvfs/sysdep/sys_notify.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index 23aa3fb668..9055d6ece3 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -93,6 +93,10 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, return NULL; } + if (ev == NULL) { + return NULL; + } + notify = talloc(mem_ctx, struct notify_context); if (notify == NULL) { return NULL; diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c index eb5cc3793f..22b72c4d63 100644 --- a/source4/ntvfs/sysdep/sys_notify.c +++ b/source4/ntvfs/sysdep/sys_notify.c @@ -52,7 +52,7 @@ _PUBLIC_ struct sys_notify_context *sys_notify_context_create(struct share_confi } if (ev == NULL) { - ev = event_context_find(mem_ctx); + return NULL; } ctx = talloc_zero(mem_ctx, struct sys_notify_context); -- cgit From 14023e502b7a1043afe0dde7f1c60a4b29a76646 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 01:22:39 +0200 Subject: Require explicit event context rather than looking if it is not specified. (This used to be commit 1da0063bd5fd18ad3ac7a07c985ec6be380486e2) --- source4/ntvfs/sysdep/sys_lease.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/sysdep/sys_lease.c b/source4/ntvfs/sysdep/sys_lease.c index b8a165aa51..e6b11c450a 100644 --- a/source4/ntvfs/sysdep/sys_lease.c +++ b/source4/ntvfs/sysdep/sys_lease.c @@ -55,7 +55,7 @@ _PUBLIC_ struct sys_lease_context *sys_lease_context_create(struct share_config } if (ev == NULL) { - ev = event_context_find(mem_ctx); + return NULL; } ctx = talloc_zero(mem_ctx, struct sys_lease_context); -- cgit From baad7a7e56e2b0f24885e01672cd9bdc6667a6a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 17 Apr 2008 03:54:26 +0200 Subject: ntvfs_generic: map SMB2 oplock levels to the generic ones metze (This used to be commit 9013748273378f88bfc66d3583814f0fee67c40f) --- source4/ntvfs/ntvfs_generic.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index fee3269eaf..5d4bbf388c 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -208,7 +208,21 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, case RAW_OPEN_SMB2: io->smb2.out.file.ntvfs = io2->generic.out.file.ntvfs; - io->smb2.out.oplock_level = 0; + switch (io2->generic.out.oplock_level) { + case OPLOCK_BATCH: + io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_BATCH; + break; + case OPLOCK_EXCLUSIVE: + io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_EXCLUSIVE; + break; + case OPLOCK_LEVEL_II: + io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_II; + break; + default: + io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_NONE; + break; + } + io->smb2.out.reserved = 0; io->smb2.out.create_action = io2->generic.out.create_action; io->smb2.out.create_time = io2->generic.out.create_time; io->smb2.out.access_time = io2->generic.out.access_time; @@ -484,7 +498,18 @@ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs, status = ntvfs->ops->open(ntvfs, req, io2); break; case RAW_OPEN_SMB2: - io2->generic.in.flags = 0; + switch (io->smb2.in.oplock_level) { + case SMB2_OPLOCK_LEVEL_BATCH: + io2->generic.in.flags = NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK | + NTCREATEX_FLAGS_REQUEST_OPLOCK; + break; + case SMB2_OPLOCK_LEVEL_EXCLUSIVE: + io2->generic.in.flags = NTCREATEX_FLAGS_REQUEST_OPLOCK; + break; + default: + io2->generic.in.flags = 0; + break; + } io2->generic.in.root_fid = 0; io2->generic.in.access_mask = io->smb2.in.desired_access; io2->generic.in.alloc_size = 0; -- cgit From 21fc7673780aa1d7c0caab7b17ff9171238913ba Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 12:23:44 +0200 Subject: Specify event_context to ldb_wrap_connect explicitly. (This used to be commit b4e1ae07a284c044704322446c94351c2decff91) --- source4/ntvfs/ipc/ipc_rap.c | 11 ++++++++--- source4/ntvfs/ipc/rap_server.c | 3 ++- source4/ntvfs/ipc/vfs_ipc.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c index faf48705c4..4969f1a791 100644 --- a/source4/ntvfs/ipc/ipc_rap.c +++ b/source4/ntvfs/ipc/ipc_rap.c @@ -21,6 +21,7 @@ #include "includes.h" #include "libcli/raw/interfaces.h" #include "libcli/rap/rap.h" +#include "events/events.h" #include "ntvfs/ipc/proto.h" #include "librpc/ndr/libndr.h" #include "param/param.h" @@ -100,11 +101,14 @@ struct rap_call { struct ndr_pull *ndr_pull_param; struct ndr_pull *ndr_pull_data; + + struct event_context *event_ctx; }; #define RAPNDR_FLAGS (LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx, + struct event_context *ev_ctx, struct loadparm_context *lp_ctx, struct smb_trans2 *trans) { @@ -118,6 +122,7 @@ static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx, ZERO_STRUCTP(call); call->lp_ctx = talloc_reference(call, lp_ctx); + call->event_ctx = ev_ctx; call->mem_ctx = mem_ctx; @@ -271,7 +276,7 @@ static NTSTATUS _rap_netshareenum(struct rap_call *call) break; } - result = rap_netshareenum(call, call->lp_ctx, &r); + result = rap_netshareenum(call, call->event_ctx, call->lp_ctx, &r); if (!NT_STATUS_IS_OK(result)) return result; @@ -430,7 +435,7 @@ static const struct {NULL, -1, api_Unsupported} }; -NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, +NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, struct loadparm_context *lp_ctx, struct smb_trans2 *trans) { int i; @@ -440,7 +445,7 @@ NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct ndr_push *final_param; struct ndr_push *final_data; - call = new_rap_srv_call(mem_ctx, lp_ctx, trans); + call = new_rap_srv_call(mem_ctx, event_ctx, lp_ctx, trans); if (call == NULL) return NT_STATUS_NO_MEMORY; diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c index 633f0bf36e..d9fb7e21b2 100644 --- a/source4/ntvfs/ipc/rap_server.c +++ b/source4/ntvfs/ipc/rap_server.c @@ -29,6 +29,7 @@ * idea. */ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx, + struct event_context *event_ctx, struct loadparm_context *lp_ctx, struct rap_NetShareEnum *r) { @@ -42,7 +43,7 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx, r->out.available = 0; r->out.info = NULL; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(lp_ctx), lp_ctx, &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return nterr; } diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 92f0eadae1..ea7b54ae6a 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -805,7 +805,7 @@ static NTSTATUS ipc_trans(struct ntvfs_module_context *ntvfs, NTSTATUS status; if (strequal(trans->in.trans_name, "\\PIPE\\LANMAN")) - return ipc_rap_call(req, ntvfs->ctx->lp_ctx, trans); + return ipc_rap_call(req, ntvfs->ctx->event_ctx, ntvfs->ctx->lp_ctx, trans); if (trans->in.setup_count != 2) { return NT_STATUS_INVALID_PARAMETER; -- cgit From b2f2c1486e9c6bd6fdba3dc321f9df0d29d7def2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 19 Apr 2008 00:14:52 +0200 Subject: ntvfs_generic: fix mapping the granted oplocks for SMB2 metze (This used to be commit 60c4a4fc1afe88716ac63d3ea430e07fea7b9991) --- source4/ntvfs/ntvfs_generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 5d4bbf388c..debcfc3f8a 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -209,13 +209,13 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, case RAW_OPEN_SMB2: io->smb2.out.file.ntvfs = io2->generic.out.file.ntvfs; switch (io2->generic.out.oplock_level) { - case OPLOCK_BATCH: + case BATCH_OPLOCK_RETURN: io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_BATCH; break; - case OPLOCK_EXCLUSIVE: + case EXCLUSIVE_OPLOCK_RETURN: io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_EXCLUSIVE; break; - case OPLOCK_LEVEL_II: + case LEVEL_II_OPLOCK_RETURN: io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_II; break; default: -- cgit From 39d23027218c02dc3055d8a0cc28dcc169e8b064 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 18 Apr 2008 22:32:25 +0200 Subject: ntvfs_generic: map RAW_LOCK_SMB2_BREAK to RAW_LOCK_GENERIC metze (This used to be commit b781bb733c9a563457f87c94abe8c91b426c07ee) --- source4/ntvfs/ntvfs_generic.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index debcfc3f8a..3653ad82c1 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -1043,6 +1043,23 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs, /* initialize output value */ lck->smb2.out.unknown1 = 0; break; + + case RAW_LOCK_SMB2_BREAK: + lck2->generic.level = RAW_LOCK_GENERIC; + lck2->generic.in.file.ntvfs = lck->smb2_break.in.file.ntvfs; + lck2->generic.in.mode = LOCKING_ANDX_OPLOCK_RELEASE | + ((lck->smb2_break.in.oplock_level << 8) & 0xFF00); + lck2->generic.in.timeout = 0; + lck2->generic.in.ulock_cnt = 0; + lck2->generic.in.lock_cnt = 0; + lck2->generic.in.locks = NULL; + + /* initialize output value */ + lck->smb2_break.out.oplock_level= lck->smb2_break.in.oplock_level; + lck->smb2_break.out.reserved = lck->smb2_break.in.reserved; + lck->smb2_break.out.reserved2 = lck->smb2_break.in.reserved2; + lck->smb2_break.out.file = lck->smb2_break.in.file; + break; } /* -- cgit