Re: [PATCH] Core: fix build without libcrypt
Hi Roman, > Can you provide an example of a system where this fix is needed? 1. When linking against musl-libc on a system where libcrypt is linked against glibc and thus not linkable. 2. When cross-compiling, for similar reasons. Best regards, Piotr Sikora ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel
Re: [PATCH] Core: fix build without libcrypt
пн, 18 мар. 2024 г. в 15:56, Sergey Kandaurov : > > > On 28 Feb 2024, at 05:23, Piotr Sikora via nginx-devel < > nginx-devel@nginx.org> wrote: > > > > # HG changeset patch > > # User Piotr Sikora > > # Date 1708977637 0 > > # Mon Feb 26 20:00:37 2024 + > > # 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 > > In popular RPM- and Debian-based Linux distributions with glibc 2.38, > libcrypt.so is now indeed installed in a separate package. > However, it appears that this package is critical and provides > dependency either for systemd or libc, which cannot be removed. > So, I don't see so far, how nginx is affected in practice. > I guess docker images are meant. usually you do not have systemd inside docker > > > > > diff -r 04e3155b3b96 -r cdc173477ea9 auto/unix > > --- a/auto/unix Mon Feb 26 20:00:35 2024 + > > +++ b/auto/unix Mon Feb 26 20:00:37 2024 + > > @@ -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 + > > +++ b/src/os/unix/ngx_linux_config.h Mon Feb 26 20:00:37 2024 + > > @@ -52,7 +52,6 @@ > > #include /* memalign() */ > > #include /* IOV_MAX */ > > #include > > -#include > > #include /* uname() */ > > > > #include > > @@ -61,6 +60,11 @@ > > #include > > > > > > +#if (NGX_HAVE_CRYPT_H) > > +#include > > +#endif > > + > > + > > #if (NGX_HAVE_POSIX_SEM) > > #include > > #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 + > > +++ b/src/os/unix/ngx_user.c Mon Feb 26 20:00:37 2024 + > > @@ -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 > > -- > Sergey Kandaurov > ___ > nginx-devel mailing list > nginx-devel@nginx.org > https://mailman.nginx.org/mailman/listinfo/nginx-devel > ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel
Re: [PATCH] Core: fix build without libcrypt
> On 28 Feb 2024, at 05:23, Piotr Sikora via nginx-devel > wrote: > > # HG changeset patch > # User Piotr Sikora > # Date 1708977637 0 > # Mon Feb 26 20:00:37 2024 + > # 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 In popular RPM- and Debian-based Linux distributions with glibc 2.38, libcrypt.so is now indeed installed in a separate package. However, it appears that this package is critical and provides dependency either for systemd or libc, which cannot be removed. So, I don't see so far, how nginx is affected in practice. > > diff -r 04e3155b3b96 -r cdc173477ea9 auto/unix > --- a/auto/unix Mon Feb 26 20:00:35 2024 + > +++ b/auto/unix Mon Feb 26 20:00:37 2024 + > @@ -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 + > +++ b/src/os/unix/ngx_linux_config.h Mon Feb 26 20:00:37 2024 + > @@ -52,7 +52,6 @@ > #include /* memalign() */ > #include /* IOV_MAX */ > #include > -#include > #include /* uname() */ > > #include > @@ -61,6 +60,11 @@ > #include > > > +#if (NGX_HAVE_CRYPT_H) > +#include > +#endif > + > + > #if (NGX_HAVE_POSIX_SEM) > #include > #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 + > +++ b/src/os/unix/ngx_user.c Mon Feb 26 20:00:37 2024 + > @@ -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 -- Sergey Kandaurov ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel
Re: [PATCH] Core: fix build without libcrypt
Hi Piotr, On Wed, Feb 28, 2024 at 01:23:08AM +, Piotr Sikora via nginx-devel wrote: > # HG changeset patch > # User Piotr Sikora > # Date 1708977637 0 > # Mon Feb 26 20:00:37 2024 + > # 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. Can you provide an example of a system where this fix is needed? > Signed-off-by: Piotr Sikora > > diff -r 04e3155b3b96 -r cdc173477ea9 auto/unix > --- a/auto/unix Mon Feb 26 20:00:35 2024 + > +++ b/auto/unix Mon Feb 26 20:00:37 2024 + > @@ -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 + > +++ b/src/os/unix/ngx_linux_config.h Mon Feb 26 20:00:37 2024 + > @@ -52,7 +52,6 @@ > #include /* memalign() */ > #include /* IOV_MAX */ > #include > -#include > #include /* uname() */ > > #include > @@ -61,6 +60,11 @@ > #include > > > +#if (NGX_HAVE_CRYPT_H) > +#include > +#endif > + > + > #if (NGX_HAVE_POSIX_SEM) > #include > #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 + > +++ b/src/os/unix/ngx_user.c Mon Feb 26 20:00:37 2024 + > @@ -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 -- Roman Arutyunyan ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel
[PATCH] Core: fix build without libcrypt
# HG changeset patch # User Piotr Sikora # Date 1708977637 0 # Mon Feb 26 20:00:37 2024 + # 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 diff -r 04e3155b3b96 -r cdc173477ea9 auto/unix --- a/auto/unix Mon Feb 26 20:00:35 2024 + +++ b/auto/unix Mon Feb 26 20:00:37 2024 + @@ -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.hMon Feb 26 20:00:35 2024 + +++ b/src/os/unix/ngx_linux_config.hMon Feb 26 20:00:37 2024 + @@ -52,7 +52,6 @@ #include /* memalign() */ #include /* IOV_MAX */ #include -#include #include /* uname() */ #include @@ -61,6 +60,11 @@ #include +#if (NGX_HAVE_CRYPT_H) +#include +#endif + + #if (NGX_HAVE_POSIX_SEM) #include #endif diff -r 04e3155b3b96 -r cdc173477ea9 src/os/unix/ngx_user.c --- a/src/os/unix/ngx_user.cMon Feb 26 20:00:35 2024 + +++ b/src/os/unix/ngx_user.cMon Feb 26 20:00:37 2024 + @@ -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