diff options
author | jpadkins <jacobpadkins@gmail.com> | 2017-03-22 23:16:04 +0300 |
---|---|---|
committer | jpadkins <jacobpadkins@gmail.com> | 2017-03-22 23:16:04 +0300 |
commit | 3e545682caa748b2163ed7e57d492eab4e86f27f (patch) | |
tree | b135001d9b1c865c47543f7b27d994a4c6f5f06d /check/magma | |
parent | 7f7a85f1b5fd957fb9fd884328ea09bd4d151834 (diff) |
Fixed the weird SIGPIPE issue
Diffstat (limited to 'check/magma')
-rw-r--r-- | check/magma/servers/pop/pop_check_network.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/check/magma/servers/pop/pop_check_network.c b/check/magma/servers/pop/pop_check_network.c index bb605055..f4d19690 100644 --- a/check/magma/servers/pop/pop_check_network.c +++ b/check/magma/servers/pop/pop_check_network.c @@ -36,7 +36,7 @@ bool_t check_pop_network_basic_sthread(stringer_t *errmsg, uint32_t port, bool_t return false; } - // Test the USER command. + // Test the USER and PASS commands with incorrect credentials. else if (client_print(client, "USER princess\r\n") != 15 || client_read_line(client) <= 0 || client_status(client) != 1 || st_cmp_cs_starts(&(client->line), NULLER("+OK"))) { @@ -44,8 +44,22 @@ bool_t check_pop_network_basic_sthread(stringer_t *errmsg, uint32_t port, bool_t client_close(client); return false; } + else if (client_print(client, "PASS lavabit\r\n") != 14 || client_read_line(client) <= 0 || + client_status(client) != 1 || st_cmp_cs_starts(&(client->line), NULLER("-ERR"))) { - // Test the PASS command. + st_sprint(errmsg, "Failed to return an error state after PASS with incorrect credentials."); + client_close(client); + return false; + } + + // Test the USER and PASS commands with correct credentials. + else if (client_print(client, "USER princess\r\n") != 15 || client_read_line(client) <= 0 || + client_status(client) != 1 || st_cmp_cs_starts(&(client->line), NULLER("+OK"))) { + + st_sprint(errmsg, "Failed to return a successful state after USER."); + client_close(client); + return false; + } else if (client_print(client, "PASS password\r\n") != 15 || client_read_line(client) <= 0 || client_status(client) != 1 || st_cmp_cs_starts(&(client->line), NULLER("+OK"))) { |