Opened 10 years ago

Closed 10 years ago

#685 closed defect (fixed)

nginx doesn't build under musl due to missing 'current_salt' in 'crypt_data' struct

Reported by: James Taylor Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.7.x
Keywords: Cc:
uname -a: Linux sysresccd 3.12.12-alt401-amd64 #2 SMP Thu Feb 20 20:15:44 UTC 2014 x86_64 Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz GenuineIntel GNU/Linux
nginx -V: nginx version: nginx/1.7.7
TLS SNI support enabled
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=//var/lib/nginx/tmp/client --http-proxy-temp-path=//var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=//var/lib/nginx/tmp/fastcgi --http-scgi-temp-path=//var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=//var/lib/nginx/tmp/uwsgi --with-ipv6 --with-pcre --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_spdy_module --with-http_stub_status_module --with-http_xslt_module --with-http_realip_module --add-module=external_module/nginx-upload-progress-module-0.9.1 --add-module=external_module/ngx_cache_purge-2.1 --add-module=external_module/ngx-fancyindex-0.3.4 --add-module=external_module/nginx_upstream_check_module-0.3.0 --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx

Description

Suggested patch, as taken from alpine linux: http://git.alpinelinux.org/cgit/aports/tree/main/nginx/musl-crypt-fix.patch

--- src/os/unix/ngx_user.c.orig
+++ src/os/unix/ngx_user.c
@@ -31,8 +31,10 @@

struct crypt_data cd;


cd.initialized = 0;

+#ifdef GLIBC

/* work around the glibc bug */
cd.current_salt[0] = ~salt[0];

+#endif

value = crypt_r((char *) key, (char *) salt, &cd);

Change History (2)

comment:1 by Maxim Dounin <mdounin@…>, 10 years ago

In fd6fd02f6a4d1b6889842e49d5a7f895816b2e10/nginx:

Fixed building with musl libc (ticket #685).

comment:2 by Maxim Dounin, 10 years ago

Resolution: fixed
Status: newclosed

Fix comitted, thank you for prodding this.

Note: See TracTickets for help on using tickets.