diff options
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/blob.c | 5 | ||||
-rw-r--r-- | source4/smb_server/smb/config.mk | 2 | ||||
-rw-r--r-- | source4/smb_server/smb/negprot.c | 2 | ||||
-rw-r--r-- | source4/smb_server/smb/nttrans.c | 3 | ||||
-rw-r--r-- | source4/smb_server/smb/request.c | 7 | ||||
-rw-r--r-- | source4/smb_server/smb2/fileio.c | 3 | ||||
-rw-r--r-- | source4/smb_server/smb2/negprot.c | 2 | ||||
-rw-r--r-- | source4/smb_server/smb_server.c | 12 |
8 files changed, 23 insertions, 13 deletions
diff --git a/source4/smb_server/blob.c b/source4/smb_server/blob.c index 237ebd4d7e..21cddc4d7d 100644 --- a/source4/smb_server/blob.c +++ b/source4/smb_server/blob.c @@ -24,6 +24,7 @@ #include "librpc/gen_ndr/ndr_misc.h" #include "ntvfs/ntvfs.h" #include "libcli/raw/libcliraw.h" +#include "param/param.h" #define BLOB_CHECK(cmd) do { \ NTSTATUS _status; \ @@ -138,10 +139,10 @@ size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx, alignment = 1; if (dest_len > 0) { SCVAL(blob->data + offset, 0, 0); - ret = push_string(global_smb_iconv_convenience, blob->data + offset + 1, str, dest_len-1, flags); + ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset + 1, str, dest_len-1, flags); } } else { - ret = push_string(global_smb_iconv_convenience, blob->data + offset, str, dest_len, flags); + ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset, str, dest_len, flags); } /* sometimes the string needs to be terminated, but the length diff --git a/source4/smb_server/smb/config.mk b/source4/smb_server/smb/config.mk index 05ff69316d..22151ebd3b 100644 --- a/source4/smb_server/smb/config.mk +++ b/source4/smb_server/smb/config.mk @@ -15,7 +15,7 @@ OBJ_FILES = \ trans2.o \ signing.o PUBLIC_DEPENDENCIES = \ - ntvfs LIBPACKET + ntvfs LIBPACKET CREDENTIALS LDFLAGS = $(SUBSYSTEM_SMB_SERVER_OUTPUT) # End SUBSYSTEM SMB_PROTOCOL ####################### diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c index f92c542ef6..6d9ff838cb 100644 --- a/source4/smb_server/smb/negprot.c +++ b/source4/smb_server/smb/negprot.c @@ -375,7 +375,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice) } cli_credentials_set_conf(server_credentials, req->smb_conn->lp_ctx); - nt_status = cli_credentials_set_machine_account(server_credentials); + nt_status = cli_credentials_set_machine_account(server_credentials, req->smb_conn->lp_ctx); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status))); talloc_free(server_credentials); diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index 25cddd6654..34f9df8706 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -26,6 +26,7 @@ #include "ntvfs/ntvfs.h" #include "libcli/raw/libcliraw.h" #include "librpc/gen_ndr/ndr_security.h" +#include "param/param.h" /* hold the state of a nttrans op while in progress. Needed to allow for async backend @@ -372,7 +373,7 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op) ssize_t len; SIVAL(p, 4, info->nttrans.out.changes[i].action); - len = push_string(global_smb_iconv_convenience, p + 12, info->nttrans.out.changes[i].name.s, + len = push_string(lp_iconv_convenience(global_loadparm), p + 12, info->nttrans.out.changes[i].name.s, op->trans->out.params.length - (p+12 - op->trans->out.params.data), STR_UNICODE); SIVAL(p, 8, len); diff --git a/source4/smb_server/smb/request.c b/source4/smb_server/smb/request.c index cdeba02dd7..8f6d664500 100644 --- a/source4/smb_server/smb/request.c +++ b/source4/smb_server/smb/request.c @@ -27,6 +27,7 @@ #include "smbd/service_stream.h" #include "lib/stream/packet.h" #include "ntvfs/ntvfs.h" +#include "param/param.h" /* we over allocate the data buffer to prevent too many realloc calls */ @@ -408,7 +409,7 @@ size_t req_push_str(struct smbsrv_request *req, uint8_t *dest, const char *str, dest = req->out.buffer + PTR_DIFF(dest, buf0); } - len = push_string(global_smb_iconv_convenience, dest, str, len, flags); + len = push_string(lp_iconv_convenience(global_loadparm), dest, str, len, flags); grow_size = len + PTR_DIFF(dest, req->out.data); @@ -494,7 +495,7 @@ static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const return src_len2 + alignment; } - ret = convert_string_talloc(req, global_smb_iconv_convenience, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2); + ret = convert_string_talloc(req, lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2); if (ret == -1) { *dest = NULL; @@ -543,7 +544,7 @@ static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, cons src_len2++; } - ret = convert_string_talloc(req, global_smb_iconv_convenience, CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2); + ret = convert_string_talloc(req, lp_iconv_convenience(global_loadparm), CH_DOS, CH_UNIX, src, src_len2, (void **)&dest2); if (ret == -1) { *dest = NULL; diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c index a5fc3d8268..e853743b2f 100644 --- a/source4/smb_server/smb2/fileio.c +++ b/source4/smb_server/smb2/fileio.c @@ -24,6 +24,7 @@ #include "smb_server/service_smb_proto.h" #include "smb_server/smb2/smb2_server.h" #include "ntvfs/ntvfs.h" +#include "param/param.h" static void smb2srv_create_send(struct ntvfs_request *ntvfs) { @@ -352,7 +353,7 @@ static void smb2srv_notify_send(struct ntvfs_request *ntvfs) ssize_t len; SIVAL(p, 4, io->smb2.out.changes[i].action); - len = push_string(global_smb_iconv_convenience, p + 12, io->smb2.out.changes[i].name.s, + len = push_string(lp_iconv_convenience(global_loadparm), p + 12, io->smb2.out.changes[i].name.s, blob.length - (p+12 - blob.data), STR_UNICODE); SIVAL(p, 8, len); diff --git a/source4/smb_server/smb2/negprot.c b/source4/smb_server/smb2/negprot.c index 664079812a..8e3cfd3547 100644 --- a/source4/smb_server/smb2/negprot.c +++ b/source4/smb_server/smb2/negprot.c @@ -55,7 +55,7 @@ static NTSTATUS smb2srv_negprot_secblob(struct smb2srv_request *req, DATA_BLOB * } cli_credentials_set_conf(server_credentials, req->smb_conn->lp_ctx); - nt_status = cli_credentials_set_machine_account(server_credentials); + nt_status = cli_credentials_set_machine_account(server_credentials, req->smb_conn->lp_ctx); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status))); talloc_free(server_credentials); diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index c91566e244..082de6540b 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -156,7 +156,8 @@ static void smbsrv_accept(struct stream_connection *conn) smbsrv_management_init(smb_conn); - if (!NT_STATUS_IS_OK(share_get_context(smb_conn, &(smb_conn->share_context)))) { + if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lp_share_backend(smb_conn->lp_ctx), + smb_conn->lp_ctx, &(smb_conn->share_context)))) { smbsrv_terminate_connection(smb_conn, "share_init failed!"); return; } @@ -217,15 +218,20 @@ static void smbsrv_task_init(struct task_server *task) task_server_set_title(task, "task[smbsrv]"); if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) { - int num_interfaces = iface_count(task->lp_ctx); + int num_interfaces; int i; + struct interface *ifaces; + + load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces); + + num_interfaces = iface_count(ifaces); /* We have been given an interfaces line, and been told to only bind to those interfaces. Create a socket per interface and bind to only these. */ for(i = 0; i < num_interfaces; i++) { - const char *address = iface_n_ip(task->lp_ctx, i); + const char *address = iface_n_ip(ifaces, i); status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops, address); if (!NT_STATUS_IS_OK(status)) goto failed; } |