summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-07 16:54:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:32 -0500
commitb50ef4caef44e3b45445728818f3bca09273249d (patch)
treecb47af18870ae47c20ee204c9eb75e4e1303d4ca /source4/utils
parent307a45127b863836d4c301722ccc04ee94c457cb (diff)
downloadsamba-b50ef4caef44e3b45445728818f3bca09273249d.tar.gz
samba-b50ef4caef44e3b45445728818f3bca09273249d.tar.bz2
samba-b50ef4caef44e3b45445728818f3bca09273249d.zip
r25007: Remove more uses of pstring, move ntlmauth-specific utility function to ntlm-auth.c
(This used to be commit 6f224480b230ab7ccfc0417c13e7f4fc3f6f2a13)
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/ntlm_auth.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 4ce8fc6d3f..9659541319 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -120,7 +120,7 @@ static void mux_printf(unsigned int mux_id, const char *format, ...)
/* Copy of parse_domain_user from winbindd_util.c. Parse a string of the
form DOMAIN/user into a domain and a user */
-static BOOL parse_ntlm_auth_domain_user(const char *domuser, fstring domain,
+static bool parse_ntlm_auth_domain_user(const char *domuser, fstring domain,
fstring user)
{
@@ -324,6 +324,24 @@ static const char *get_password(struct cli_credentials *credentials)
return password;
}
+/**
+ Check if a string is part of a list.
+**/
+static bool in_list(const char *s, const char *list, bool casesensitive)
+{
+ pstring tok;
+ const char *p=list;
+
+ if (!list)
+ return false;
+
+ while (next_token(&p, tok, LIST_SEP, sizeof(tok))) {
+ if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0)
+ return true;
+ }
+ return false;
+}
+
static void gensec_want_feature_list(struct gensec_security *state, char* feature_list)
{
if (in_list("NTLMSSP_FEATURE_SESSION_KEY", feature_list, True)) {