diff options
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/main.c b/sway/main.c index db2ed856..6adbf89d 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -25,6 +25,7 @@ static bool terminate_request = false; | |||
25 | void sway_terminate(void) { | 25 | void sway_terminate(void) { |
26 | terminate_request = true; | 26 | terminate_request = true; |
27 | wlc_terminate(); | 27 | wlc_terminate(); |
28 | exit(EXIT_FAILURE); | ||
28 | } | 29 | } |
29 | 30 | ||
30 | void sig_handler(int signal) { | 31 | void sig_handler(int signal) { |
@@ -103,7 +104,7 @@ int main(int argc, char **argv) { | |||
103 | int c; | 104 | int c; |
104 | while (1) { | 105 | while (1) { |
105 | int option_index = 0; | 106 | int option_index = 0; |
106 | c = getopt_long(argc, argv, "hCdvVpc:", long_options, &option_index); | 107 | c = getopt_long(argc, argv, "hCdvVc:", long_options, &option_index); |
107 | if (c == -1) { | 108 | if (c == -1) { |
108 | break; | 109 | break; |
109 | } | 110 | } |
@@ -148,6 +149,9 @@ int main(int argc, char **argv) { | |||
148 | } | 149 | } |
149 | 150 | ||
150 | if (optind < argc) { // Behave as IPC client | 151 | if (optind < argc) { // Behave as IPC client |
152 | if(optind != 1) { | ||
153 | sway_abort("Don't use options with the IPC client"); | ||
154 | } | ||
151 | if (getuid() != geteuid() || getgid() != getegid()) { | 155 | if (getuid() != geteuid() || getgid() != getegid()) { |
152 | if (setgid(getgid()) != 0 || setuid(getuid()) != 0) { | 156 | if (setgid(getgid()) != 0 || setuid(getuid()) != 0) { |
153 | sway_abort("Unable to drop root"); | 157 | sway_abort("Unable to drop root"); |