summaryrefslogtreecommitdiff
path: root/src/rc/rc-status.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-21 17:41:01 +0000
committerRoy Marples <roy@marples.name>2008-03-21 17:41:01 +0000
commitf7f3b6ae093106e0f86556d1424af30e2122192a (patch)
treea3db29faadd4e630d6d6ba90ad486f8d6b8d45f1 /src/rc/rc-status.c
parentf6b47568ad9a103c5c84d9e9005a51be87273026 (diff)
downloadopenrc-f7f3b6ae093106e0f86556d1424af30e2122192a.tar.gz
openrc-f7f3b6ae093106e0f86556d1424af30e2122192a.tar.bz2
openrc-f7f3b6ae093106e0f86556d1424af30e2122192a.tar.xz
euid 0 should always be able to find pids too.
Diffstat (limited to 'src/rc/rc-status.c')
-rw-r--r--src/rc/rc-status.c7
1 files changed, 5 insertions, 2 deletions
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)