diff options
Diffstat (limited to 'nscd/connections.c')
-rw-r--r-- | nscd/connections.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/nscd/connections.c b/nscd/connections.c index 4daa09926d..9d1b4d366e 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -311,13 +311,15 @@ cannot handle old request version %d; current version is %d"), break; case GETSTAT: - send_stats (fd, dbs); - break; - case SHUTDOWN: - /* Accept shutdown only from root */ + /* Accept shutdown and getstat only from root */ if (secure_in_use && uid == 0) - termination_handler (0); + { + if (req->type == GETSTAT) + send_stats (fd, dbs); + else + termination_handler (0); + } else { struct ucred caller; @@ -330,8 +332,14 @@ cannot handle old request version %d; current version is %d"), dbg_log (_("error getting callers id: %s"), strerror_r (errno, buf, sizeof (buf))); } - else if (caller.uid == 0) - termination_handler (0); + else + if (caller.uid == 0) + { + if (req->type == GETSTAT) + send_stats (fd, dbs); + else + termination_handler (0); + } } break; |