diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2017-07-28 18:10:45 +0100 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2017-07-29 23:52:23 +0100 |
commit | 1f57ceec4c4e7c3d42f341921e36fe4aab612e57 (patch) | |
tree | 022fe34888cda929ac4f951c1a5c71c88c332bb9 /src | |
parent | 509eca76f0755e94b5981f464f9f9a882499180a (diff) | |
download | irssi-1f57ceec4c4e7c3d42f341921e36fe4aab612e57.zip |
Prevent the user from calling "/capsicum enter" twice.
Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/capsicum.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/capsicum.c b/src/core/capsicum.c index 99f7ff0f..f44b326d 100644 --- a/src/core/capsicum.c +++ b/src/core/capsicum.c @@ -252,8 +252,15 @@ static void cmd_capsicum(const char *data, SERVER_REC *server, void *item) static void cmd_capsicum_enter(void) { + u_int mode; int error; + error = cap_getmode(&mode); + if (error == 0 && mode != 0) { + g_warning("Already in capability mode"); + return; + } + error = start_symbiont(); if (error != 0) { signal_emit("capability mode failed", 1, strerror(errno)); |