summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-27 18:23:58 -0400
committerJune McEnroe <june@causal.agency>2020-08-27 18:23:58 -0400
commit76f1d0775b52e7a8a1c322214836cde530117512 (patch)
tree5b0850d4cb7eabaa2c927e02c3bb4055d5237c47 /client.c
parentRemove rc scripts (diff)
downloadpounce-76f1d0775b52e7a8a1c322214836cde530117512.tar.gz
pounce-76f1d0775b52e7a8a1c322214836cde530117512.zip
Add support for OpenBSD
Diffstat (limited to '')
-rw-r--r--client.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/client.c b/client.c
index 06efeb8..dcfc835 100644
--- a/client.c
+++ b/client.c
@@ -166,11 +166,16 @@ static void handlePass(struct Client *client, struct Message *msg) {
 		client->error = true;
 		return;
 	}
-	if (!strcmp(crypt(msg->params[0], clientPass), clientPass)) {
+#ifdef __OpenBSD__
+	int error = crypt_checkpass(msg->params[0], clientPass);
+#else
+	int error = strcmp(crypt(msg->params[0], clientPass), clientPass);
+#endif
+	if (error) {
+		passRequired(client);
+	} else {
 		client->need &= ~NeedPass;
 		maybeSync(client);
-	} else {
-		passRequired(client);
 	}
 	explicit_bzero(msg->params[0], strlen(msg->params[0]));
 }