[Samba] Directory Name '.../pipe' not allowed ? Samba Bug ?

Peter Piechutzki ppiechutzki at chriwa.de
Fri Oct 15 11:21:28 GMT 2004


Hello,

thx for the quick response.

You are certainly right about the oplocks and we had both levels
turned off for testing with the same results.

After extensive testing and analyzing the sourcecode of openfile() we
are sure that even updating to the newest version of samba wouldn't
solve our problem.

It is fairly easy to reproduce.
put a foxpro .dbf file on a share from samba into a directory named
'/abc/pipe' Try to import the file into a MS-Access Database and you
will recieve a error 'The microsoft jet ... can't open ... .inf'

This will also happen if the full directory path is shorter then 9
characters and ends with 'pipe' for example 'dat_pipe' 'abcdpipe'
'de/pipe' and so on.

As i mentioned in my first post samba returns different errer codes to
the smb client machine depending on the directory name.

best regards


 Peter Piechutzki

 Chriwa GmbH
 Wasser-Aufbereitungstechnik
 Bruchweg 30
 29313 Hambühren
 Tel: 0 50 84 / 404 - 22
 Fax: 0 50 84 / 404 - 31
 E-Mail: ppiechutzki at chriwa.de

r> Hi,
r> first of all update your samba version , you find suses samba 3 packs
r> on ftp.suse.com projects samba
r> data base errors are well known

r> read here
r> Kernel Oplocks are essentially a method that allows the Linux kernel to
r> co-exist with Samba's oplocked files, although this has provided better
r> integration of MS Windows network file locking with the underlying OS,
r> SGI IRIX and Linux are the only two OSs that are oplock-aware at this time.

r> Unless your system supports kernel oplocks, you should disable oplocks
r> if you are accessing the same files from both UNIX/Linux and SMB
r> clients. Regardless, oplocks should always be disabled if you are
r> sharing a database file (e.g., Microsoft Access) between multiple
r> clients, as any break the first client receives will affect
r> synchronization of the entire file (not just the single record), which
r> will result in a noticeable performance impairment and, more likely,
r> problems accessing the database in the first place. Notably, Microsoft
r> Outlook's personal folders (*.pst) react quite badly to oplocks. If in
r> doubt, disable oplocks and tune your system from that point.

r> http://us1.samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html


r> a solution maybe

r> You can disable oplocks on a per-share basis with the following:
r> [acctdata]
r> oplocks = False
r> level2 oplocks = False
r> The default oplock type is Level1. Level2 oplocks are enabled on a
r> per-share basis in the smb.conf file.
r> Alternately, you could disable oplocks on a per-file basis within the
r> share:
r> veto oplock files = /*.mdb/*.MDB/*.dbf/*.DBF/

r> Regards

r> Peter Piechutzki schrieb:
>> Hi All,
>>
>> scenario:
>> Samba Version 2.2.8a-UL
>> running on Suse Linux Enterprise 8
>> Kernel Version 2.4.21-241-smp
>> as Server
>>
>> Windows 2000 SP4 as Client
>>
>> Trying to import a MS-Foxpro file into MS-ACCESS. MS-Foxpro File residing on
>> Samba Server.
>> The Foxpro filename is 'projects.dbf'. During import MS-Access tries to also
>> open a non existent file 'projects.inf'
>> depending on the path in which the file resides Samba will return different
>> Error Messages to the smb client (windows machine)
>>
>> either NT_STATUS_OBJECT_NAME_NOT_FOUND which is correct (Example 1)
>>
>> or NT_STATUS_ACCESS_DENIED which is the wrong return code. (Example 2)
>>
>> Aur problem was that a filename like 'cad/pipe/projects.dbf' resulted in the
>> access denied message wich led the MS-Access Programm into error whilst a
>> filename like 'test/pipe/projects.dbf' will return with the correct file not
>> found.
>>
>> Any 3 letter or less path before the /pipe/ results in the error. We've
>> managed to level it down to the  "Check a filename for the pipe string."
>> Function
>> static void check_for_pipe(const char *fname) in the Samba source code
>> 'open.c'.
>>
>> Our solution for now is not to name any directory 'pipe' so that the parsing
>> function won't get confused but this can't really be a solution.
>>
>> Any Ideas welcome.
>>
>> Best regards
>>
>> Peter Piechutzki
>>
>>
>> **********************Example 1 working o.k.********************************
>> [2004/10/15 10:24:52, 10] smbd/mangle_hash.c:is_mangled(317)
>>   is_mangled: projects.INF : False
>> [2004/10/15 10:24:52, 5] smbd/filename.c:unix_convert(319)
>>   New file projects.INF
>> [2004/10/15 10:24:52, 3] smbd/dosmode.c:unix_mode(111)
>>   unix_mode(Zwischenablage/Jaeger/pipe/projects.INF) returning 0777
>> [2004/10/15 10:24:52, 5] smbd/files.c:file_new(123)
>>   allocated file structure 9547, fnum = 13643 (3 used)
>> [2004/10/15 10:24:52, 10] smbd/open.c:open_file_shared1(808)
>>   open_file_shared: fname = Zwischenablage/Jaeger/pipe/projects.INF,
>> share_mode = 40, ofun = 1, mode = 777, oplock request = 0
>> [2004/10/15 10:24:52, 8] lib/util.c:is_in_path(1145)
>>   is_in_path: Zwischenablage/Jaeger/pipe/projects.INF
>> [2004/10/15 10:24:52, 8] lib/util.c:is_in_path(1150)
>>   is_in_path: no name list.
>> [2004/10/15 10:24:52, 3] lib/util.c:unix_clean_name(387)
>>   unix_clean_name [Zwischenablage/Jaeger/pipe/projects.INF]
>> [2004/10/15 10:24:52, 4] smbd/open.c:open_file_shared1(974)
>>   calling open_file with flags=0x0 flags2=0x0 mode=0777
>> [2004/10/15 10:24:52, 10] smbd/open.c:fd_open(53)
>>   fd_open: name Zwischenablage/Jaeger/pipe/projects.INF, flags = 00 mode =
>> 0777, fd = -1. No such file or directory
>> [2004/10/15 10:24:52, 3] smbd/open.c:open_file(177)
>>   Error opening file Zwischenablage/Jaeger/pipe/projects.INF (No such file
>> or directory) (local_flags=0) (flags=0)
>> [2004/10/15 10:24:52, 5] smbd/files.c:file_free(346)
>>   freed files structure 13643 (2 used)
>> [2004/10/15 10:24:52, 3] smbd/error.c:error_packet(94)
>>   error string = No such file or directory
>> [2004/10/15 10:24:52, 3] smbd/error.c:error_packet(113)
>>   error packet at smbd/nttrans.c(889) cmd=162 (SMBntcreateX)
>> NT_STATUS_OBJECT_NAME_NOT_FOUND
>>
>>
>> **********************Example 2 WRONG ERRROR PACKET
>> ********************************
>> [2004/10/14 17:29:21, 10] smbd/mangle_hash.c:is_mangled(317)
>>   is_mangled: projects.INF : False
>> [2004/10/14 17:29:21, 5] smbd/filename.c:unix_convert(319)
>>   New file projects.INF
>> [2004/10/14 17:29:21, 3] smbd/dosmode.c:unix_mode(111)
>>   unix_mode(cad/pipe/projects.INF) returning 0777
>> [2004/10/14 17:29:21, 5] smbd/files.c:file_new(123)
>>   allocated file structure 4092, fnum = 8188 (3 used)
>> [2004/10/14 17:29:21, 10] smbd/open.c:open_file_shared1(808)
>>   open_file_shared: fname = cad/pipe/projects.INF, share_mode = 40, ofun =
>> 1, mode = 777, oplock request = 0
>> [2004/10/14 17:29:21, 8] lib/util.c:is_in_path(1145)
>>   is_in_path: cad/pipe/projects.INF
>> [2004/10/14 17:29:21, 8] lib/util.c:is_in_path(1150)
>>   is_in_path: no name list.
>> [2004/10/14 17:29:21, 3] lib/util.c:unix_clean_name(387)
>>   unix_clean_name [cad/pipe/projects.INF]
>> [2004/10/14 17:29:21, 4] smbd/open.c:open_file_shared1(974)
>>   calling open_file with flags=0x0 flags2=0x0 mode=0777
>> [2004/10/14 17:29:21, 10] smbd/open.c:fd_open(53)
>>   fd_open: name cad/pipe/projects.INF, flags = 00 mode = 0777, fd = -1. No
>> such file or directory
>> [2004/10/14 17:29:21, 3] smbd/open.c:open_file(177)
>>   Error opening file cad/pipe/projects.INF (No such file or directory)
>> (local_flags=0) (flags=0)
>> [2004/10/14 17:29:21, 3] smbd/open.c:check_for_pipe(81)
>>   Rejecting named pipe open for cad/pipe/projects.INF
>> [2004/10/14 17:29:21, 5] smbd/files.c:file_free(346)
>>   freed files structure 8188 (2 used)
>> [2004/10/14 17:29:21, 3] smbd/error.c:error_packet(94)
>>   error string = No such file or directory
>> [2004/10/14 17:29:21, 3] smbd/error.c:error_packet(113)
>>   error packet at smbd/nttrans.c(889) cmd=162 (SMBntcreateX)
>> NT_STATUS_ACCESS_DENIED
>>
>> ******************OUR SMB.CONF************************
>>
>> # Samba config file created using SWAT
>> # from 0.0.0.0 (0.0.0.0)
>> # Date: 2004/06/17 14:04:34
>>
>> # Global parameters
>> [global]
>>  workgroup = OURDOMAIN.DE
>>  netbios name = FILESERVER
>>  server string = Our Fileserver Samba %v
>>  interfaces = 192.168.1.10/24
>>  encrypt passwords = Yes
>>  min passwd length = 2
>>  map to guest = Bad User
>>  unix password sync = Yes
>>  log level = 1
>>  log file = /var/log/samba/log.%m
>>  time server = Yes
>>  unix extensions = Yes
>>  socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY
>>  printcap name = CUPS
>>  add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u
>>  os level = 255
>>  domain logons = Yes
>>  local master = Yes
>>  security = user
>>  preferred master = Yes
>>  domain master = Yes
>>  wins support = Yes
>>  admin users = @administratoren
>>  printing = cups
>>  deadtime = 0
>>  acl compatibility = win2k
>>
>> [Konstruktion]
>>  comment = Zeichnungen und Konstruktionsdaten
>>  path = /daten/konstruktion
>>  valid users =
>> @cad_user_admin, at cad_user, at cad_user_leser, at administratoren, at olymp
>>  admin users = @administratoren, at cad_user_admin
>>  read only = No
>>  force create mode = 0777
>>  force directory mode = 0777
>>
>>




More information about the samba mailing list