From 179192e22292f3bdcd19e8f9d6e9e1262970bf55 Mon Sep 17 00:00:00 2001 From: Yacine Hmito Date: Thu, 25 Feb 2016 21:49:53 +0100 Subject: Removed p as a valid CLI option The get-socketpath long option had an undocumented short alternative as `p`. It has been removed. However, the code in the options array is still the 'p' char. --- sway/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/main.c') diff --git a/sway/main.c b/sway/main.c index db2ed856..442d36ee 100644 --- a/sway/main.c +++ b/sway/main.c @@ -103,7 +103,7 @@ int main(int argc, char **argv) { int c; while (1) { int option_index = 0; - c = getopt_long(argc, argv, "hCdvVpc:", long_options, &option_index); + c = getopt_long(argc, argv, "hCdvVc:", long_options, &option_index); if (c == -1) { break; } -- cgit v1.2.3-54-g00ecf From e239fbbd881f129999cac83f3cc150c16781fe3a Mon Sep 17 00:00:00 2001 From: Yacine Hmito Date: Thu, 25 Feb 2016 22:19:33 +0100 Subject: 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. --- sway/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sway/main.c') 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"); -- cgit v1.2.3-54-g00ecf From c400ca8f88cc5e3f8a511e14d92a4491d9768d32 Mon Sep 17 00:00:00 2001 From: Yacine Hmito Date: Thu, 25 Feb 2016 23:13:27 +0100 Subject: Fix for when sway_abort doesn't exit sway_terminate does an exit in case wlc_terminate doesn't --- sway/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sway/main.c') diff --git a/sway/main.c b/sway/main.c index 2c5144ba..6adbf89d 100644 --- a/sway/main.c +++ b/sway/main.c @@ -25,6 +25,7 @@ static bool terminate_request = false; void sway_terminate(void) { terminate_request = true; wlc_terminate(); + exit(EXIT_FAILURE); } void sig_handler(int signal) { -- cgit v1.2.3-54-g00ecf