aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar glitsj16 <glitsj16@users.noreply.github.com>2019-06-26 00:51:38 +0000
committerLibravatar GitHub <noreply@github.com>2019-06-26 00:51:38 +0000
commitc3e39d7c5999f200fa0ae86900ade30236ddcaff (patch)
tree906ced31a87e55fbe1f7a9ac7ab7d12868110696
parentdocs update: pkg-config package required on Debian/Ubuntu when running ./conf... (diff)
downloadfirejail-c3e39d7c5999f200fa0ae86900ade30236ddcaff.tar.gz
firejail-c3e39d7c5999f200fa0ae86900ade30236ddcaff.tar.zst
firejail-c3e39d7c5999f200fa0ae86900ade30236ddcaff.zip
Silence xauth output in src/firejail/x11.c (#2796)
* Fix typo's and install instructions for Arch * Try to silence xauth output Fixes https://github.com/netblue30/firejail/issues/2787. * Conditionally silence xauth output in x11 options
-rw-r--r--src/firejail/x11.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/firejail/x11.c b/src/firejail/x11.c
index 69a9a7bee..d3567af8d 100644
--- a/src/firejail/x11.c
+++ b/src/firejail/x11.c
@@ -310,7 +310,7 @@ void x11_start_xvfb(int argc, char **argv) {
310 310
311 if (arg_debug) { 311 if (arg_debug) {
312 size_t i = 0; 312 size_t i = 0;
313 printf("\n*** Stating xvfb client:"); 313 printf("\n*** Starting xvfb client:");
314 while (jail_argv[i]!=NULL) { 314 while (jail_argv[i]!=NULL) {
315 printf(" \"%s\"", jail_argv[i]); 315 printf(" \"%s\"", jail_argv[i]);
316 i++; 316 i++;
@@ -838,7 +838,7 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
838 838
839 if (arg_debug) { 839 if (arg_debug) {
840 if (n == 10) 840 if (n == 10)
841 printf("failed to stop xpra server gratefully\n"); 841 printf("failed to stop xpra server gracefully\n");
842 else 842 else
843 printf("xpra server successfully stopped in %d secs\n", n); 843 printf("xpra server successfully stopped in %d secs\n", n);
844 } 844 }
@@ -1023,6 +1023,7 @@ void x11_start_xpra(int argc, char **argv) {
1023 if (!program_in_path("xpra")) { 1023 if (!program_in_path("xpra")) {
1024 fprintf(stderr, "\nError: Xpra program was not found in /usr/bin directory, please install it:\n"); 1024 fprintf(stderr, "\nError: Xpra program was not found in /usr/bin directory, please install it:\n");
1025 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n"); 1025 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n");
1026 fprintf(stderr, " Arch: sudo pacman -S xpra\n");
1026 exit(0); 1027 exit(0);
1027 } 1028 }
1028 1029
@@ -1056,6 +1057,8 @@ void x11_start(int argc, char **argv) {
1056 fprintf(stderr, "\nError: Xpra or Xephyr not found in /usr/bin directory, please install one of them:\n"); 1057 fprintf(stderr, "\nError: Xpra or Xephyr not found in /usr/bin directory, please install one of them:\n");
1057 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n"); 1058 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n");
1058 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n"); 1059 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n");
1060 fprintf(stderr, " Arch: sudo pacman -S xpra\n");
1061 fprintf(stderr, " Arch: sudo pacman -S xorg-server-xephyr\n");
1059 exit(0); 1062 exit(0);
1060 } 1063 }
1061} 1064}
@@ -1087,7 +1090,8 @@ void x11_xorg(void) {
1087 struct stat s; 1090 struct stat s;
1088 if (stat("/usr/bin/xauth", &s) == -1) { 1091 if (stat("/usr/bin/xauth", &s) == -1) {
1089 fprintf(stderr, "Error: xauth utility not found in /usr/bin. Please install it:\n" 1092 fprintf(stderr, "Error: xauth utility not found in /usr/bin. Please install it:\n"
1090 " Debian/Ubuntu/Mint: sudo apt-get install xauth\n"); 1093 " Debian/Ubuntu/Mint: sudo apt-get install xauth\n"
1094 " Arch: sudo pacman -S xorg-xauth\n");
1091 exit(1); 1095 exit(1);
1092 } 1096 }
1093 if (s.st_uid != 0 && s.st_gid != 0) { 1097 if (s.st_uid != 0 && s.st_gid != 0) {
@@ -1128,8 +1132,14 @@ void x11_xorg(void) {
1128#ifdef HAVE_GCOV 1132#ifdef HAVE_GCOV
1129 __gcov_flush(); 1133 __gcov_flush();
1130#endif 1134#endif
1131 execlp("/usr/bin/xauth", "/usr/bin/xauth", "-v", "-f", tmpfname, 1135 if (arg_debug) {
1136 execlp("/usr/bin/xauth", "/usr/bin/xauth", "-v", "-f", tmpfname,
1132 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted", NULL); 1137 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted", NULL);
1138 }
1139 else {
1140 execlp("/usr/bin/xauth", "/usr/bin/xauth", "-f", tmpfname,
1141 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted", NULL);
1142 }
1133 1143
1134 _exit(127); 1144 _exit(127);
1135 } 1145 }