summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-02 21:32:08 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:13 +0100
commit934e932387ea5668ec000bcefe4ec86935297339 (patch)
treeb101a7e8ff027df768ef9612ca9a7b84f12a7b8a /source4/winbind
parent7e298580e06a5b9a0c1210937af47f277849080e (diff)
downloadsamba-934e932387ea5668ec000bcefe4ec86935297339.tar.gz
samba-934e932387ea5668ec000bcefe4ec86935297339.tar.bz2
samba-934e932387ea5668ec000bcefe4ec86935297339.zip
r26235: Avoid global_loadparm.
(This used to be commit e9039782204389cc827e76da319d5ccf6d33be46)
Diffstat (limited to 'source4/winbind')
-rw-r--r--source4/winbind/wb_cmd_getpwnam.c4
-rw-r--r--source4/winbind/wb_name2domain.c3
-rw-r--r--source4/winbind/wb_samba3_cmd.c4
-rw-r--r--source4/winbind/wb_utils.c7
4 files changed, 10 insertions, 8 deletions
diff --git a/source4/winbind/wb_cmd_getpwnam.c b/source4/winbind/wb_cmd_getpwnam.c
index 653b598ac3..5029e168a2 100644
--- a/source4/winbind/wb_cmd_getpwnam.c
+++ b/source4/winbind/wb_cmd_getpwnam.c
@@ -23,10 +23,10 @@
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
#include "winbind/wb_async_helpers.h"
+#include "param/param.h"
#include "winbind/wb_helper.h"
#include "smbd/service_task.h"
#include "libnet/libnet_proto.h"
-#include "param/param.h"
#include "libcli/security/proto.h"
struct cmd_getpwnam_state {
@@ -86,7 +86,7 @@ static void cmd_getpwnam_recv_domain(struct composite_context *ctx)
user_info = talloc(state, struct libnet_UserInfo);
if (composite_nomem(user_info, state->ctx)) return;
- ok= wb_samba3_split_username(state, state->name, &user_dom, &user_name);
+ ok= wb_samba3_split_username(state, global_loadparm, state->name, &user_dom, &user_name);
if(!ok){
composite_error(state->ctx, NT_STATUS_OBJECT_NAME_INVALID);
return;
diff --git a/source4/winbind/wb_name2domain.c b/source4/winbind/wb_name2domain.c
index b100709223..60fe18b5b9 100644
--- a/source4/winbind/wb_name2domain.c
+++ b/source4/winbind/wb_name2domain.c
@@ -24,6 +24,7 @@
#include "winbind/wb_server.h"
#include "smbd/service_task.h"
#include "winbind/wb_helper.h"
+#include "param/param.h"
struct name2domain_state {
struct composite_context *ctx;
@@ -54,7 +55,7 @@ struct composite_context *wb_name2domain_send(TALLOC_CTX *mem_ctx,
result->private_data = state;
state->service = service;
- ok = wb_samba3_split_username(state, name, &user_dom, &user_name);
+ ok = wb_samba3_split_username(state, global_loadparm, name, &user_dom, &user_name);
if(!ok) {
composite_error(state->ctx, NT_STATUS_OBJECT_NAME_INVALID);
return result;
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c
index 4c8a9f9355..041284e307 100644
--- a/source4/winbind/wb_samba3_cmd.c
+++ b/source4/winbind/wb_samba3_cmd.c
@@ -23,13 +23,13 @@
#include "includes.h"
#include "winbind/wb_server.h"
#include "winbind/wb_async_helpers.h"
+#include "param/param.h"
#include "winbind/wb_helper.h"
#include "libcli/composite/composite.h"
#include "version.h"
#include "librpc/gen_ndr/netlogon.h"
#include "libcli/security/security.h"
#include "auth/pam_errors.h"
-#include "param/param.h"
/*
Send off the reply to an async Samba3 query, handling filling in the PAM, NTSTATUS and string errors.
@@ -545,7 +545,7 @@ NTSTATUS wbsrv_samba3_pam_auth(struct wbsrv_samba3_call *s3call)
s3call->wbconn->listen_socket->service;
char *user, *domain;
- if (!wb_samba3_split_username(s3call,
+ if (!wb_samba3_split_username(s3call, global_loadparm,
s3call->request.data.auth.user,
&domain, &user)) {
return NT_STATUS_NO_SUCH_USER;
diff --git a/source4/winbind/wb_utils.c b/source4/winbind/wb_utils.c
index dfd09a98fe..43effc3028 100644
--- a/source4/winbind/wb_utils.c
+++ b/source4/winbind/wb_utils.c
@@ -27,13 +27,14 @@
* as one string.
* TODO: We probably will need to handle other formats later. */
-bool wb_samba3_split_username(TALLOC_CTX *mem_ctx, const char *domuser,
+bool wb_samba3_split_username(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
+ const char *domuser,
char **domain, char **user)
{
- char *p = strchr(domuser, *lp_winbind_separator(global_loadparm));
+ char *p = strchr(domuser, *lp_winbind_separator(lp_ctx));
if (p == NULL) {
- *domain = talloc_strdup(mem_ctx, lp_workgroup(global_loadparm));
+ *domain = talloc_strdup(mem_ctx, lp_workgroup(lp_ctx));
} else {
*domain = talloc_strndup(mem_ctx, domuser,
PTR_DIFF(p, domuser));