aboutsummaryrefslogtreecommitdiff
path: root/sway/main.c
diff options
context:
space:
mode:
authorYacine Hmito <yacine.hmito@gmail.com>2016-02-25 22:19:33 +0100
committerYacine Hmito <yacine.hmito@gmail.com>2016-02-25 23:04:59 +0100
commite239fbbd881f129999cac83f3cc150c16781fe3a (patch)
tree659a5a8851af893feb534355bc468e51e50009c6 /sway/main.c
parent179192e22292f3bdcd19e8f9d6e9e1262970bf55 (diff)
No options when using sway as IPC client
Sway used to attempt sending an IPC command composed of every argument after the first non-option argument encountered. Now, raises an error if an option is encountered before the intended command. Some options such as -h or -v take effect when parsing, so they still apply.
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c
index 442d36ee..2c5144ba 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -148,6 +148,9 @@ int main(int argc, char **argv) {
}
if (optind < argc) { // Behave as IPC client
+ if(optind != 1) {
+ sway_abort("Don't use options with the IPC client");
+ }
if (getuid() != geteuid() || getgid() != getegid()) {
if (setgid(getgid()) != 0 || setuid(getuid()) != 0) {
sway_abort("Unable to drop root");