aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-03-28 20:01:43 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-03-28 20:01:43 -0400
commitb09a24f5ce03b3da3ee962088878c71f43f6d4c5 (patch)
tree3be35533d98ad6f029c46c1211e32f1a4f00345f /src
parentx11 work (diff)
parentMerge pull request #392 from jrabe/master (diff)
downloadfirejail-b09a24f5ce03b3da3ee962088878c71f43f6d4c5.tar.gz
firejail-b09a24f5ce03b3da3ee962088878c71f43f6d4c5.tar.zst
firejail-b09a24f5ce03b3da3ee962088878c71f43f6d4c5.zip
Merge branch 'master' of https://github.com/netblue30/firejail
Diffstat (limited to 'src')
-rw-r--r--src/firejail/x11.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/firejail/x11.c b/src/firejail/x11.c
index 0e97947d2..851157420 100644
--- a/src/firejail/x11.c
+++ b/src/firejail/x11.c
@@ -41,7 +41,7 @@ static int x11_check_xpra(void) {
41static int x11_check_xephyr(void) { 41static 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");