continue;
}
+ /* Check whether this is a valid request type. */
+ if (req.type < GETPWBYNAME || req.type >= LASTREQ)
+ goto close_and_out;
+
/* Some systems have no SO_PEERCRED implementation. They don't
care about security so we don't as well. */
#ifdef SO_PEERCRED
{
dbg_log (_("error getting callers id: %s"),
strerror_r (errno, buf, sizeof (buf)));
- close (fd);
- continue;
+ goto close_and_out;
}
if (req.type < GETPWBYNAME || req.type > LASTDBREQ
{
if (debug_level > 0)
dbg_log (_("key length in request too long: %d"), req.key_len);
- close (fd);
- continue;
}
else
{
/* Phew, we got all the data, now process it. */
handle_request (fd, &req, keybuf, uid);
-
- /* We are done. */
- close (fd);
}
+ close_and_out:
+ /* We are done. */
+ close (fd);
+
/* Just determine whether any data is present. We do this to
measure whether clients are queued up. */
try_get: