From: Victor Kislov Date: Thu, 6 Aug 2020 16:21:39 +0000 (+0300) Subject: BUG/MINOR: auth: report valid crypto(3) support depending on build options X-Git-Tag: v2.1.9~24 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=d18d69e1e145e4afe5414366c853974298fef29d;p=haproxy-2.1.git BUG/MINOR: auth: report valid crypto(3) support depending on build options Since 1.8 with commit e8692b41e ("CLEANUP: auth: use the build options list to report its support"), crypt(3) is always reported as being supported in "haproxy -vv" because no test on USE_LIBCRYPT is made anymore when producing the output. This reintroduces the distinction between with and without USE_LIBCRYPT in the output by indicating "yes" or "no". It may be backported as far as 1.8, though the code differs due to a number of include files cleanups. (cherry picked from commit ec00251c88a91615cc0446c8501dccd290484395) Signed-off-by: Willy Tarreau (cherry picked from commit 0688433d7fce12c885afd96d40b66aee0cbe67ab) Signed-off-by: Christopher Faulet --- diff --git a/src/auth.c b/src/auth.c index 1b0f376..ecf67d5 100644 --- a/src/auth.c +++ b/src/auth.c @@ -40,6 +40,7 @@ struct userlist *userlist = NULL; /* list of all existing userlists */ #ifdef USE_LIBCRYPT +#define CRYPT_STATE_MSG "yes" #ifdef HA_HAVE_CRYPT_R /* context for crypt_r() */ static THREAD_LOCAL struct crypt_data crypt_data = { .initialized = 0 }; @@ -47,6 +48,8 @@ static THREAD_LOCAL struct crypt_data crypt_data = { .initialized = 0 }; /* lock for crypt() */ __decl_hathreads(static HA_SPINLOCK_T auth_lock); #endif +#else /* USE_LIBCRYPT */ +#define CRYPT_STATE_MSG "no" #endif /* find targets for selected groups. The function returns pointer to @@ -314,4 +317,4 @@ pat_match_auth(struct sample *smp, struct pattern_expr *expr, int fill) return NULL; } -REGISTER_BUILD_OPTS("Encrypted password support via crypt(3): yes"); +REGISTER_BUILD_OPTS("Encrypted password support via crypt(3): "CRYPT_STATE_MSG);