From 5c23f9bd9dc9311e8ab3c8de3145ebfcda1555fc Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 1 Jun 2016 10:22:55 +0200 Subject: [PATCH] Don't create empty "repo*" directories in the CWD We were using the wrong dirfd, so we created empty files in the current directory. --- common/flatpak-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index 8dd7c090..1ca9c597 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -3007,10 +3007,10 @@ flatpak_allocate_tmpdir (int tmpdir_dfd, /* No existing tmpdir found, create a new */ - if (!glnx_mkdtempat (tmpdir_dfd, tmpdir_name_template, 0777, error)) + if (!glnx_mkdtempat (dfd_iter.fd, tmpdir_name_template, 0777, error)) return FALSE; - if (!glnx_opendirat (tmpdir_dfd, tmpdir_name_template, FALSE, + if (!glnx_opendirat (dfd_iter.fd, tmpdir_name_template, FALSE, &new_tmpdir_fd, error)) return FALSE; @@ -3018,7 +3018,7 @@ flatpak_allocate_tmpdir (int tmpdir_dfd, /* Note, at this point we can race with another process that picks up this * new directory. If that happens we need to retry, making a new directory. */ - if (!glnx_make_lock_file (tmpdir_dfd, lock_name, LOCK_EX | LOCK_NB, + if (!glnx_make_lock_file (dfd_iter.fd, lock_name, LOCK_EX | LOCK_NB, file_lock_out, &local_error)) { if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))