Accessing attributes of files/sub-directories in a directory might be prevented by a linux security module (e.g., caitsith/tomoyo can restrict access to 'getattr'). If there is at least one such file in a directory, thunar displays an error message "Error when getting information on file 'xyz': Operation not permitted" and does not list any of the remaining files in the directory. It would be great, if thunar proceeds with displaying all (remaining) files in the directory (pcmanfm simply ignores the error but displays the failed file with a question mark icon - I really like this behavior).
Thanks for reporting ! As far as I can see, thunar seems not to call "getattr" directly. There is "g_file_query_info" which is used to read file attributes .. though I did not find a spot which writes the said Error. Do you get the error in detailed view, and in icon view ? Directly after entering the directory ?
> There is "g_file_query_info" which is used to read file attributes .. though > I did not find a spot which writes the said Error. Sorry, I forgot to add the title of the error message "Failed to open directory 'xyz_dir'." and I made a small mistake when reporting the error message "Error when getting information for file 'xyz': Operation not permitted." ('for file', not 'on file'). > Do you get the error in detailed view, and in icon view ? Directly after > entering the directory ? It immediately happens when entering a directory, I'm in the icon view. I assume it should happen when Thunar tries to read the owner/group/permissions of this file (ls displays only '?' for these attributes, it only seems to know the name and whether it is a file or directory).
The error message seems to come from one of these two functions: 1) from 'thunar_window_open_user_folder' where 'thunar_file_get' probably returns NULL (in thunar/thunar-window.c); and/or 2) from 'thunar_standard_view_error' (in thunar/thunar-standard-view.c).
the error message is created by 'thunar_standard_view_error' (in thunar/thunar-standard-view.c). I'm not familiar enough with gtk and C to narrow it further down :( The following should help to reproduce the issue - one example with tomoyo and one with caitsith. In both cases Thunar should report the error when entering a dictionary containing a file named 'foobar'. With caitsith (http://caitsith.osdn.jp/): 5 acl getattr path="/\(\*\)/foobar" task.exe="/usr/bin/thunar" audit 1 10 deny With tomoyo: domain_policy.conf: <kernel> /usr/bin/thunar use_profile 3 file create @THUNAR 0600 file getattr @THUNAR file getattr socket:[family=16:type=3:protocol=15] file getattr socket:[family=1:type=1:protocol=0] file read @THUNAR file truncate @THUNAR file unlink @THUNAR file write @THUNAR misc env \* network unix stream connect /\{\*\}/\* network unix stream connect \000/tmp/\*/\* network unix stream connect \000/tmp/\* exception_policy.conf initialize_domain /usr/bin/thunar from any path_group THUNAR / path_group THUNAR /\* path_group THUNAR /\*/ path_group THUNAR /\{\*\}/\*\-foobar path_group THUNAR /\{\*\}/\*/ path_group THUNAR proc:/ path_group THUNAR proc:/self path_group THUNAR proc:/self/ path_group THUNAR proc:/self/\*
Thnaks for all the details. WIll have a second look on it when I have time !
-- GitLab Migration Automatic Message -- This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/243. Please create an account or use an existing account on one of our supported OAuth providers. If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev