diff options
Diffstat (limited to 'common/uapi/conf.c')
| -rw-r--r-- | common/uapi/conf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/uapi/conf.c b/common/uapi/conf.c index 7e88358..2094604 100644 --- a/common/uapi/conf.c +++ b/common/uapi/conf.c @@ -57,6 +57,10 @@ SYSCALL_DEFINE2(conf_set)(sys_arg_t param, sys_arg_t val) */ SYSCALL_DEFINE1(poweroff)(sys_arg_t type) { + struct tcb *t = cur_tcb(); + if (!(has_cap(t->caps, CAP_POWER))) + return SYS_RET1(ERR_PERM); + switch (type) { case SHUTDOWN: case COLD_REBOOT: |
