pikhq / musl-nscd Goto Github PK
View Code? Open in Web Editor NEWMusl-nscd is an implementation of the NSCD protocol, suitable for use with musl and with standard NSS modules
License: Other
Musl-nscd is an implementation of the NSCD protocol, suitable for use with musl and with standard NSS modules
License: Other
If /etc/nsswitch.conf
is missing, nscd fails to run with following message:
# /musl-nscd-1.0.1/obj/nscd
nscd: No such file or directory
This error persists even after touch /etc/nsswitch.conf
.
If the path (/var/run/nscd/) does not exist then socket creation die, perhaps pre-create the directory will be an idea into the main.c
Consider replacing all instances with /* empty */
instead.
When yacc (or lex) cannot be found, configure
outputs:
./configure: cannot find yacc. Will try to use pre-provided source.
Despite this message, it aborts at that line, probably due to a misplaced exit 1
in the configure script.
I ran sed 's/exit 1 ;//' -i configure
and now the script behaves as expected.
How does this project compare against something like skarnet's nsss?
Tried to build libnss_mdns against musl-nscd-dev on Alpine. However got errors when building libnss_mdns against musl-nscd-dev:
$ make -j4
make all-am
make[1]: Entering directory '/mnt/home/wxh/junk/nss-mdns-0.15.1'
CC src/libnss_mdns_la-util.lo
CC src/libnss_mdns_la-avahi.lo
CC src/libnss_mdns_la-nss.lo
CC src/libnss_mdns4_la-util.lo
In file included from src/util.c:32:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c: In function 'local_soa':
src/util.c:125:14: warning: implicit declaration of function 'res_ninit'; did you mean 'res_init'? [-Wimplicit-function-declaration]
125 | result = res_ninit(&state);
| ^~~~~~~~~
| res_init
src/util.c:129:9: warning: implicit declaration of function 'res_nquery'; did you mean 'res_query'? [-Wimplicit-function-declaration]
129 | res_nquery(&state, "local", ns_c_in, ns_t_soa, answer, sizeof answer);
| ^~~~~~~~~~
| res_query
src/util.c:130:5: warning: implicit declaration of function 'res_nclose' [-Wimplicit-function-declaration]
130 | res_nclose(&state);
| ^~~~~~~~~~
src/util.c: At top level:
src/util.c:217:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
217 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c:215:17: error: conflicting types for 'convert_userdata_to_addrtuple'
215 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/util.c:32:
src/util.h:112:17: note: previous declaration of 'convert_userdata_to_addrtuple' was here
112 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util.c: In function 'convert_userdata_to_addrtuple':
src/util.c:237:36: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
237 | memset(tuple, 0, sizeof(*tuple));
| ^
src/util.c:240:46: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
240 | tuple = buffer_alloc(buf, sizeof(struct gaih_addrtuple));
| ^~~~~~
src/util.c:248:14: error: invalid use of undefined type 'struct gaih_addrtuple'
248 | tuple->name = buffer_name;
| ^~
src/util.c:251:14: error: invalid use of undefined type 'struct gaih_addrtuple'
251 | tuple->family = result->af;
| ^~
src/util.c:254:23: error: invalid use of undefined type 'struct gaih_addrtuple'
254 | memcpy(&(tuple->addr), &(result->address), address_length);
| ^~
src/util.c:257:14: error: invalid use of undefined type 'struct gaih_addrtuple'
257 | tuple->scopeid = result->scopeid;
| ^~
src/util.c:265:23: error: invalid use of undefined type 'struct gaih_addrtuple'
265 | tuple_prev->next = tuple;
| ^~
In file included from src/nss.c:35:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
In file included from src/nss.c:36:
src/nss.h:38:64: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
38 | enum nss_status _nss_mdns_gethostbyname4_r(const char*, struct gaih_addrtuple**,
| ^~~~~~~~~~~~~~
src/nss.c:152:51: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
152 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/nss.c:151:17: error: conflicting types for '_nss_mdns_gethostbyname4_r'
151 | enum nss_status _nss_mdns_gethostbyname4_r(const char* name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/avahi.c:34:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
In file included from src/nss.c:36:
src/nss.h:38:17: note: previous declaration of '_nss_mdns_gethostbyname4_r' was here
38 | enum nss_status _nss_mdns_gethostbyname4_r(const char*, struct gaih_addrtuple**,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1156: src/libnss_mdns_la-util.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
src/nss.c: In function '_nss_mdns_gethostbyname4_r':
src/nss.c:168:52: warning: passing argument 3 of 'convert_userdata_to_addrtuple' from incompatible pointer type [-Wincompatible-pointer-types]
168 | return convert_userdata_to_addrtuple(&u, name, pat, &buf, errnop, h_errnop);
| ^~~
| |
| struct gaih_addrtuple **
In file included from src/nss.c:35:
src/util.h:114:71: note: expected 'struct gaih_addrtuple **' but argument is of type 'struct gaih_addrtuple **'
114 | struct gaih_addrtuple** pat,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from src/util.c:32:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c: In function 'local_soa':
src/util.c:125:14: warning: implicit declaration of function 'res_ninit'; did you mean 'res_init'? [-Wimplicit-function-declaration]
125 | result = res_ninit(&state);
| ^~~~~~~~~
| res_init
src/util.c:129:9: warning: implicit declaration of function 'res_nquery'; did you mean 'res_query'? [-Wimplicit-function-declaration]
129 | res_nquery(&state, "local", ns_c_in, ns_t_soa, answer, sizeof answer);
| ^~~~~~~~~~
| res_query
src/util.c:130:5: warning: implicit declaration of function 'res_nclose' [-Wimplicit-function-declaration]
130 | res_nclose(&state);
| ^~~~~~~~~~
make[1]: *** [Makefile:1170: src/libnss_mdns_la-nss.lo] Error 1
src/util.c: At top level:
src/util.c:217:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
217 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c:215:17: error: conflicting types for 'convert_userdata_to_addrtuple'
215 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/util.c:32:
src/util.h:112:17: note: previous declaration of 'convert_userdata_to_addrtuple' was here
112 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util.c: In function 'convert_userdata_to_addrtuple':
src/util.c:237:36: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
237 | memset(tuple, 0, sizeof(*tuple));
| ^
src/util.c:240:46: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
240 | tuple = buffer_alloc(buf, sizeof(struct gaih_addrtuple));
| ^~~~~~
src/util.c:248:14: error: invalid use of undefined type 'struct gaih_addrtuple'
248 | tuple->name = buffer_name;
| ^~
src/util.c:251:14: error: invalid use of undefined type 'struct gaih_addrtuple'
251 | tuple->family = result->af;
| ^~
src/util.c:254:23: error: invalid use of undefined type 'struct gaih_addrtuple'
254 | memcpy(&(tuple->addr), &(result->address), address_length);
| ^~
src/util.c:257:14: error: invalid use of undefined type 'struct gaih_addrtuple'
257 | tuple->scopeid = result->scopeid;
| ^~
src/util.c:265:23: error: invalid use of undefined type 'struct gaih_addrtuple'
265 | tuple_prev->next = tuple;
| ^~
make[1]: *** [Makefile:1177: src/libnss_mdns4_la-util.lo] Error 1
make[1]: Leaving directory '/mnt/home/wxh/junk/nss-mdns-0.15.1'
make: *** [Makefile:819: all] Error 2
wxh@lg-blk ~/junk/nss-mdns-0.15.1 1.638s 2 ❯ CFLAGS="-O3" CFLAG="-O3" make -j4
make all-am
make[1]: Entering directory '/mnt/home/wxh/junk/nss-mdns-0.15.1'
CC src/libnss_mdns_la-util.lo
CC src/libnss_mdns_la-nss.lo
CC src/libnss_mdns4_la-util.lo
CC src/libnss_mdns4_la-avahi.lo
In file included from src/util.c:32:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
In file included from src/avahi.c:34:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c: In function 'local_soa':
src/util.c:125:14: warning: implicit declaration of function 'res_ninit'; did you mean 'res_init'? [-Wimplicit-function-declaration]
125 | result = res_ninit(&state);
| ^~~~~~~~~
| res_init
src/util.c:129:9: warning: implicit declaration of function 'res_nquery'; did you mean 'res_query'? [-Wimplicit-function-declaration]
129 | res_nquery(&state, "local", ns_c_in, ns_t_soa, answer, sizeof answer);
| ^~~~~~~~~~
| res_query
src/util.c:130:5: warning: implicit declaration of function 'res_nclose' [-Wimplicit-function-declaration]
130 | res_nclose(&state);
| ^~~~~~~~~~
src/util.c: At top level:
src/util.c:217:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
217 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c:215:17: error: conflicting types for 'convert_userdata_to_addrtuple'
215 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/util.c:32:
src/util.h:112:17: note: previous declaration of 'convert_userdata_to_addrtuple' was here
112 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util.c: In function 'convert_userdata_to_addrtuple':
src/util.c:237:36: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
237 | memset(tuple, 0, sizeof(*tuple));
| ^
src/util.c:240:46: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
240 | tuple = buffer_alloc(buf, sizeof(struct gaih_addrtuple));
| ^~~~~~
src/util.c:248:14: error: invalid use of undefined type 'struct gaih_addrtuple'
248 | tuple->name = buffer_name;
| ^~
src/util.c:251:14: error: invalid use of undefined type 'struct gaih_addrtuple'
251 | tuple->family = result->af;
| ^~
src/util.c:254:23: error: invalid use of undefined type 'struct gaih_addrtuple'
254 | memcpy(&(tuple->addr), &(result->address), address_length);
| ^~
src/util.c:257:14: error: invalid use of undefined type 'struct gaih_addrtuple'
257 | tuple->scopeid = result->scopeid;
| ^~
src/util.c:265:23: error: invalid use of undefined type 'struct gaih_addrtuple'
265 | tuple_prev->next = tuple;
| ^~
In file included from src/util.c:32:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
In file included from src/nss.c:35:
src/util.h:114:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
114 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
In file included from src/nss.c:36:
src/nss.h:38:64: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
38 | enum nss_status _nss_mdns_gethostbyname4_r(const char*, struct gaih_addrtuple**,
| ^~~~~~~~~~~~~~
src/util.c: In function 'local_soa':
src/util.c:125:14: warning: implicit declaration of function 'res_ninit'; did you mean 'res_init'? [-Wimplicit-function-declaration]
125 | result = res_ninit(&state);
| ^~~~~~~~~
| res_init
src/util.c:129:9: warning: implicit declaration of function 'res_nquery'; did you mean 'res_query'? [-Wimplicit-function-declaration]
129 | res_nquery(&state, "local", ns_c_in, ns_t_soa, answer, sizeof answer);
| ^~~~~~~~~~
| res_query
src/nss.c:152:51: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
152 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/nss.c:151:17: error: conflicting types for '_nss_mdns_gethostbyname4_r'
151 | enum nss_status _nss_mdns_gethostbyname4_r(const char* name,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/nss.c:36:
src/nss.h:38:17: note: previous declaration of '_nss_mdns_gethostbyname4_r' was here
38 | enum nss_status _nss_mdns_gethostbyname4_r(const char*, struct gaih_addrtuple**,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/nss.c: In function '_nss_mdns_gethostbyname4_r':
src/nss.c:168:52: warning: passing argument 3 of 'convert_userdata_to_addrtuple' from incompatible pointer type [-Wincompatible-pointer-types]
168 | return convert_userdata_to_addrtuple(&u, name, pat, &buf, errnop, h_errnop);
| ^~~
| |
| struct gaih_addrtuple **
In file included from src/nss.c:35:
src/util.h:114:71: note: expected 'struct gaih_addrtuple **' but argument is of type 'struct gaih_addrtuple **'
114 | struct gaih_addrtuple** pat,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
make[1]: *** [Makefile:1156: src/libnss_mdns_la-util.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
src/util.c:130:5: warning: implicit declaration of function 'res_nclose' [-Wimplicit-function-declaration]
130 | res_nclose(&state);
| ^~~~~~~~~~
src/util.c: At top level:
src/util.c:217:54: warning: 'struct gaih_addrtuple' declared inside parameter list will not be visible outside of this definition or declaration
217 | struct gaih_addrtuple** pat,
| ^~~~~~~~~~~~~~
src/util.c:215:17: error: conflicting types for 'convert_userdata_to_addrtuple'
215 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/util.c:32:
src/util.h:112:17: note: previous declaration of 'convert_userdata_to_addrtuple' was here
112 | enum nss_status convert_userdata_to_addrtuple(const userdata_t* u,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util.c: In function 'convert_userdata_to_addrtuple':
src/util.c:237:36: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
237 | memset(tuple, 0, sizeof(*tuple));
| ^
src/util.c:240:46: error: invalid application of 'sizeof' to incomplete type 'struct gaih_addrtuple'
240 | tuple = buffer_alloc(buf, sizeof(struct gaih_addrtuple));
| ^~~~~~
src/util.c:248:14: error: invalid use of undefined type 'struct gaih_addrtuple'
248 | tuple->name = buffer_name;
| ^~
src/util.c:251:14: error: invalid use of undefined type 'struct gaih_addrtuple'
251 | tuple->family = result->af;
| ^~
src/util.c:254:23: error: invalid use of undefined type 'struct gaih_addrtuple'
254 | memcpy(&(tuple->addr), &(result->address), address_length);
| ^~
src/util.c:257:14: error: invalid use of undefined type 'struct gaih_addrtuple'
257 | tuple->scopeid = result->scopeid;
| ^~
src/util.c:265:23: error: invalid use of undefined type 'struct gaih_addrtuple'
265 | tuple_prev->next = tuple;
| ^~
make[1]: *** [Makefile:1170: src/libnss_mdns_la-nss.lo] Error 1
make[1]: *** [Makefile:1177: src/libnss_mdns4_la-util.lo] Error 1
make[1]: Leaving directory '/mnt/home/wxh/junk/nss-mdns-0.15.1'
make: *** [Makefile:819: all] Error 2
I can’t get it work with winbind (Samba 4 DC) on Alpine Linux.
$ getent passwd kflynn; echo $?
2
strace of musl-nscd:
accept(4, NULL, NULL) = 5
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
mmap(NULL, 94208, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff18f466000
mprotect(0x7ff18f468000, 86016, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7ff18f47ca88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|0x400000, parent_tidptr=0x7ff18f47cae8, tls=0x7ff18f47cab0, child_tidptr=0x7ff18f47cae8) = 3546
read(5, "\2\0\0\0\0\0\0\0\7\0\0\0", 12) = 12
read(5, "kflynn\0", 7) = 7
brk(0x7ff191657000) = 0x7ff191657000
getpid() = 3542
getpid() = 3542
getpid() = 3542
lstat("/var/run/samba/winbindd", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
lstat("/var/run/samba/winbindd/pipe", {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
socket(AF_UNIX, SOCK_STREAM, 0) = 6
fcntl(6, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(6, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(6, F_GETFD) = 0
fcntl(6, F_SETFD, FD_CLOEXEC) = 0
connect(6, {sa_family=AF_UNIX, sun_path="/var/run/samba/winbindd/pipe"}, 110) = 0
getpid() = 3542
getpid() = 3542
poll([{fd=6, events=POLLIN|POLLOUT|POLLHUP}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}])
write(6, "0\10\0\0\0\0\0\0\0\0\0\0\326\r\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2096) = 2096
getpid() = 3542
poll([{fd=6, events=POLLIN|POLLHUP}], 1, 5000) = 1 ([{fd=6, revents=POLLIN}])
read(6, "\250\r\0\0\2\0\0\0\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 3496) = 3496
getpid() = 3542
getpid() = 3542
poll([{fd=6, events=POLLIN|POLLOUT|POLLHUP}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}])
write(6, "0\10\0\0,\0\0\0\0\0\0\0\326\r\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2096) = 2096
getpid() = 3542
poll([{fd=6, events=POLLIN|POLLHUP}], 1, 5000) = 1 ([{fd=6, revents=POLLIN}])
read(6, "\313\r\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 3496) = 3496
getpid() = 3542
poll([{fd=6, events=POLLIN|POLLHUP}], 1, 5000) = 1 ([{fd=6, revents=POLLIN}])
read(6, "/var/lib/samba/winbindd_privileg"..., 35) = 35
lstat("/var/lib/samba/winbindd_privileged", {st_mode=S_IFDIR|0750, st_size=8, ...}) = 0
lstat("/var/lib/samba/winbindd_privileged/pipe", {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
socket(AF_UNIX, SOCK_STREAM, 0) = 7
fcntl(7, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(7, F_GETFD) = 0
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
connect(7, {sa_family=AF_UNIX, sun_path="/var/lib/samba/winbindd_privileged/pipe"}, 110) = 0
close(6) = 0
poll([{fd=7, events=POLLIN|POLLOUT|POLLHUP}], 1, -1) = 1 ([{fd=7, revents=POLLOUT}])
write(7, "0\10\0\0\1\0\0\0\0\0\0\0\326\r\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2096) = 2096
getpid() = 3542
poll([{fd=7, events=POLLIN|POLLHUP}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
read(7, "\250\r\0\0\2\0\0\0ENCOMCOM\\kflynn\0\0\0\0\0\0\0\0\0"..., 3496) = 3496
write(5, "\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 36) = 36
close(5) = 0
poll([{fd=4, events=POLLIN}], 1, -1
And when I query user who is both in /etc/passwd
and Samba (winbind fails on it according to documentation):
$ id samflynn
uid=1020(samflynn) gid=1000(encomcom) groups=1000(encomcom)
strace of musl-nscd:
) = 1 ([{fd=4, revents=POLLIN}])
accept(4, NULL, NULL) = 5
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
mmap(NULL, 94208, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f027a24f000
mprotect(0x7f027a251000, 86016, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7f027a265a88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|0x400000, parent_tidptr=0x7f027a265ae8, tls=0x7f027a265ab0, child_tidptr=0x7f027a265ae8) = 3662
read(5, "\2\0\0\0\17\0\0\0\t\0\0\0", 12) = 12
read(5, "samflynn\0", 9) = 9
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7f02} ---
+++ killed by SIGSEGV +++
Segmentation fault
What nss modules do you use with musl-nscd?
- return write_groups(fd, swap, 0 > 0 ? 0 : -1, 0);
+ return write_groups(fd, swap, 0, 0) > 0 ? 0 : -1;
...
- return write_groups(fd, swap, 0 > 0 ? 0 : -1, 0);
+ return write_groups(fd, swap, 0, 0) > 0 ? 0 : -1;
...
- if(full_write(fd, (char*)head, sizeof head < 0)) return -1;
+ if(full_write(fd, (char*)head, sizeof head) < 0) return -1;
...
- for(i = 0; i < GR_LEN; i++) {
+ for(i = 0; i < INITGR_LEN; i++) {
I also added ignoring SIGPIPE
.
When I was referring to your code, I found that there were some problems with the Strxfrm() function and the Wcsxfrm() function in the MUSL Lic library. The two functions are located in the “musl-1.1.23\src\locale” directory.
As for the Strxfrm() function, when n = l or n < l, the copy string function is not executed.
As for the Wcsxfrm() function, when n = 1, l = 2, a character of the source string is not copied, but only one ‘\0’.
In response to the above questions, I made the following changes:
size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t loc)
{
size_t l = strlen(src);
if (l < n) {
stpncpy(dest, src, l+1);
} else if (n) {
stpncpy(dest, src, n);
}
return l;
}
size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc)
{
size_t l = wcslen(src);
if (l < n) {
wmemcpy(dest, src, l+1);
} else if (n) {
wmemcpy(dest, src, n-1);
dest[n-1] = 0;
}
return l;
}
First of all, thank you very much for your work on this project.
Are there any plans to implement DB_HOSTS support and the 'files' backend?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.