Unbreak nscd(8). Without this change the CMSG gets truncated.
No idea how it worked before.
It also splits checks into separate "ifs", with a small tweak to debug.h
it makes it easier to see which one fails.
Differential D17452
Unbreak nscd(8). trasz on Oct 6 2018, 6:09 PM. Authored by Tags None Referenced Files
Details Unbreak nscd(8). Without this change the CMSG gets truncated. It also splits checks into separate "ifs", with a small tweak to debug.h
Diff Detail
Event TimelineComment Actions The answer to “how it worked before” is that it didn't. It has never worked properly.
Comment Actions I believe this is correct (with or without the suggested changes), but send_credentials() in usr.sbin/nscd/nscdcli.c also needs to be fixed. It was not touched by rS158257, which introduced the bug you are fixing here while trying to fix another, so the bug is slightly different. It is supposed to be (almost) identical to lib/libc/net/nscachedcli.c; the latter is actually the former ported into libc. Both files as well as usr.sbin/nscd/query.c have pervasive style issues, as I pointed out when nscd was first imported, but perhaps it's best to leave that for later.
Comment Actions This version has a couple of regressions from the previous one. Remember that CMSG_SPACE and CMSG_LEN already include space for the header, plus alignment and padding. See CMSG_DATA(3) and sys/sys/socket.h.
|