Welcome! Log In Create A New Profile

Advanced

[PATCH] Core: fix build without libcrypt

Piotr Sikora via nginx-devel
February 27, 2024 08:26PM
# HG changeset patch
# User Piotr Sikora <piotr@aviatrix.com>
# Date 1708977637 0
# Mon Feb 26 20:00:37 2024 +0000
# Branch patch013
# Node ID cdc173477ea99fd6c952a85e5cd11db66452076a
# Parent 04e3155b3b9651fee708898aaf82ac35532806ee
Core: fix build without libcrypt.

libcrypt is no longer part of glibc, so it might not be available.

Signed-off-by: Piotr Sikora <piotr@aviatrix.com>

diff -r 04e3155b3b96 -r cdc173477ea9 auto/unix
--- a/auto/unix Mon Feb 26 20:00:35 2024 +0000
+++ b/auto/unix Mon Feb 26 20:00:37 2024 +0000
@@ -150,7 +150,7 @@


ngx_feature="crypt()"
-ngx_feature_name=
+ngx_feature_name="NGX_HAVE_CRYPT"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
@@ -162,7 +162,7 @@
if [ $ngx_found = no ]; then

ngx_feature="crypt() in libcrypt"
- ngx_feature_name=
+ ngx_feature_name="NGX_HAVE_CRYPT"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
diff -r 04e3155b3b96 -r cdc173477ea9 src/os/unix/ngx_linux_config.h
--- a/src/os/unix/ngx_linux_config.h Mon Feb 26 20:00:35 2024 +0000
+++ b/src/os/unix/ngx_linux_config.h Mon Feb 26 20:00:37 2024 +0000
@@ -52,7 +52,6 @@
#include <malloc.h> /* memalign() */
#include <limits.h> /* IOV_MAX */
#include <sys/ioctl.h>
-#include <crypt.h>
#include <sys/utsname.h> /* uname() */

#include <dlfcn.h>
@@ -61,6 +60,11 @@
#include <ngx_auto_config.h>


+#if (NGX_HAVE_CRYPT_H)
+#include <crypt.h>
+#endif
+
+
#if (NGX_HAVE_POSIX_SEM)
#include <semaphore.h>
#endif
diff -r 04e3155b3b96 -r cdc173477ea9 src/os/unix/ngx_user.c
--- a/src/os/unix/ngx_user.c Mon Feb 26 20:00:35 2024 +0000
+++ b/src/os/unix/ngx_user.c Mon Feb 26 20:00:37 2024 +0000
@@ -44,7 +44,7 @@
return NGX_ERROR;
}

-#else
+#elif (NGX_HAVE_CRYPT)

ngx_int_t
ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
@@ -76,6 +76,14 @@
return NGX_ERROR;
}

+#else
+
+ngx_int_t
+ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
+{
+ return NGX_ERROR;
+}
+
#endif

#endif /* NGX_CRYPT */
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Core: fix build without libcrypt

Piotr Sikora via nginx-devel 216 February 27, 2024 08:26PM

Re: [PATCH] Core: fix build without libcrypt

Roman Arutyunyan 21 March 18, 2024 08:14AM

Re: [PATCH] Core: fix build without libcrypt

Piotr Sikora via nginx-devel 25 March 21, 2024 03:18AM

Re: [PATCH] Core: fix build without libcrypt

Sergey Kandaurov 20 March 18, 2024 10:58AM

Re: [PATCH] Core: fix build without libcrypt

Илья Шипицин 21 March 18, 2024 11:44AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 159
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready