From: Dan Nicholson Date: Fri, 17 Nov 2017 16:58:00 +0000 (+0000) Subject: lib/repo: Handle race with existing tmpdir being deleted X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~29^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bf85f8d89e125d6c5f83bc4334533529e4a17c03;p=ostree.git lib/repo: Handle race with existing tmpdir being deleted Another tmpdir user may have deleted an existing tmpdir between the time the current user called readdir and tried to open it. Closes: #1346 Approved by: cgwalters --- diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index c1998825..768c9ce7 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -4955,7 +4955,8 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd, if (!glnx_opendirat (dfd_iter.fd, dent->d_name, FALSE, &target_dfd, &local_error)) { - if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY)) + if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY) || + g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) continue; else {