aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-03 09:57:48 +0000
committerRoy Marples <roy@marples.name>2008-03-03 09:57:48 +0000
commit5971d14afd7e67b088307cd589f84491e99625ed (patch)
tree52f2c0dbf88f20d9f56b3af96ff9e4138d0077f4
parentdca4034bd5724d9f568687ba7266f327f198dded (diff)
Ensure that normal users can use s-s-d on NetBSD.
-rw-r--r--src/librc/librc-daemon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index e6641410..938448d1 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -194,6 +194,7 @@ librc_hidden_def(rc_find_pids)
# define _GET_KINFO_COMM(kp) (kp.ki_comm)
# define _GET_KINFO_PID(kp) (kp.ki_pid)
# define _KVM_PATH _PATH_DEVNULL
+# define _KVM_FLAGS O_RDONLY
# else
# define _KVM_GETPROC2
# define _KINFO_PROC kinfo_proc2
@@ -202,6 +203,7 @@ librc_hidden_def(rc_find_pids)
# define _GET_KINFO_COMM(kp) (kp.p_comm)
# define _GET_KINFO_PID(kp) (kp.p_pid)
# define _KVM_PATH NULL
+# define _KVM_FLAGS KVM_NO_FILES
# endif
pid_t *rc_find_pids (const char *const *argv, const char *cmd,
@@ -221,7 +223,7 @@ pid_t *rc_find_pids (const char *const *argv, const char *cmd,
int match;
if ((kd = kvm_openfiles (_KVM_PATH, _KVM_PATH,
- NULL, O_RDONLY, errbuf)) == NULL)
+ NULL, _KVM_FLAGS, errbuf)) == NULL)
{
fprintf (stderr, "kvm_open: %s\n", errbuf);
return (NULL);