summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_pam.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-11-12 23:20:50 +0000
committerJeremy Allison <jra@samba.org>2002-11-12 23:20:50 +0000
commit2f194322d419350f35a48dff750066894d68eccf (patch)
treeb0501eaf874ca8e740a51a8e0f29d261e32e0093 /source3/nsswitch/winbindd_pam.c
parentf2b669b37fecda2687860eba4a15801dc89855dc (diff)
downloadsamba-2f194322d419350f35a48dff750066894d68eccf.tar.gz
samba-2f194322d419350f35a48dff750066894d68eccf.tar.bz2
samba-2f194322d419350f35a48dff750066894d68eccf.zip
Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
Diffstat (limited to 'source3/nsswitch/winbindd_pam.c')
-rw-r--r--source3/nsswitch/winbindd_pam.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index 969cf272a3..733ccb4cd6 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/nsswitch/winbindd_pam.c
@@ -68,8 +68,6 @@ enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state)
DATA_BLOB lm_resp;
DATA_BLOB nt_resp;
- extern pstring global_myname;
-
/* Ensure null termination */
state->request.data.auth.user[sizeof(state->request.data.auth.user)-1]='\0';
@@ -135,7 +133,7 @@ enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state)
result = cli_netlogon_sam_network_logon(cli, mem_ctx,
name_user, name_domain,
- global_myname, chal,
+ global_myname(), chal,
lm_resp, nt_resp,
&info3);
@@ -169,14 +167,12 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
struct cli_state *cli = NULL;
TALLOC_CTX *mem_ctx = NULL;
char *user = NULL;
- char *domain = NULL;
- char *contact_domain;
- char *workstation;
+ const char *domain = NULL;
+ const char *contact_domain;
+ const char *workstation;
DATA_BLOB lm_resp, nt_resp;
- extern pstring global_myname;
-
/* Ensure null termination */
state->request.data.auth_crap.user[sizeof(state->request.data.auth_crap.user)-1]='\0';
@@ -194,9 +190,11 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
}
if (*state->request.data.auth_crap.domain) {
- if (pull_utf8_talloc(mem_ctx, &domain, state->request.data.auth_crap.domain) < 0) {
+ char *dom = NULL;
+ if (pull_utf8_talloc(mem_ctx, &dom, state->request.data.auth_crap.domain) < 0) {
DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
}
+ domain = dom;
} else if (lp_winbind_use_default_domain()) {
domain = lp_workgroup();
} else {
@@ -216,11 +214,13 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
}
if (*state->request.data.auth_crap.workstation) {
- if (pull_utf8_talloc(mem_ctx, &workstation, state->request.data.auth_crap.workstation) < 0) {
+ char *wrk = NULL;
+ if (pull_utf8_talloc(mem_ctx, &wrk, state->request.data.auth_crap.workstation) < 0) {
DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
}
+ workstation = wrk;
} else {
- workstation = global_myname;
+ workstation = global_myname();
}
if (state->request.data.auth_crap.lm_resp_len > sizeof(state->request.data.auth_crap.lm_resp)