diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/x11.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) { | |||
1171 | char *dest; | 1171 | char *dest; |
1172 | if (asprintf(&dest, "%s/.Xauthority", cfg.homedir) == -1) | 1172 | if (asprintf(&dest, "%s/.Xauthority", cfg.homedir) == -1) |
1173 | errExit("asprintf"); | 1173 | errExit("asprintf"); |
1174 | if (lstat(dest, &s) == -1) | 1174 | if (lstat(dest, &s) == -1) { |
1175 | touch_file_as_user(dest, 0600); | 1175 | touch_file_as_user(dest, 0600); |
1176 | if (stat(dest, &s) == -1) { | ||
1177 | fprintf(stderr, "Error: cannot create %s\n", dest); | ||
1178 | exit(1); | ||
1179 | } | ||
1180 | } | ||
1176 | 1181 | ||
1177 | // get a file descriptor for .Xauthority | 1182 | // get a file descriptor for .Xauthority |
1178 | fd = safe_fd(dest, O_PATH|O_NOFOLLOW|O_CLOEXEC); | 1183 | fd = safe_fd(dest, O_PATH|O_NOFOLLOW|O_CLOEXEC); |