diff options
author | Jeremy Allison <jra@samba.org> | 2012-08-08 17:01:00 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-08-09 12:08:18 -0700 |
commit | b70f23c2b581c5d455362ab37f4846de9a910055 (patch) | |
tree | cf95e8d35a03d1e39d5926d2e03d7046d42cae64 /source3/lib/username.c | |
parent | ce21d0804012da27cec72abe896352d7f0e7e1e5 (diff) | |
download | samba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.gz samba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.bz2 samba-b70f23c2b581c5d455362ab37f4846de9a910055.zip |
Correctly check for errors in strlower_m() returns.
Diffstat (limited to 'source3/lib/username.c')
-rw-r--r-- | source3/lib/username.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c index 7435a59ac7..665fbb4253 100644 --- a/source3/lib/username.c +++ b/source3/lib/username.c @@ -112,7 +112,11 @@ static struct passwd *Get_Pwnam_internals(TALLOC_CTX *mem_ctx, /* Try in all lower case first as this is the most common case on UNIX systems */ - strlower_m(user2); + if (!strlower_m(user2)) { + DEBUG(5,("strlower_m %s failed\n", user2)); + goto done; + } + DEBUG(5,("Trying _Get_Pwnam(), username as lowercase is %s\n",user2)); ret = getpwnam_alloc_cached(mem_ctx, user2); if(ret) @@ -141,7 +145,10 @@ static struct passwd *Get_Pwnam_internals(TALLOC_CTX *mem_ctx, } /* Try all combinations up to usernamelevel */ - strlower_m(user2); + if (!strlower_m(user2)) { + DEBUG(5,("strlower_m %s failed\n", user2)); + goto done; + } DEBUG(5,("Checking combinations of %d uppercase letters in %s\n", lp_usernamelevel(), user2)); ret = uname_string_combinations(user2, mem_ctx, getpwnam_alloc_cached, |