Bug 13682 - Accessing a traverse-only folder causes "Rejecting root override"
Summary: Accessing a traverse-only folder causes "Rejecting root override"
Status: RESOLVED DUPLICATE of bug 14015
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 4.7.10
Hardware: x64 FreeBSD
: P5 normal (vote)
Target Milestone: ---
Assignee: Ralph Böhme
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-12 10:51 UTC by sylvain
Modified: 2019-11-27 17:39 UTC (History)
2 users (show)

See Also:


Attachments
Only call synthetic_smb_fname() if needed (1.08 KB, patch)
2018-11-12 10:51 UTC, sylvain
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description sylvain 2018-11-12 10:51:13 UTC
Created attachment 14642 [details]
Only call synthetic_smb_fname() if needed

Using catia (or possibly another module using synthetic_smb_fname() ) for a folder with only traverse permission causes "Rejecting root override" because of an empty stat structure.

Steps to Reproduce :

1. Enable catia and a configuration requiring extended attributes.
vfs objects = catia
catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3f:0xbf
store dos attributes = yes
2. Create a folder in the share and chmod 111
3. Access it through Samba, e.g. use smbclient and cd into the traverse-only folder.

Actual result :
 In the smbd log, there's 
[2018/11/09 15:19:46.769895,  0] ../source3/smbd/dosmode.c:302(get_ea_dos_attribute)
  get_ea_dos_attribute: Rejecting root override, invalid stat [folderName]

Expected result :
Nothing in the log, the root override should succeed.

The root override was added with the bug #12944 and the following commit :
https://github.com/samba-team/samba/commit/c54fcb7cbd0de244eed4134e877da6e9c16e7aab#diff-4cd2734b43ff7a3982fbd9e0c42ca452R295

The problem seems to be the call to synthetic_smb_fname in catia_get_dos_attributes() :
https://github.com/samba-team/samba/blob/master/source3/modules/vfs_catia.c#L2367
I've patched this file to only call synthetic_smb_fname() if needed (i.e. if the file name was changed) and the bug goes away for folders which doesn't require mapping.
Comment 1 Ralph Böhme 2018-11-12 12:00:40 UTC
(In reply to sylvain from comment #0)
Not sure, but from briefly looking at the catia code, I guess what's missing is passing the exisiting stat info to synthetic_smb_fname().
Comment 2 Ralph Böhme 2019-11-27 17:39:15 UTC

*** This bug has been marked as a duplicate of bug 14015 ***