Description of problem: Permission denied calling SMBC_getatr when file not exists Version-Release number of selected component (if applicable): $ rpm -qa gvfs-* gvfs-client-1.50.2-2.fc37.x86_64 gvfs-afc-1.50.2-2.fc37.x86_64 gvfs-fuse-1.50.2-2.fc37.x86_64 gvfs-goa-1.50.2-2.fc37.x86_64 gvfs-afp-1.50.2-2.fc37.x86_64 gvfs-archive-1.50.2-2.fc37.x86_64 gvfs-gphoto2-1.50.2-2.fc37.x86_64 gvfs-mtp-1.50.2-2.fc37.x86_64 gvfs-smb-1.50.2-2.fc37.x86_64 $ rpm -qa gvfs-smb samba-* libsmbclient* gvfs-smb-1.50.2-2.fc37.x86_64 samba-common-4.17.0-1.fc37.noarch samba-client-libs-4.17.0-1.fc37.x86_64 samba-common-libs-4.17.0-1.fc37.x86_64 libsmbclient-4.17.0-1.fc37.x86_64 samba-client-4.17.0-1.fc37.x86_64 $ rpm -q glib2 glib2-2.73.3-3.fc37.x86_64 How reproducible: Steps to Reproduce: Working: $ gio mount -u "smb://bar@SERVER/foo/" $ gio mount "smb://bar@SERVER/foo/" $ date | gio save /run/user/1000/gvfs/smb-share:server=SERVER\,share=foo\,user=bar/folder/test.txt $ echo $? 0 $ cat /run/user/1000/gvfs/smb-share:server=SERVER\,share=foo\,user=bar/folder/test.txt Thu Sep 15 03:49:57 PM -05 2022 Not working (Permission denied): $ gio mount -u "smb://bar@SERVER/foo/" $ gio mount "smb://bar@SERVER/foo/" $ date | tee /run/user/1000/gvfs/smb-share\:server\=SERVER\,share\=foo\,user\=bar/folder/another-test.txt tee: '/run/user/1000/gvfs/smb-share:server=192.168.44.1,share=backups,user=bar/folder/another-test.txt': Permission denied Thu Sep 15 03:55:20 PM -05 2022 $ echo $? 1 $ date | tee /run/user/1000/gvfs/smb-share\:server\=SERVER\,share\=foo\,user\=bar/folder/test.txt (the file exists because it was created above with "gio save") $ echo $? 0 Actual results: $ date | gio save /run/user/1000/gvfs/smb-share:server=SERVER\,share=foo\,user=bar/folder/test.txt (OK) $ date | tee /run/user/1000/gvfs/smb-share\:server\=SERVER\,share\=foo\,user\=bar/folder/another-test.txt (Fail: Permission denied) Expected results: $ date | tee /run/user/1000/gvfs/smb-share\:server\=SERVER\,share\=foo\,user\=bar/folder/another-test.txt (OK) Additional info: Log messages in GVFS_SMB_DEBUG=10 GVFS_DEBUG=1 /usr/libexec/gvfsd --replace: With "gio save": smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b100068f0 (GVfsJobQueryInfo) smbc_stat(smb://SERVER/foo/folder) SMBC_getatr: sending qpathinfo smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b10006d50 (GVfsJobQueryInfo) smb: send_reply(0x7f0b100068f0), failed=0 () smbc_stat(smb://SERVER/foo/folder) SMBC_getatr: sending qpathinfo smb: send_reply(0x7f0b10006d50), failed=0 () smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b10006df0 (GVfsJobQueryInfo) smbc_stat(smb://SERVER/foo) SMBC_getatr: sending qpathinfo smb: send_reply(0x7f0b10006df0), failed=0 () smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b10006c10 (GVfsJobQueryInfo) smbc_stat(smb://SERVER/foo/folder) SMBC_getatr: sending qpathinfo smb: send_reply(0x7f0b10006c10), failed=0 () smb: backend_dbus_handler org.gtk.vfs.Mount:OpenForWriteFlags (pid=5003) smb: Queued new job 0x7f0b08022190 (GVfsJobOpenForWrite) map_open_params_to_ntcreate: fname = \folder\test.txt, deny_mode = 0x42, open_func = 0x10 map_open_params_to_ntcreate: file \folder\test.txt, access_mask = 0x12019f, share_mode = 0x3, create_disposition = 0x2, create_options = 0x40 private_flags = 0x0 smb: send_reply(0x7f0b08022190), failed=0 () smb: Added new job source 0x7f0b08044570 (GVfsWriteChannel) smb: Queued new job 0x55aefce02eb0 (GVfsJobWrite) smb: send_reply(0x55aefce02eb0), bytes=32, failed=0 () smb: Queued new job 0x55aefcdf5950 (GVfsJobCloseWrite) smb: send_reply(0x55aefcdf5950), failed=0 () With "date | tee": smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b10006cb0 (GVfsJobQueryInfo) smbc_stat(smb://SERVER/foo/folder) smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b10006b70 (GVfsJobQueryInfo) SMBC_getatr: sending qpathinfo smb: send_reply(0x7f0b10006cb0), failed=0 () smbc_stat(smb://SERVER/foo/folder) SMBC_getatr: sending qpathinfo smb: send_reply(0x7f0b10006b70), failed=0 () smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4762) smb: Queued new job 0x7f0b10002400 (GVfsJobQueryInfo) smbc_stat(smb://SERVER/foo/folder/another-test.txt) SMBC_getatr: sending qpathinfo map_errno_from_nt_status: 32 bit codes: code=c0000022 cli_status_to_errno: 0xc0000022 -> 13 smb: send_reply(0x7f0b10002400), failed=1 (Permission denied)
Downgrading to samba-4.16.4-1.fc37 fix the issue.
Apparently SMBC_getatr no longer uses errno but instead returns NTSTATUS: https://github.com/samba-team/samba/commit/d4f8fdd69a1278d8473d541dc6b32014a369bcd0
Reverting the previous commit fixes the bug: I rebuilt the samba SRPM using a mock and added the patch to SPEC and everything works perfect: https://koji.fedoraproject.org/koji/buildinfo?buildID=2062333 $ git format-patch -1 --stdout d4f8fdd69a1278d8473d541dc6b32014a369bcd0 > 0001-libsmb-Convert-SMBC_getatr-to-NTSTATUS.patch 0001-libsmb-Convert-SMBC_getatr-to-NTSTATUS.patch https://koji.fedoraproject.org/koji/buildinfo?buildID=2062333 ... Patch100: 0001-libsmb-Convert-SMBC_getatr-to-NTSTATUS.patch ... %prep xzcat %{SOURCE0} | gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} - %autosetup -n samba-%{version}%{pre_release} -N %autopatch -M 99 %patch100 -p1 -R ...
Could you log an upstream bug for this?
Filed the bug in gvfs: https://gitlab.gnome.org/GNOME/gvfs/-/issues/651 I think this other one is related: https://gitlab.gnome.org/GNOME/gvfs/-/issues/649 Waiting for my samba bugzilla account to be created.
Samba Bugzilla: https://bugzilla.samba.org/show_bug.cgi?id=15195
Fixed issue with Jeremy Allison's patch: https://bugzilla.samba.org/show_bug.cgi?id=15195#c2
Merge request: https://gitlab.com/samba-team/samba/-/merge_requests/2756
I am reviewing the MR https://gitlab.com/samba-team/samba/-/merge_requests/2756 and will patch Fedora 37 once it is ready.
FEDORA-2022-314a73e994 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-314a73e994
FEDORA-2022-314a73e994 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2022-1b0ba70aca has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-1b0ba70aca
Reopening since the F37 update isn't in the stable repo. Proposing as a freeze exception.
FEDORA-2022-1b0ba70aca has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-1b0ba70aca` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-1b0ba70aca See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
*** Bug 2131723 has been marked as a duplicate of this bug. ***
+3 in https://pagure.io/fedora-qa/blocker-review/issue/984 , marking accepted FE.
FEDORA-2022-1b0ba70aca has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report.