[SCM] Samba Shared Repository - branch master updated
Stefan Metzmacher
metze at samba.org
Thu Jun 14 21:39:02 UTC 2018
The branch, master has been updated
via 5ef6775 smbd: don't call change_to_root_user() before change_to_guest()
via 9393d95 smbd: remove useless allow_access() check for AS_GUEST
via 51407b9 smbd: split out a fsp_flush_write_time_update() function from update_write_time_handler()
via 553df61 smbd: make smbd_setup_sig_{term,hup}_handler() static
via 55b1b55 vfs_glusterfs: use tevent_req_defer_callback() in order to use the correct event context
via efce558 smbd: call samba_tevent_context_init() within create_conn_struct_as_root()
via ee8ea5c smbd: use pconn = talloc_move(ctx, &conn) in create_conn_struct_as_root()
via d156483 smbd: remove unused create_conn_struct() function
via b5302c6 smbd: let create_conn_struct_tos() use create_conn_struct_as_root() directly
via b71362b vfstest: make use of create_conn_struct_tos()
via cdb875f smbd: remove unused create_conn_struct_cwd() function
via 240c47c printing: convert delete_driver_files() to use create_conn_struct_tos_cwd()
via ae32a26 printing: convert move_driver_to_download_area() to use create_conn_struct_tos_cwd()
via 76297c3 printing: convert get_correct_cversion() to use create_conn_struct_tos_cwd()
via e56bb42 printing: add an explicit talloc_stackframe() to delete_driver_files()
via a2ad24f printing: add an explicit talloc_stackframe() to move_driver_to_download_area()
via bad43d3 printing: add an explicit talloc_stackframe() to get_correct_cversion()
via 7d493ea printing: add more 'const' to read only input pointers
via 498830c s3:rpc_server/srvsvc: _srvsvc_NetSetFileSecurity form_junctions() to use create_conn_struct_tos_cwd()
via f9860b6 s3:rpc_server/srvsvc: _srvsvc_NetGetFileSecurity() to use create_conn_struct_tos_cwd()
via 185d471 s3:rpc_server/srvsvc: add an explicit talloc_stackframe() to _srvsvc_NetSetFileSecurity()
via 44e3c03 s3:rpc_server/srvsvc: add an explicit talloc_stackframe() to _srvsvc_NetGetFileSecurity()
via 36d3de0 smbd: convert form_junctions() to use create_conn_struct_tos_cwd()
via bcb4d42 smbd: convert count_dfs_links() to use create_conn_struct_tos_cwd()
via 73e5d47 smbd: convert get_referred_path() to use create_conn_struct_tos_cwd()
via 42610e0 smbd: convert junction_to_local_path() to use create_conn_struct_tos_cwd()
via 2401e25 smbd: add an explicit talloc_stackframe() to form_junctions()
via 15ea2c1 smbd: add an explicit talloc_stackframe() to count_dfs_links()
via e3837d3 smbd: add an explicit talloc_stackframe() to get_referred_path()
via a9f5dcd smbd: add an explicit talloc_stackframe() to {create,remove}_msdfs_link()
via ac922eb s3:rpc_server/fss: make use of create_conn_struct_tos()
via 7983c70 s3:rpc_server/fss: use talloc_stackframe() for temporary memory
via 96ac5a8 smbd: make use of create_conn_struct_tos() in get_nt_acl_no_snum()
via 1566766 pysmbd: make use of create_conn_struct_tos()
via 67ea594 pysmbd: remove explicit talloc_stackframe() from get_conn() and name it get_conn_tos()
via 539f51f pysmbd: fix some talloc_stackframe() memory leaks and clean up the frame hierarchy in make_simple_acl().
via 7ef67df pysmbd: consitently use talloc_stackframe() for temporary memory
via cbde2e3 pysmbd: remove useless explicit conn_free() from set_nt_acl_conn()
via 66bc2c4 smbd: add create_conn_struct_tos[_cwd]() helper functions
via ebae5e0 printing: remove unused arguments from delete_and_reload_printers()
via 72bd688 printing: remove unused arguments from load_printers()
from d33c355 CID 1416475: possibly dereferencing NULL in fruit_pread_meta
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5ef6775919e83fdae66385db8d1579fa259602f1
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed May 23 14:26:37 2018 +0200
smbd: don't call change_to_root_user() before change_to_guest()
This is just an optimization and it makes it clearer
that calling change_to_root_user() just before change_to_guest()
is useless and confusing.
We call change_to_guest() before set_current_service() now,
but that has no impact as we pass 'do_chdir=false'
as AS_GUEST is never mixed with AS_USER or DO_CHDIR.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Thu Jun 14 23:38:55 CEST 2018 on sn-devel-144
commit 9393d95f22276a5374f991746d48050fe0be47c5
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed May 23 14:23:17 2018 +0200
smbd: remove useless allow_access() check for AS_GUEST
We already call allow_access() when we accept the connection
in smbd_add_connection().
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 51407b90d9363341252acdf3663886b22d1ee4c7
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed May 23 09:41:29 2018 +0200
smbd: split out a fsp_flush_write_time_update() function from update_write_time_handler()
It's confusing to call update_write_time_handler() from anywhere,
it should only be called from within the event loop when the
timer expires.
This makes it more obvious that fsp_flush_write_time_update()
doesn't really need an tevent context argument.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 553df61946ae455839a40201250fb97269712e38
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 09:49:40 2018 +0200
smbd: make smbd_setup_sig_{term,hup}_handler() static
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 55b1b5568f109f51d7cb3b707bc9ae761b3c44fa
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed May 23 08:53:47 2018 +0200
vfs_glusterfs: use tevent_req_defer_callback() in order to use the correct event context
The callback and _recv() functions should be called from the same
event context that was passed to the _send() function.
In future the completion pipe should be replaced by
tevent_threaded_context_create()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit efce5587973f4b03ae63b20c7fd68c7daaf77c3a
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 08:49:29 2018 +0200
smbd: call samba_tevent_context_init() within create_conn_struct_as_root()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ee8ea5ce01ab137c8f28cd7d70c59c09ce3f07d3
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 08:49:29 2018 +0200
smbd: use pconn = talloc_move(ctx, &conn) in create_conn_struct_as_root()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit d156483d6440a21dfe52b97006f58bf771be5733
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 08:49:29 2018 +0200
smbd: remove unused create_conn_struct() function
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b5302c6bc4a7bec0773dee2695b72a65c720b0c4
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 08:49:29 2018 +0200
smbd: let create_conn_struct_tos() use create_conn_struct_as_root() directly
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b71362b17699a47217a2676153db044d0e5a5a79
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 08:49:29 2018 +0200
vfstest: make use of create_conn_struct_tos()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit cdb875f5f7cc7cd17af34b8dd9352f6e69e492dd
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 08:49:29 2018 +0200
smbd: remove unused create_conn_struct_cwd() function
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 240c47c2aa3f27d7265ae255a4e42377b95c1876
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
printing: convert delete_driver_files() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ae32a2681a684d27f33dc0f620a1c63103467899
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
printing: convert move_driver_to_download_area() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 76297c3c17c3b1e1d6515fc83cfea608054aa31c
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
printing: convert get_correct_cversion() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e56bb427d3d21ef03fa50a114c377d837de5f3bb
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
printing: add an explicit talloc_stackframe() to delete_driver_files()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a2ad24f8b04bbe581b1f56440bd37c4866e49b27
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
printing: add an explicit talloc_stackframe() to move_driver_to_download_area()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bad43d31316fccd53ccc7671294903cc9c30bd0c
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
printing: add an explicit talloc_stackframe() to get_correct_cversion()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 7d493eaeb11e1652cb1e4d59b3aceb2e33fae400
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
printing: add more 'const' to read only input pointers
This makes it clearer that they won't be changed.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 498830ccd212183a8c352ec5198af948788db519
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
s3:rpc_server/srvsvc: _srvsvc_NetSetFileSecurity form_junctions() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit f9860b67be505bbbff0b56a18d854261c1297e2b
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
s3:rpc_server/srvsvc: _srvsvc_NetGetFileSecurity() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 185d47159a919b5d267c612b5410b68d9e42558e
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
s3:rpc_server/srvsvc: add an explicit talloc_stackframe() to _srvsvc_NetSetFileSecurity()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 44e3c03bc1943aaa6b7ba4b9f6c601252daf0942
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
s3:rpc_server/srvsvc: add an explicit talloc_stackframe() to _srvsvc_NetGetFileSecurity()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 36d3de023fa393461e56f7603f052abb8ca9b7fe
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
smbd: convert form_junctions() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bcb4d421b237c3d2bb3ffe10965f3a67bfa17c3d
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
smbd: convert count_dfs_links() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 73e5d47d32fa6af40667bb151b7c14411bcd987f
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
smbd: convert get_referred_path() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 42610e0ca704d0a73abca8720c84f654595a2eb6
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:55:02 2018 +0200
smbd: convert junction_to_local_path() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 2401e257bb784f9881cd4b860e377163033ad77b
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
smbd: add an explicit talloc_stackframe() to form_junctions()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 15ea2c1b6af1f9e5510846bfd986dbcb9a088424
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
smbd: add an explicit talloc_stackframe() to count_dfs_links()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e3837d36e75f29025155010383e0203d1f7a2388
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
smbd: add an explicit talloc_stackframe() to get_referred_path()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a9f5dcdc6225b1dab3fb6e40f64fe3a8eeb061a9
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:40:27 2018 +0200
smbd: add an explicit talloc_stackframe() to {create,remove}_msdfs_link()
This makes further changes simpler.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ac922ebe1b3b587a2510fb0e0a696f77a72cbdc6
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 17:34:18 2018 +0200
s3:rpc_server/fss: make use of create_conn_struct_tos()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 7983c7084f432c692c43b75f3fee0401c1a87f04
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 16:41:32 2018 +0200
s3:rpc_server/fss: use talloc_stackframe() for temporary memory
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 96ac5a80cbedaf8bd6edc5ba7634aa9622eaef6d
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 16:34:04 2018 +0200
smbd: make use of create_conn_struct_tos() in get_nt_acl_no_snum()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 1566766f38e3cdf84d45285c709236eedcfaa167
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 16:16:19 2018 +0200
pysmbd: make use of create_conn_struct_tos()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 67ea594843dff559f3709046498c224d16141974
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 16:16:19 2018 +0200
pysmbd: remove explicit talloc_stackframe() from get_conn() and name it get_conn_tos()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 539f51f0dfbe4ce317a2978982fd0fc9a7fd6922
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 16:16:19 2018 +0200
pysmbd: fix some talloc_stackframe() memory leaks and clean up the frame hierarchy in make_simple_acl().
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 7ef67df3f3f0df313c21cc123223633df3fa3ce7
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 16:16:19 2018 +0200
pysmbd: consitently use talloc_stackframe() for temporary memory
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit cbde2e348b68a5d638d9bce3f3912a4828cd90c7
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 25 07:38:24 2018 +0200
pysmbd: remove useless explicit conn_free() from set_nt_acl_conn()
The following TALLOC_FREE(frame); will do the same via
conn_free_wrapper().
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 66bc2c4332f475d9b614c442223749a499b39c60
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 24 15:59:43 2018 +0200
smbd: add create_conn_struct_tos[_cwd]() helper functions
This makes it more obvious that the returned connection_struct
is only temporary (and allocated on talloc_tos()!)
It will never allow async requests on a long term
tevent context! So we create a short term event context.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ebae5e055cfb5ad1286e1ad51732e93a7f3b0c78
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed May 23 16:35:20 2018 +0200
printing: remove unused arguments from delete_and_reload_printers()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 72bd6885ab18c920c6ed9e76946fd809e70e2abf
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed May 23 16:35:20 2018 +0200
printing: remove unused arguments from load_printers()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/include/nt_printing.h | 8 +-
source3/modules/vfs_glusterfs.c | 24 +++
source3/printing/load.c | 3 +-
source3/printing/load.h | 3 +-
source3/printing/nt_printing.c | 127 ++++++------
source3/printing/queue_process.c | 4 +-
source3/printing/spoolssd.c | 12 +-
source3/rpc_server/fss/srv_fss_agent.c | 221 ++++++++------------
source3/rpc_server/spoolss/srv_spoolss_nt.c | 4 +-
source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 66 ++----
source3/smbd/close.c | 5 +-
source3/smbd/durable.c | 5 +-
source3/smbd/fileio.c | 19 +-
source3/smbd/lanman.c | 2 +-
source3/smbd/msdfs.c | 311 +++++++++++++++-------------
source3/smbd/posix_acls.c | 18 +-
source3/smbd/process.c | 47 +----
source3/smbd/proto.h | 35 ++--
source3/smbd/pysmbd.c | 118 +++++------
source3/smbd/server_reload.c | 11 +-
source3/torture/vfstest.c | 19 +-
21 files changed, 484 insertions(+), 578 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 688c6b9..f01ffe5 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -164,13 +164,13 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
bool delete_driver_files(const struct auth_session_info *server_info,
const struct spoolss_DriverInfo8 *r);
-WERROR move_driver_to_download_area(struct auth_session_info *session_info,
- struct spoolss_AddDriverInfoCtr *r,
+WERROR move_driver_to_download_area(const struct auth_session_info *session_info,
+ const struct spoolss_AddDriverInfoCtr *r,
const char *driver_directory);
WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx,
- struct auth_session_info *session_info,
- struct spoolss_AddDriverInfoCtr *r,
+ const struct auth_session_info *session_info,
+ const struct spoolss_AddDriverInfoCtr *r,
uint32_t flags,
const char **driver_directory);
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 985a895..c2af793 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -803,6 +803,14 @@ static struct tevent_req *vfs_gluster_pread_send(struct vfs_handle_struct
return tevent_req_post(req, ev);
}
+ /*
+ * aio_glusterfs_done and aio_tevent_fd_done()
+ * use the raw tevent context. We need to use
+ * tevent_req_defer_callback() in order to
+ * use the event context we're started with.
+ */
+ tevent_req_defer_callback(req, ev);
+
PROFILE_TIMESTAMP(&state->start);
ret = glfs_pread_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
fsp), data, n, offset, 0, aio_glusterfs_done,
@@ -839,6 +847,14 @@ static struct tevent_req *vfs_gluster_pwrite_send(struct vfs_handle_struct
return tevent_req_post(req, ev);
}
+ /*
+ * aio_glusterfs_done and aio_tevent_fd_done()
+ * use the raw tevent context. We need to use
+ * tevent_req_defer_callback() in order to
+ * use the event context we're started with.
+ */
+ tevent_req_defer_callback(req, ev);
+
PROFILE_TIMESTAMP(&state->start);
ret = glfs_pwrite_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
fsp), data, n, offset, 0, aio_glusterfs_done,
@@ -941,6 +957,14 @@ static struct tevent_req *vfs_gluster_fsync_send(struct vfs_handle_struct
return tevent_req_post(req, ev);
}
+ /*
+ * aio_glusterfs_done and aio_tevent_fd_done()
+ * use the raw tevent context. We need to use
+ * tevent_req_defer_callback() in order to
+ * use the event context we're started with.
+ */
+ tevent_req_defer_callback(req, ev);
+
PROFILE_TIMESTAMP(&state->start);
ret = glfs_fsync_async(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle,
fsp), aio_glusterfs_done, state);
diff --git a/source3/printing/load.c b/source3/printing/load.c
index 238998d..51495f9 100644
--- a/source3/printing/load.c
+++ b/source3/printing/load.c
@@ -62,8 +62,7 @@ static void add_auto_printers(void)
/***************************************************************************
load automatic printer services from pre-populated pcap cache
***************************************************************************/
-void load_printers(struct tevent_context *ev,
- struct messaging_context *msg_ctx)
+void load_printers(void)
{
SMB_ASSERT(pcap_cache_loaded(NULL));
diff --git a/source3/printing/load.h b/source3/printing/load.h
index 4611e97..36e0a25 100644
--- a/source3/printing/load.h
+++ b/source3/printing/load.h
@@ -22,7 +22,6 @@
/* The following definitions come from printing/load.c */
-void load_printers(struct tevent_context *ev,
- struct messaging_context *msg_ctx);
+void load_printers(void);
#endif /* _PRINTING_LOAD_H_ */
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 1639bfd..633e350 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -980,18 +980,19 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
/****************************************************************************
Determine the correct cVersion associated with an architecture and driver
****************************************************************************/
-static uint32_t get_correct_cversion(struct auth_session_info *session_info,
+static uint32_t get_correct_cversion(const struct auth_session_info *session_info,
const char *architecture,
const char *driverpath_in,
const char *driver_directory,
WERROR *perr)
{
+ TALLOC_CTX *frame = talloc_stackframe();
int cversion = -1;
NTSTATUS nt_status;
struct smb_filename *smb_fname = NULL;
files_struct *fsp = NULL;
+ struct conn_struct_tos *c = NULL;
connection_struct *conn = NULL;
- struct smb_filename *oldcwd_fname = NULL;
char *printdollar = NULL;
char *printdollar_path = NULL;
char *working_dir = NULL;
@@ -1003,6 +1004,7 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info,
if (strcmp(architecture, SPL_ARCH_WIN40) == 0) {
DEBUG(10,("get_correct_cversion: Driver is Win9x, cversion = 0\n"));
*perr = WERR_OK;
+ TALLOC_FREE(frame);
return 0;
}
@@ -1010,26 +1012,30 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info,
if (strcmp(architecture, SPL_ARCH_X64) == 0) {
DEBUG(10,("get_correct_cversion: Driver is x64, cversion = 3\n"));
*perr = WERR_OK;
+ TALLOC_FREE(frame);
return 3;
}
- printdollar_snum = find_service(talloc_tos(), "print$", &printdollar);
+ printdollar_snum = find_service(frame, "print$", &printdollar);
if (!printdollar) {
*perr = WERR_NOT_ENOUGH_MEMORY;
+ TALLOC_FREE(frame);
return -1;
}
if (printdollar_snum == -1) {
*perr = WERR_BAD_NET_NAME;
+ TALLOC_FREE(frame);
return -1;
}
- printdollar_path = lp_path(talloc_tos(), printdollar_snum);
+ printdollar_path = lp_path(frame, printdollar_snum);
if (printdollar_path == NULL) {
*perr = WERR_NOT_ENOUGH_MEMORY;
+ TALLOC_FREE(frame);
return -1;
}
- working_dir = talloc_asprintf(talloc_tos(),
+ working_dir = talloc_asprintf(frame,
"%s/%s",
printdollar_path,
architecture);
@@ -1038,25 +1044,25 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info,
* directory, switch to the driver directory.
*/
if (driver_directory != NULL) {
- working_dir = talloc_asprintf(talloc_tos(), "%s/%s/%s",
+ working_dir = talloc_asprintf(frame, "%s/%s/%s",
printdollar_path,
architecture,
driver_directory);
}
- nt_status = create_conn_struct_cwd(talloc_tos(),
- server_event_context(),
- server_messaging_context(),
- &conn,
- printdollar_snum,
- working_dir,
- session_info, &oldcwd_fname);
+ nt_status = create_conn_struct_tos_cwd(server_messaging_context(),
+ printdollar_snum,
+ working_dir,
+ session_info,
+ &c);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("get_correct_cversion: create_conn_struct "
"returned %s\n", nt_errstr(nt_status)));
*perr = ntstatus_to_werror(nt_status);
+ TALLOC_FREE(frame);
return -1;
}
+ conn = c->conn;
nt_status = set_conn_force_user_group(conn, printdollar_snum);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -1163,20 +1169,14 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info,
error_exit:
unbecome_user();
error_free_conn:
- TALLOC_FREE(smb_fname);
if (fsp != NULL) {
close_file(NULL, fsp, NORMAL_CLOSE);
}
- if (conn != NULL) {
- vfs_ChDir(conn, oldcwd_fname);
- TALLOC_FREE(oldcwd_fname);
- SMB_VFS_DISCONNECT(conn);
- conn_free(conn);
- }
if (!W_ERROR_IS_OK(*perr)) {
cversion = -1;
}
+ TALLOC_FREE(frame);
return cversion;
}
@@ -1191,7 +1191,7 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info,
} while (0);
static WERROR clean_up_driver_struct_level(TALLOC_CTX *mem_ctx,
- struct auth_session_info *session_info,
+ const struct auth_session_info *session_info,
const char *architecture,
const char **driver_path,
const char **data_file,
@@ -1306,8 +1306,8 @@ static WERROR clean_up_driver_struct_level(TALLOC_CTX *mem_ctx,
****************************************************************************/
WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx,
- struct auth_session_info *session_info,
- struct spoolss_AddDriverInfoCtr *r,
+ const struct auth_session_info *session_info,
+ const struct spoolss_AddDriverInfoCtr *r,
uint32_t flags,
const char **driver_directory)
{
@@ -1472,21 +1472,21 @@ static WERROR move_driver_file_to_download_area(TALLOC_CTX *mem_ctx,
return ret;
}
-WERROR move_driver_to_download_area(struct auth_session_info *session_info,
- struct spoolss_AddDriverInfoCtr *r,
+WERROR move_driver_to_download_area(const struct auth_session_info *session_info,
+ const struct spoolss_AddDriverInfoCtr *r,
const char *driver_directory)
{
+ TALLOC_CTX *frame = talloc_stackframe();
struct spoolss_AddDriverInfo3 *driver;
struct spoolss_AddDriverInfo3 converted_driver;
const char *short_architecture;
struct smb_filename *smb_dname = NULL;
char *new_dir = NULL;
+ struct conn_struct_tos *c = NULL;
connection_struct *conn = NULL;
NTSTATUS nt_status;
int i;
- TALLOC_CTX *ctx = talloc_tos();
int ver = 0;
- struct smb_filename *oldcwd_fname = NULL;
char *printdollar = NULL;
int printdollar_snum;
WERROR err = WERR_OK;
@@ -1505,35 +1505,39 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
break;
default:
DEBUG(0,("move_driver_to_download_area: Unknown info level (%u)\n", (unsigned int)r->level));
+ TALLOC_FREE(frame);
return WERR_INVALID_LEVEL;
}
short_architecture = get_short_archi(driver->architecture);
if (!short_architecture) {
+ TALLOC_FREE(frame);
return WERR_UNKNOWN_PRINTER_DRIVER;
}
- printdollar_snum = find_service(ctx, "print$", &printdollar);
+ printdollar_snum = find_service(frame, "print$", &printdollar);
if (!printdollar) {
+ TALLOC_FREE(frame);
return WERR_NOT_ENOUGH_MEMORY;
}
if (printdollar_snum == -1) {
+ TALLOC_FREE(frame);
return WERR_BAD_NET_NAME;
}
- nt_status = create_conn_struct_cwd(talloc_tos(),
- server_event_context(),
- server_messaging_context(),
- &conn,
- printdollar_snum,
- lp_path(talloc_tos(), printdollar_snum),
- session_info, &oldcwd_fname);
+ nt_status = create_conn_struct_tos_cwd(server_messaging_context(),
+ printdollar_snum,
+ lp_path(frame, printdollar_snum),
+ session_info,
+ &c);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("move_driver_to_download_area: create_conn_struct "
"returned %s\n", nt_errstr(nt_status)));
err = ntstatus_to_werror(nt_status);
+ TALLOC_FREE(frame);
return err;
}
+ conn = c->conn;
nt_status = set_conn_force_user_group(conn, printdollar_snum);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -1548,7 +1552,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
goto err_free_conn;
}
- new_dir = talloc_asprintf(ctx,
+ new_dir = talloc_asprintf(frame,
"%s/%d",
short_architecture,
driver->version);
@@ -1594,7 +1598,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
if (driver->driver_path && strlen(driver->driver_path)) {
- err = move_driver_file_to_download_area(ctx,
+ err = move_driver_file_to_download_area(frame,
conn,
driver->driver_path,
short_architecture,
@@ -1609,7 +1613,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
if (driver->data_file && strlen(driver->data_file)) {
if (!strequal(driver->data_file, driver->driver_path)) {
- err = move_driver_file_to_download_area(ctx,
+ err = move_driver_file_to_download_area(frame,
conn,
driver->data_file,
short_architecture,
@@ -1626,7 +1630,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
if (!strequal(driver->config_file, driver->driver_path) &&
!strequal(driver->config_file, driver->data_file)) {
- err = move_driver_file_to_download_area(ctx,
+ err = move_driver_file_to_download_area(frame,
conn,
driver->config_file,
short_architecture,
@@ -1644,7 +1648,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
!strequal(driver->help_file, driver->data_file) &&
!strequal(driver->help_file, driver->config_file)) {
- err = move_driver_file_to_download_area(ctx,
+ err = move_driver_file_to_download_area(frame,
conn,
driver->help_file,
short_architecture,
@@ -1670,7 +1674,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
}
}
- err = move_driver_file_to_download_area(ctx,
+ err = move_driver_file_to_download_area(frame,
conn,
driver->dependent_files->string[i],
short_architecture,
@@ -1689,15 +1693,7 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
err_exit:
unbecome_user();
err_free_conn:
- TALLOC_FREE(smb_dname);
-
- if (conn != NULL) {
- vfs_ChDir(conn, oldcwd_fname);
- TALLOC_FREE(oldcwd_fname);
- SMB_VFS_DISCONNECT(conn);
- conn_free(conn);
- }
-
+ TALLOC_FREE(frame);
return err;
}
@@ -2044,41 +2040,45 @@ err_out:
bool delete_driver_files(const struct auth_session_info *session_info,
const struct spoolss_DriverInfo8 *r)
{
+ TALLOC_CTX *frame = talloc_stackframe();
const char *short_arch;
- connection_struct *conn;
+ struct conn_struct_tos *c = NULL;
+ connection_struct *conn = NULL;
NTSTATUS nt_status;
- struct smb_filename *oldcwd_fname = NULL;
char *printdollar = NULL;
int printdollar_snum;
bool ret = false;
if (!r) {
+ TALLOC_FREE(frame);
return false;
}
DEBUG(6,("delete_driver_files: deleting driver [%s] - version [%d]\n",
r->driver_name, r->version));
- printdollar_snum = find_service(talloc_tos(), "print$", &printdollar);
+ printdollar_snum = find_service(frame, "print$", &printdollar);
if (!printdollar) {
+ TALLOC_FREE(frame);
return false;
}
if (printdollar_snum == -1) {
+ TALLOC_FREE(frame);
return false;
}
- nt_status = create_conn_struct_cwd(talloc_tos(),
- server_event_context(),
- server_messaging_context(),
- &conn,
- printdollar_snum,
- lp_path(talloc_tos(), printdollar_snum),
- session_info, &oldcwd_fname);
+ nt_status = create_conn_struct_tos_cwd(server_messaging_context(),
+ printdollar_snum,
+ lp_path(frame, printdollar_snum),
+ session_info,
+ &c);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("delete_driver_files: create_conn_struct "
"returned %s\n", nt_errstr(nt_status)));
+ TALLOC_FREE(frame);
return false;
}
+ conn = c->conn;
nt_status = set_conn_force_user_group(conn, printdollar_snum);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -2141,12 +2141,7 @@ bool delete_driver_files(const struct auth_session_info *session_info,
err_out:
unbecome_user();
err_free_conn:
- if (conn != NULL) {
- vfs_ChDir(conn, oldcwd_fname);
- TALLOC_FREE(oldcwd_fname);
- SMB_VFS_DISCONNECT(conn);
- conn_free(conn);
- }
+ TALLOC_FREE(frame);
return ret;
}
diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c
index c4941d8..c4648ce 100644
--- a/source3/printing/queue_process.c
+++ b/source3/printing/queue_process.c
@@ -123,7 +123,7 @@ static void delete_and_reload_printers_full(struct tevent_context *ev,
}
/* finally, purge old snums */
- delete_and_reload_printers(ev, msg_ctx);
+ delete_and_reload_printers();
TALLOC_FREE(session_info);
}
@@ -484,7 +484,7 @@ void printing_subsystem_update(struct tevent_context *ev_ctx,
{
if (background_lpq_updater_pid != -1) {
if (pcap_cache_loaded(NULL)) {
- load_printers(ev_ctx, msg_ctx);
+ load_printers();
}
if (force) {
/* Send a sighup to the background process.
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 2b08d58..ca1eda9 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -105,7 +105,7 @@ static void update_conf(struct tevent_context *ev,
{
change_to_root_user();
lp_load_global(get_dyn_CONFIGFILE());
- load_printers(ev, msg);
+ load_printers();
spoolss_reopen_logs(spoolss_child_id);
if (spoolss_child_id == 0) {
@@ -212,13 +212,9 @@ static void spoolss_chld_sig_hup_handler(struct tevent_context *ev,
void *siginfo,
void *pvt)
{
- struct messaging_context *msg_ctx;
-
- msg_ctx = talloc_get_type_abort(pvt, struct messaging_context);
-
--
Samba Shared Repository
More information about the samba-cvs
mailing list