From fbc17fa1d962150062aa0b4839d75a27605b965e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 16 Jan 2011 10:38:03 -0500 Subject: Patch from Vladimir Shabanov to support crypt under OS X --- src/c/urweb.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/c') diff --git a/src/c/urweb.c b/src/c/urweb.c index 38733cc4..9f5c009a 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -3697,15 +3697,8 @@ failure_kind uw_runCallback(uw_context ctx, void (*callback)(uw_context)) { } uw_Basis_string uw_Basis_crypt(uw_context ctx, uw_Basis_string key, uw_Basis_string salt) { - struct crypt_data *data; - - if ((data = uw_get_global(ctx, "crypt")) == NULL) { - data = malloc(sizeof(struct crypt_data)); - data->initialized = 0; - uw_set_global(ctx, "crypt", data, free); - } - - return uw_strdup(ctx, crypt_r(key, salt, data)); + char buf[14]; + return uw_strdup(ctx, DES_fcrypt(key, salt, buf)); } uw_Basis_bool uw_Basis_eq_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) { -- cgit v1.2.3