mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-27 11:22:00 -04:00
glnx-shutil: Cope with ENOENT even after recursing to create parents
If we try to create `link/content` where `link` is a dangling symlink, recursing to create `link` will succeed (mkdirat fails with EEXIST, which is explicitly ignored), but then mkdirat for `link/content` will still fail. Fail gracefully instead of crashing out with an assertion failure. Resolves: GNOME/libglnx#1 Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
@@ -149,12 +149,10 @@ mkdir_p_at_internal (int dfd,
|
||||
again:
|
||||
if (mkdirat (dfd, path, mode) == -1)
|
||||
{
|
||||
if (errno == ENOENT)
|
||||
if (errno == ENOENT && !did_recurse)
|
||||
{
|
||||
char *lastslash;
|
||||
|
||||
g_assert (!did_recurse);
|
||||
|
||||
lastslash = strrchr (path, '/');
|
||||
if (lastslash == NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user