From 2401ecb078697a0c1c59c4231422db49049883a0 Mon Sep 17 00:00:00 2001 From: smitsohu Date: Tue, 11 Dec 2018 19:37:38 +0100 Subject: xorg: check if Xauthority mount point was created and print more meaningful error message --- src/firejail/x11.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/firejail/x11.c b/src/firejail/x11.c index c30ab5956..a59ee3ffb 100644 --- a/src/firejail/x11.c +++ b/src/firejail/x11.c @@ -1171,8 +1171,13 @@ void x11_xorg(void) { char *dest; if (asprintf(&dest, "%s/.Xauthority", cfg.homedir) == -1) errExit("asprintf"); - if (lstat(dest, &s) == -1) + if (lstat(dest, &s) == -1) { touch_file_as_user(dest, 0600); + if (stat(dest, &s) == -1) { + fprintf(stderr, "Error: cannot create %s\n", dest); + exit(1); + } + } // get a file descriptor for .Xauthority fd = safe_fd(dest, O_PATH|O_NOFOLLOW|O_CLOEXEC); -- cgit v1.2.3-54-g00ecf