about summary refs log tree commit diff
path: root/src/passwd/nscd_query.c
Commit message (Collapse)AuthorAgeFilesLines
* nscd: fall back gracefully on kernels without AF_UNIX supportJoakim Sindholt2021-04-161-1/+9
|
* revert unrelated change that slipped into last commitRich Felker2016-07-131-1/+1
|
* fix regression in tcsetattr on all mips archsRich Felker2016-07-131-1/+1
| | | | | revert commit 8c316e9e49d37ad92c2e7493e16166a2afca419f. it was wrong and does not match how the kernel API works.
* fix spurious errors from pwd/grp functions when nscd backend is absentRich Felker2015-06-091-4/+8
| | | | | | | | | | | for several pwd/grp functions, the only way the caller can distinguish between a successful negative result ("no such user/group") and an internal error is by clearing errno before the call and checking errno afterwards. the nscd backend support code correctly simulated a not-found response on systems where such a backend is not running, but failed to restore errno. this commit also fixed an outdated/incorrect comment.
* avoid sending huge names as nscd passwd/group queriesRich Felker2015-03-151-2/+3
| | | | | overly long user/group names are potentially a DoS vector and source of other problems like partial writes by sendmsg, and not useful.
* simplify nscd lookup code for alt passwd/group backendsRich Felker2015-03-151-11/+13
| | | | | | | | | | | | previously, a sentinel value of (FILE *)-1 was used to inform the caller of __nscd_query that nscd is not in use. aside from being an ugly hack, this resulted in duplicate code paths for two logically equivalent cases: no nscd, and "not found" result from nscd. now, __nscd_query simply skips closing the socket and returns a valid FILE pointer when nscd is not in use, and produces a fake "not found" response header. the caller is then responsible for closing the socket just like it would do if it had gotten a real "not found" response.
* support alternate backends for the passwd and group dbsJosiah Worcester2015-02-231-0/+100
when we fail to find the entry in the commonly accepted files, we query a server over a Unix domain socket on /var/run/nscd/socket. the protocol used here is compatible with glibc's nscd protocol on most systems (all that use 32-bit numbers for all the protocol fields, which appears to be everything but Alpha).