summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-08-08 17:01:00 -0700
committerJeremy Allison <jra@samba.org>2012-08-09 12:08:18 -0700
commitb70f23c2b581c5d455362ab37f4846de9a910055 (patch)
treecf95e8d35a03d1e39d5926d2e03d7046d42cae64 /source3/auth
parentce21d0804012da27cec72abe896352d7f0e7e1e5 (diff)
downloadsamba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.gz
Correctly check for errors in strlower_m() returns.
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_builtin.c4
-rw-r--r--source3/auth/auth_util.c4
-rw-r--r--source3/auth/pampass.c4
-rw-r--r--source3/auth/pass_check.c8
-rw-r--r--source3/auth/user_util.c4
5 files changed, 17 insertions, 7 deletions
diff --git a/source3/auth/auth_builtin.c b/source3/auth/auth_builtin.c
index d61a0ec7bf0..dce58bf8bfc 100644
--- a/source3/auth/auth_builtin.c
+++ b/source3/auth/auth_builtin.c
@@ -103,7 +103,9 @@ static NTSTATUS check_name_to_ntstatus_security(const struct auth_context *auth_
return nt_status_string_to_code(user);
}
- strlower_m(user);
+ if (!strlower_m(user)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
error_num = strtoul(user, NULL, 16);
DEBUG(5,("check_name_to_ntstatus_security: Error for user %s was %lx\n", user, error_num));
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 28d934add37..a08d0945a59 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -1252,7 +1252,9 @@ static NTSTATUS check_account(TALLOC_CTX *mem_ctx, const char *domain,
if (!lower_username) {
return NT_STATUS_NO_MEMORY;
}
- strlower_m( lower_username );
+ if (!strlower_m( lower_username )) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
orig_dom_user = talloc_asprintf(mem_ctx,
"%s%c%s",
diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c
index 87fa8ca9fa3..427c22a8ab2 100644
--- a/source3/auth/pampass.c
+++ b/source3/auth/pampass.c
@@ -249,7 +249,7 @@ static struct chat_struct *make_pw_chat(const char *p)
special_char_sub(prompt);
fstrcpy(t->prompt, prompt);
- strlower_m(t->prompt);
+ (void)strlower_m(t->prompt);
trim_char(t->prompt, ' ', ' ');
if (!next_token_talloc(frame, &p, &reply, NULL)) {
@@ -262,7 +262,7 @@ static struct chat_struct *make_pw_chat(const char *p)
special_char_sub(reply);
fstrcpy(t->reply, reply);
- strlower_m(t->reply);
+ (void)strlower_m(t->reply);
trim_char(t->reply, ' ', ' ');
}
diff --git a/source3/auth/pass_check.c b/source3/auth/pass_check.c
index ca992616788..f2d1fc241bc 100644
--- a/source3/auth/pass_check.c
+++ b/source3/auth/pass_check.c
@@ -867,7 +867,9 @@ NTSTATUS pass_check(const struct passwd *pass,
/* try all lowercase if it's currently all uppercase */
if (strhasupper(pass2)) {
- strlower_m(pass2);
+ if (!strlower_m(pass2)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
nt_status = password_check(pass2, (const void *)rhost);
if (NT_STATUS_IS_OK(nt_status)) {
return (nt_status);
@@ -880,7 +882,9 @@ NTSTATUS pass_check(const struct passwd *pass,
}
/* last chance - all combinations of up to level chars upper! */
- strlower_m(pass2);
+ if (!strlower_m(pass2)) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
nt_status = string_combinations(pass2, password_check, level,
(const void *)rhost);
diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c
index 8938aeb003a..4842192051e 100644
--- a/source3/auth/user_util.c
+++ b/source3/auth/user_util.c
@@ -164,7 +164,9 @@ bool user_in_netgroup(TALLOC_CTX *ctx, const char *user, const char *ngname)
if (!lowercase_user) {
return false;
}
- strlower_m(lowercase_user);
+ if (!strlower_m(lowercase_user)) {
+ return false;
+ }
if (strcmp(user,lowercase_user) == 0) {
/* user name was already lower case! */