Bug 14474 - Hide dot files on Samba server is causing permission issues when being used with home share connections without posix extensions
Summary: Hide dot files on Samba server is causing permission issues when being used w...
Status: NEEDINFO
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.11.6
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-30 13:08 UTC by Sysadmin HTL-Leonding
Modified: 2020-09-06 17:04 UTC (History)
0 users

See Also:


Attachments
Server logfiles with the default value of hide dot files = Yes (8.28 MB, application/x-compressed)
2020-09-06 16:53 UTC, Sysadmin HTL-Leonding
no flags Details
Server logfiles with hide dot files = No - with which the program works (13.50 MB, application/x-compressed)
2020-09-06 16:54 UTC, Sysadmin HTL-Leonding
no flags Details
smb.conf from the server with hide dot files = no (the only change between the two logs) (8.86 KB, text/plain)
2020-09-06 17:04 UTC, Sysadmin HTL-Leonding
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sysadmin HTL-Leonding 2020-08-30 13:08:45 UTC
Mounting the (empty) home share from a Samba server as home directory  (tested on an Ubuntu 20.04.1 client against a Ubuntu 20.04.1 Samba server) some programs don't work correctly (i.e. Oracle SQL Developer Data Modeler (maybe a Netbeans component?) hangs at "Restoring Windows").

This happens using the newer SMB dialects (default 3.11) and doesn't happen with SMB1 (which is deprecated and shouldn't be used anymore). 

In the server log files I only saw some ACCESS_DENIED errors, probably on .oraclesqldeveloperdatamodeler/system20.2.0.167.1538/system_cache/config/Windows2Local/Modes/.nbattrs

Using a Windows Server as file store didn't show this behavior.

Changing some options I found out that the default value of "hide dot files = yes" on the Samba server side is causing the permission problems on Samba (probably because the filename starts with a dot). Setting it to "hide dot files = no" allowed the program to start as it does on local homes and on the home share mounted from the Windows Server.

Further testing revealed that the posix extensions in SMB1 seem to have hidden the issue as disabling them caused the same error, but with more details:
openfile_ntcreate: attributes mismatch for file .oraclesqldeveloperdatamodeler/system20.2.0.167.1538/system_cache/config/Windows2Local/Modes/.nbattrs (22 0) (0100764, 0766)

I don't know if changing the default of this parameter would break other things, but I think that the suggestion to set the value of this parameter to no for the home drive share should probably probably be added to the man page or even in the default smb.conf for the [homes] share as the default value causes issues not seen using a Windows Server file share.
Comment 1 Jeremy Allison 2020-08-31 18:31:58 UTC
I'm afraid we'll need more data as to exactly what access is failing in order to investigate this. The current description doesn't provide enough info in order to attempt a fix here.
Comment 2 Sysadmin HTL-Leonding 2020-09-06 16:53:21 UTC
Created attachment 16199 [details]
Server logfiles with the default value of hide dot files = Yes
Comment 3 Sysadmin HTL-Leonding 2020-09-06 16:54:10 UTC
Created attachment 16200 [details]
Server logfiles with hide dot files = No - with which the program works
Comment 4 Sysadmin HTL-Leonding 2020-09-06 17:03:06 UTC
On the client side using ls -alh, I can't see any differences in the permission bits - but probably more than the seen permission bits are being checked.

The program uses a Java VM, so maybe there are more translations involved than when running a compiled C program.

"good"
-rwxr-xr-x 1 testsmb testsmb 3,2K Sep  6 18:18 /home/testsmb/.oraclesqldeveloperdatamodeler/system20.2.0.167.1538/system_cache/config/Windows2Local/Modes/.nbattrs


"bad"
-rwxr-xr-x 1 testsmb testsmb 310 Sep  6 18:22 /home/testsmb/.oraclesqldeveloperdatamodeler/system20.2.0.167.1538/system_cache/config/Windows2Local/Modes/.nbattrs


The program seems to close the file (or at least write some bytes) and then to open it again, which fails with the default of hide dot files = Yes

Probably you find more infos in the log files of the server (these are full logs starting with the login of the user into the desktop environment and then starting the program, so you proably want to grep for the above path).

But before putting to much effort in investigating this, I'm not sure whether "hide dot files" is really a good option for linux clients anyway - I think this was rather made for compatibility with DOS/Windows clients (to prevent users from deleting files accidentially or really to map the HIDDEN attribute from old DOS clients), so maybe this should be disabled anyway when talking to a linux client?
Comment 5 Sysadmin HTL-Leonding 2020-09-06 17:04:00 UTC
Created attachment 16201 [details]
smb.conf from the server with hide dot files = no (the only change between the two logs)