diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-05-05 00:40:13 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-05-05 01:42:18 +0200 |
commit | a246de8bd1b37f1b9881b38036a736305e3e4052 (patch) | |
tree | 83df3c2ab9ee3d12c34424dddba0658a4b441b9a /tests/mock_pam.c | |
parent | 43e3871abcfa19cc8ccca9295d8a627ca19d96dc (diff) | |
download | libpam-x2go-a246de8bd1b37f1b9881b38036a736305e3e4052.tar.gz libpam-x2go-a246de8bd1b37f1b9881b38036a736305e3e4052.tar.bz2 libpam-x2go-a246de8bd1b37f1b9881b38036a736305e3e4052.zip |
unit tests: Fix them and reenable them.
Diffstat (limited to 'tests/mock_pam.c')
-rw-r--r-- | tests/mock_pam.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/mock_pam.c b/tests/mock_pam.c index a07c9af..8b8e2f5 100644 --- a/tests/mock_pam.c +++ b/tests/mock_pam.c @@ -11,6 +11,7 @@ #include <string.h> #include "mock_pam.h" +#include "pam-x2go.h" struct pam_handle { void *item[PAM_NUM_ITEMS]; @@ -31,15 +32,15 @@ int fake_conv (int num_msg, const struct pam_message **msg, response->resp_retcode = 0; - if (strcmp((*msg)->msg, "login:") == 0) + if (strcmp((*msg)->msg, PAM_X2GO_PROMPT_GUESTLOGIN) == 0) response->resp = strdup ("guest"); /* IMPORTANT: this needs to be in /etc/passwd */ - else if (strcmp((*msg)->msg, "remote login:") == 0) + else if (strcmp((*msg)->msg, PAM_X2GO_PROMPT_USER) == 0) response->resp = strdup ("ruser"); - else if (strcmp((*msg)->msg, "remote host:") == 0) + else if (strcmp((*msg)->msg, PAM_X2GO_PROMPT_HOST) == 0) response->resp = strdup ("protocol://rhost/dummy"); - else if (strcmp((*msg)->msg, "password:") == 0) + else if (strcmp((*msg)->msg, PAM_X2GO_PROMPT_PASSWORD) == 0) response->resp = strdup ("password"); - else if (strcmp((*msg)->msg, "remote command:") == 0) + else if (strcmp((*msg)->msg, PAM_X2GO_PROMPT_COMMAND) == 0) response->resp = strdup ("rcommand"); else return PAM_SYMBOL_ERR; /* leaks... */ @@ -63,7 +64,7 @@ pam_handle_t *pam_handle_new (void) return newh; } -int pam_get_item (const pam_handle_t *pamh, int type, const void **value) +int PAM_NONNULL((1)) pam_get_item (const pam_handle_t *pamh, int type, const void **value) { if (pamh == NULL) return PAM_SYSTEM_ERR; @@ -78,7 +79,7 @@ int pam_get_item (const pam_handle_t *pamh, int type, const void **value) return PAM_SUCCESS; } -int pam_set_item (pam_handle_t *pamh, int type, const void *value) +int PAM_NONNULL((1)) pam_set_item (pam_handle_t *pamh, int type, const void *value) { if (pamh == NULL) return PAM_SYSTEM_ERR; |