summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-17 14:05:57 +0200
committerVolker Lendecke <vl@samba.org>2010-04-19 14:27:20 +0200
commit496c459388f56f9c79a3ca1cc1a913946d4e62be (patch)
tree1da49085db7c4f43ed6c226db3225d836c136913 /nsswitch
parent9d0629d1552cac93ad8b746fa60122432762e6ac (diff)
downloadsamba-496c459388f56f9c79a3ca1cc1a913946d4e62be.tar.gz
libwbclient: Abstract out test_wbc_authenticate_user for reuse
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/libwbclient/tests/wbclient.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index 7047e090553..09f8fdbae7e 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -529,21 +529,22 @@ static bool test_wbc_get_sidaliases(struct torture_context *tctx)
return true;
}
-static bool test_wbc_authenticate_user(struct torture_context *tctx)
+static bool test_wbc_authenticate_user_int(struct torture_context *tctx,
+ const char *correct_password)
{
struct wbcAuthUserParams params;
struct wbcAuthUserInfo *info = NULL;
struct wbcAuthErrorInfo *error = NULL;
wbcErr ret;
- ret = wbcAuthenticateUser(getenv("USERNAME"), getenv("PASSWORD"));
+ ret = wbcAuthenticateUser(getenv("USERNAME"), correct_password);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"wbcAuthenticateUser failed");
ZERO_STRUCT(params);
params.account_name = getenv("USERNAME");
params.level = WBC_AUTH_USER_LEVEL_PLAIN;
- params.password.plaintext = getenv("PASSWORD");
+ params.password.plaintext = correct_password;
ret = wbcAuthenticateUserEx(&params, &info, &error);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
@@ -568,6 +569,11 @@ static bool test_wbc_authenticate_user(struct torture_context *tctx)
return true;
}
+static bool test_wbc_authenticate_user(struct torture_context *tctx)
+{
+ return test_wbc_authenticate_user_int(tctx, getenv("PASSWORD"));
+}
+
static bool test_wbc_logon_user(struct torture_context *tctx)
{
struct wbcLogonUserParams params;