X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Fverbs.c;h=d9cdb38d651feb9194ff40b34370549bce61373c;hp=c7beccc2dc291c762307a3f7ccb87200c0fdf9eb;hb=3835ce8528f80dc21606c6c01b90423ba317289b;hpb=3b22396a4b2767a98172f6915929c47738cb0a1e diff --git a/src/basic/verbs.c b/src/basic/verbs.c index c7beccc2d..d9cdb38d6 100644 --- a/src/basic/verbs.c +++ b/src/basic/verbs.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -19,8 +17,16 @@ along with systemd; If not, see . ***/ -#include "util.h" +#include +#include +#include +#include + +#include "log.h" +#include "macro.h" +#include "string-util.h" #include "verbs.h" +#include "virt.h" int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) { const Verb *verb; @@ -77,6 +83,11 @@ int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) { return -EINVAL; } + if ((verb->flags & VERB_NOCHROOT) && running_in_chroot() > 0) { + log_info("Running in chroot, ignoring request."); + return 0; + } + if (name) return verb->dispatch(left, argv + optind, userdata); else {