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

Peter Piechutzki ppiechutzki at chriwa.de
Fri Oct 15 10:41:09 GMT 2004


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