[Samba] Preventing characters in filenames...

Tom Reijnders reijnders at tor.nl
Wed Jun 23 05:48:17 MDT 2010


Ehmmm... personally I would not try to fix the name, but return an error...

Op 23-6-2010 3:39, John H Terpstra schreef:
> On 06/22/2010 05:03 PM, Rod wrote:
>    
>> Is there a way of preventing certain characters being used in filenames as saved
>> by Samba? Basically I wish to prevent prevent files from being saved with the
>> characters ( ) *&  in the name. Is this possible in Samba?
>>
>> Thanks, qt4.
>>      
> Yes, this is possible - you would need to write a VFS module that
> filters filenames and that substitutes appropriate alternate characters
> (or just deletes the offending character).
>
> It is not possible without writing a VFS module though. Such a module
> does not exist today.
>
> Samba does not write filenames, it simply passes them through to the
> operating system from the CIFS client.  The VFS layer allows
> interception of system calls.  The module would need to intercept the
> create() system call, procecss the filename, and then pass the filtered
> name through to the system function call.
>
> The bigger question is how this might be implemented. How do you propose
> to handle the undesirable characters in a manner that is portable across
> system locales that use multi-byte names.
>
> - John T.
>    

-- 
--

Tom Reijnders
TOR Informatica
Chopinlaan 27
5242HM Rosmalen
Tel: 073 5226191
Fax: 073 5226196




More information about the samba mailing list