[Samba] Limit dirs/filenames to old 8.3 DOS convention

Jeremy Allison jra at samba.org
Tue Jul 14 18:52:40 UTC 2020


On Mon, Jul 06, 2020 at 12:53:53PM +0200, Michael Ludwig via samba wrote:
> 
> Hello all, 
> 
> after endless searching for days you might be able to help. 
> In short: Is there a way to get Samba accept only 8.3 filenames and directory names on a share? 

Currently no.

> The problem: From a windows client a user should be able to save files on a destination (samba share) which aren't longer than the old 8.3 dos convention. 
> This is a requirement for a system behind it, which can only deal with old dos 8.3 dir/filename conventions. 
> 
> I tried to save to a fat16 partition type, but this vfat driver accepts long filenames instead. Searching for special mount options limiting the lfn functionality ended without any result. 
> 
> Maybe there is a solution for this problem, so hopefully someone here has an idea for this. 

Samba will accept long filename, but using
the mangling method (built in) will generate
algorithmic "short names" (8.3) for all files
on the share.

Looks like your best solution is to write
or commission a VFS module that restricts
all create (file or directory) operations
to 8.3 names and returns INVALID_PARAMETER
for names that don't fit.

Not too difficult, but you'll need to know
your way around C coding and the Samba VFS.

Probably should discuss this on samba-technical
if you need help.



More information about the samba mailing list