Bug 299155 - File ACLs don't update after changing them and reopening properties
Summary: File ACLs don't update after changing them and reopening properties
Status: REOPENED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.45.0
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 155018 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-01 09:58 UTC by Ruslan Kabatsayev
Modified: 2021-10-10 14:18 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.87


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Kabatsayev 2012-05-01 09:58:46 UTC
See steps to reproduce

Reproducible: Always

Steps to Reproduce:
1. Make any file e.g. /tmp/test
2. Right click it -> Properties -> Permissions tab -> Advanced permissions
3. Add a named user entry, deny its right to e.g. read the file
4. OK, OK to close the dialogs
5. Repeat step 2
6. See the entry missing
7. Restart dolphin
8. The entry is visible
Actual Results:  
The newly created entry is missing from the Advanced permissions list

Expected Results:  
The entry should be updated after modification
Comment 1 Janek Bevendorff 2012-09-07 13:53:19 UTC
*** Bug 155018 has been marked as a duplicate of this bug. ***
Comment 2 Janek Bevendorff 2012-09-07 13:55:00 UTC
*** Bug 173690 has been marked as a duplicate of this bug. ***
Comment 3 Christoph Feck 2012-10-08 10:10:55 UTC
Restarting Dolphin is not required to reproduce 8, you simply have to refresh the view using F5. Not sure if the caching is wrong inside Dolphin or kio.
Comment 4 Ruslan Kabatsayev 2012-10-08 13:46:54 UTC
In fact, I've noticed Dolphin sometimes not updating directory contents when displaying it, and sometimes even just having it in "go back" history when returning to the directory. Maybe this is related. I don't have strict steps to reproduce, can try finding some if needed.
Comment 5 Ruslan Kabatsayev 2014-07-07 08:50:14 UTC
Still present in KDE 4.13.2 from kubuntu-backports PPA.
Comment 6 Nate Graham 2018-05-03 19:41:03 UTC
Still an issue in KDE Frameworks 5.45.
Comment 7 Danil Shein 2021-03-11 09:10:54 UTC
Still an issue in KDE Frameworks 5.70.0
Comment 8 Danil Shein 2021-03-11 09:44:32 UTC
(In reply to Danil Shein from comment #7)
> Still an issue in KDE Frameworks 5.70.0

One suggestion about root cause from my experience with KPropertiesDialog source code:

As far as I cold understand KPropertiesDialog receives KFileItem or KFileItemList instance as input.

All ACLs related data is stored in and managed through related KFileItem UDSEntry.

It looks like when you've reopen file properties dialog again after ACL changes applied it is receive an KFileItem without appropriate UDSEntry and displays ACL as inherited from regular UNIX permissions.

Can't say where and why it actually happens.

My suggestion is based on experience playing around with code:

path = "/home/dshein/src/tmp/1/2/share/1.txt";
    KFileItem kfitem(QUrl::fromLocalFile(path));
    KPropertiesDialog kpd(QString("File properties"), 0);
    kpd.showDialog(kfitem, 0);
    kpd.showDialog(QUrl::fromLocalFile(path), 0);
    kpd.showDialog(kfitem, 0);
    kpd.showDialog(QUrl::fromLocalFile(path), 0);
Comment 9 Danil Shein 2021-03-11 09:54:04 UTC
(In reply to Danil Shein from comment #7)
> Still an issue in KDE Frameworks 5.70.0

One suggestion about root cause from my experience with KPropertiesDialog source code:

As far as I cold understand KPropertiesDialog receives KFileItem or KFileItemList instance as input.

All ACLs related data is stored in and managed through related KFileItem UDSEntry.

It looks like when you've reopen file properties dialog again after ACL changes applied it is receive an KFileItem without appropriate UDSEntry and displays ACL as inherited from regular UNIX permissions.

Can't say where and why it actually happens.

My suggestion is based on experience playing around with code:

    path = "/home/test/1.txt"; // file with ACL
    KFileItem kfitem(QUrl::fromLocalFile(path));
    KPropertiesDialog kpd(QString("File properties"), 0);

    kpd.showDialog(kfitem, 0); // always display ACLs inherited from regular permissions (incorrect)
    kpd.showDialog(QUrl::fromLocalFile(path), 0); // always display consistent file ACls

    auto job = KIO::stat(url);
    job->exec();
    KIO::UDSEntry entry = job->statResult();
    kfitem = KFileItem(entry, url);
    kpd.showDialog(kfitem, 0); // display consistent file ACls
Comment 10 Bug Janitor Service 2021-09-13 11:25:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/581
Comment 11 Ahmad Samir 2021-09-15 11:20:14 UTC
Git commit 74d6983294f58d75ce776fd9011a3d3355b37f57 by Ahmad Samir.
Committed on 14/09/2021 at 23:31.
Pushed by ahmadsamir into branch 'master'.

KFileItem: refresh() shouldn't discard ACL attributes

Following the code:
- changing the ACL permissions of a file via KPropertiesDialog
- when the dialog is closed the dirlister which is installed on the view
  (in e.g. Dolphin or the open file dialog) is notified that the item has
  changed
- KCoreDirLister would then call item.refresh(), if the old item had the ACL
  field(s) set, and they would be gone after calling refresh()
FIXED-IN: 5.87

M  +0    -4    src/aclhelpers_p.h
M  +22   -0    src/core/kfileitem.cpp

https://invent.kde.org/frameworks/kio/commit/74d6983294f58d75ce776fd9011a3d3355b37f57
Comment 12 Patrick Silva 2021-09-28 12:01:30 UTC
This bug is still reproducible on neon unstable.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 13 Patrick Silva 2021-10-10 14:18:22 UTC
it's still reproducible on Arch Linux after update to frameworks 5.87 and reboot.

Operating System: Arch Linux
KDE Plasma Version: 5.22.90
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Graphics Platform: Wayland