[dolphin] [Bug 493319] Dolphin segfaults when a file created in a directory whose parent directory is not readable for the user

Akseli Lahtinen bugzilla_noreply at kde.org
Thu Nov 21 19:14:03 GMT 2024


https://bugs.kde.org/show_bug.cgi?id=493319

Akseli Lahtinen <akselmo at akselmo.dev> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/fram
                   |                            |eworks/kio/-/commit/125a451
                   |                            |d524777c6423ed514e4bb1159b3
                   |                            |2c6e8a

--- Comment #5 from Akseli Lahtinen <akselmo at akselmo.dev> ---
Git commit 125a451d524777c6423ed514e4bb1159b32c6e8a by Akseli Lahtinen.
Committed on 21/11/2024 at 19:14.
Pushed by akselmo into branch 'master'.

kcoredirlister: Remove iterator assert, use if instead

In cases where user adds files to a directory which parent
directory is not readable for the user, these asserts
would cause a crash, since the code would try to iterate over an empty list: 

Due to `reinsert` using parent folder of `visible`, which is `hidden`, we have
no permissions to read anything in `hidden` so we get an empty list. Without
`if (it != dirItem->lstItems.end())` this will cause a crash.

This would be okay if we did not allow users browse folders that we can read
inside folders that we can't read. However, we allow this behavior if user
manually types the
path to the Dolphin URL bar for example.

Instead we should just check if the iterator has reached it's end,
and just silently do nothing instead. If user is inside a hidden folder, we
can't
really do any updates to our directory listing views etc. anyway.

M  +47   -0    autotests/kdirlistertest.cpp
M  +1    -0    autotests/kdirlistertest.h
M  +8    -5    src/core/kcoredirlister_p.h

https://invent.kde.org/frameworks/kio/-/commit/125a451d524777c6423ed514e4bb1159b32c6e8a

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list