From f7f3b6ae093106e0f86556d1424af30e2122192a Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 21 Mar 2008 17:41:01 +0000 Subject: euid 0 should always be able to find pids too. --- src/rc/rc-status.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/rc/rc-status.c') diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index ef58a14..1e0ef38 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -44,13 +44,16 @@ extern const char *applet; static bool test_crashed = false; static const char *const types_nua[] = { "ineed", "iuse", "iafter", NULL }; -bool _rc_findpid1(void) +bool _rc_can_find_pids(void) { RC_PIDLIST *pids; RC_PID *pid; RC_PID *pid2; bool retval = false; + if (geteuid() == 0) + return true; + /* If we cannot see process 1, then we don't test to see if * services crashed or not */ pids = rc_find_pids(NULL, NULL, 0, 1); @@ -151,7 +154,7 @@ int rc_status(int argc, char **argv) int opt; int depopts = RC_DEP_STRICT | RC_DEP_START | RC_DEP_TRACE; - test_crashed = _rc_findpid1(); + test_crashed = _rc_can_find_pids(); while ((opt = getopt_long(argc, argv, getoptstring, longopts, (int *) 0)) != -1) -- cgit v1.2.3