diff options
author | jrabe <jrabe@users.noreply.github.com> | 2016-03-28 20:26:07 +0300 |
---|---|---|
committer | jrabe <jrabe@users.noreply.github.com> | 2016-03-28 20:26:07 +0300 |
commit | d7eed6af15684a22b5bd8468f10daeb6cbc1991c (patch) | |
tree | 5bf89b6c22a4c41f516b2457e788da203eb08c42 | |
parent | pulseaudio fix (diff) | |
download | firejail-d7eed6af15684a22b5bd8468f10daeb6cbc1991c.tar.gz firejail-d7eed6af15684a22b5bd8468f10daeb6cbc1991c.tar.zst firejail-d7eed6af15684a22b5bd8468f10daeb6cbc1991c.zip |
Fix xephyr methods referring to xpra
-rw-r--r-- | src/firejail/x11.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/firejail/x11.c b/src/firejail/x11.c index 85141c265..7faf596ea 100644 --- a/src/firejail/x11.c +++ b/src/firejail/x11.c | |||
@@ -41,7 +41,7 @@ static int x11_check_xpra(void) { | |||
41 | static int x11_check_xephyr(void) { | 41 | static int x11_check_xephyr(void) { |
42 | struct stat s; | 42 | struct stat s; |
43 | 43 | ||
44 | // check xpra | 44 | // check xephyr |
45 | if (stat("/usr/bin/Xephyr", &s) == -1) | 45 | if (stat("/usr/bin/Xephyr", &s) == -1) |
46 | return 0; | 46 | return 0; |
47 | 47 | ||
@@ -166,16 +166,17 @@ void x11_start_xephyr(int argc, char **argv) { | |||
166 | pid_t server = 0; | 166 | pid_t server = 0; |
167 | 167 | ||
168 | 168 | ||
169 | // unfortunately, xpra does a number of weird things when started by root user!!! | 169 | // unfortunately, xephyr does a number of weird things when started by root user!!! |
170 | if (getuid() == 0) { | 170 | if (getuid() == 0) { |
171 | fprintf(stderr, "Error: this feature is not available when running as root\n"); | 171 | fprintf(stderr, "Error: this feature is not available when running as root\n"); |
172 | exit(1); | 172 | exit(1); |
173 | } | 173 | } |
174 | 174 | ||
175 | // check xpra | 175 | // check xephyr |
176 | if (x11_check_xpra() == 0) { | 176 | if (x11_check_xephyr() == 0) { |
177 | fprintf(stderr, "\nError: Xephyr program was not found in /usr/bin directory, please install it:\n"); | 177 | fprintf(stderr, "\nError: Xephyr program was not found in /usr/bin directory, please install it:\n"); |
178 | fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n"); | 178 | fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n"); |
179 | fprintf(stderr, " Arch: sudo pacman -S xorg-server-xephyr\n"); | ||
179 | exit(0); | 180 | exit(0); |
180 | } | 181 | } |
181 | 182 | ||
@@ -217,7 +218,7 @@ void x11_start_xephyr(int argc, char **argv) { | |||
217 | errExit("fork"); | 218 | errExit("fork"); |
218 | if (server == 0) { | 219 | if (server == 0) { |
219 | if (arg_debug) | 220 | if (arg_debug) |
220 | printf("Starting xpra...\n"); | 221 | printf("Starting xephyr...\n"); |
221 | 222 | ||
222 | char *a[4]; | 223 | char *a[4]; |
223 | a[0] = "/bin/bash"; | 224 | a[0] = "/bin/bash"; |
@@ -243,7 +244,7 @@ void x11_start_xephyr(int argc, char **argv) { | |||
243 | }; | 244 | }; |
244 | 245 | ||
245 | if (n == 10) { | 246 | if (n == 10) { |
246 | fprintf(stderr, "Error: failed to start xpra\n"); | 247 | fprintf(stderr, "Error: failed to start xephyr\n"); |
247 | exit(1); | 248 | exit(1); |
248 | } | 249 | } |
249 | free(fname); | 250 | free(fname); |
@@ -334,7 +335,7 @@ void x11_start_xpra(int argc, char **argv) { | |||
334 | if (arg_debug) | 335 | if (arg_debug) |
335 | printf("xpra client: %s\n", cmd2); | 336 | printf("xpra client: %s\n", cmd2); |
336 | 337 | ||
337 | signal(SIGHUP,SIG_IGN); // fix sleep(1`) below | 338 | signal(SIGHUP,SIG_IGN); // fix sleep(1) below |
338 | server = fork(); | 339 | server = fork(); |
339 | if (server < 0) | 340 | if (server < 0) |
340 | errExit("fork"); | 341 | errExit("fork"); |