mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-08 18:30:18 +00:00
Avoid write to invalid file descriptor in nscd
When readding entries to the group and services cache and the lookup is unsuccesful, we tried to write the notfound record. Just don't do it in this case.
This commit is contained in:
parent
5c0b8d9013
commit
cf3b23ffcd
@ -1,3 +1,9 @@
|
||||
2011-06-29 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
* nscd/grpcache.c (cache_addgr): Don't write notfound reply if we
|
||||
are re-adding the entry.
|
||||
* nscd/servicescache.c (cache_addserv): Likewise.
|
||||
|
||||
2011-06-28 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
[BZ #12935]
|
||||
|
@ -114,8 +114,9 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
|
||||
case. */
|
||||
total = sizeof (notfound);
|
||||
|
||||
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||
MSG_NOSIGNAL));
|
||||
if (fd != -1)
|
||||
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||
MSG_NOSIGNAL));
|
||||
|
||||
dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||
1);
|
||||
|
@ -104,8 +104,9 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
|
||||
case. */
|
||||
total = sizeof (notfound);
|
||||
|
||||
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||
MSG_NOSIGNAL));
|
||||
if (fd != -1)
|
||||
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
||||
MSG_NOSIGNAL));
|
||||
|
||||
dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
||||
1);
|
||||
|
Loading…
Reference in New Issue
Block a user