summaryrefslogtreecommitdiff
path: root/auth/credentials
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-10-28 15:55:48 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-12-09 09:24:27 +0100
commit5d4aa22f559d051fe38992af8c17d1ae0ea11cf2 (patch)
treea83eada5c6be366a07d9ea2c47419cbd8a76102b /auth/credentials
parentf5536ce1f6ab4e0764e4e806fb0fca5c43051f86 (diff)
downloadsamba-5d4aa22f559d051fe38992af8c17d1ae0ea11cf2.tar.gz
auth/credentials: let cli_credentials_parse_string() handle the "winbind separator"
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'auth/credentials')
-rw-r--r--auth/credentials/credentials.c14
-rw-r--r--auth/credentials/credentials_internal.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index b8171f3f797..2ec494a1a4a 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -115,6 +115,8 @@ _PUBLIC_ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx)
cred->forced_sasl_mech = NULL;
+ cred->winbind_separator = '\\';
+
return cred;
}
@@ -746,7 +748,10 @@ _PUBLIC_ void cli_credentials_parse_string(struct cli_credentials *credentials,
*p = 0;
cli_credentials_set_realm(credentials, p+1, obtained);
return;
- } else if ((p = strchr_m(uname,'\\')) || (p = strchr_m(uname, '/'))) {
+ } else if ((p = strchr_m(uname,'\\'))
+ || (p = strchr_m(uname, '/'))
+ || (p = strchr_m(uname, credentials->winbind_separator)))
+ {
*p = 0;
cli_credentials_set_domain(credentials, uname, obtained);
uname = p+1;
@@ -794,6 +799,8 @@ _PUBLIC_ const char *cli_credentials_get_unparsed_name(struct cli_credentials *c
_PUBLIC_ void cli_credentials_set_conf(struct cli_credentials *cred,
struct loadparm_context *lp_ctx)
{
+ const char *sep = NULL;
+
cli_credentials_set_username(cred, "", CRED_UNINITIALISED);
if (lpcfg_parm_is_cmdline(lp_ctx, "workgroup")) {
cli_credentials_set_domain(cred, lpcfg_workgroup(lp_ctx), CRED_SPECIFIED);
@@ -810,6 +817,11 @@ _PUBLIC_ void cli_credentials_set_conf(struct cli_credentials *cred,
} else {
cli_credentials_set_realm(cred, lpcfg_realm(lp_ctx), CRED_UNINITIALISED);
}
+
+ sep = lpcfg_winbind_separator(lp_ctx);
+ if (sep != NULL && sep[0] != '\0') {
+ cred->winbind_separator = *lpcfg_winbind_separator(lp_ctx);
+ }
}
/**
diff --git a/auth/credentials/credentials_internal.h b/auth/credentials/credentials_internal.h
index aa01ccc1c49..f88ae707070 100644
--- a/auth/credentials/credentials_internal.h
+++ b/auth/credentials/credentials_internal.h
@@ -113,6 +113,8 @@ struct cli_credentials {
/* Whether any callback is currently running */
bool callback_running;
+
+ char winbind_separator;
};
#endif /* __CREDENTIALS_INTERNAL_H__ */