[Samba] Confusion berween file and direcory

Felix fb at ltec.ch
Thu May 26 08:28:07 MDT 2011


I have some trouble with a samba 3.5.8 server when setting directory 
attributes. On a windows XP I execute a small peace of code that calls 
'SetFileAttributes' for the directory 'test-dir' located on the samba 
server. Using log level 10 I find this:

	[2011/05/26 15:27:02.144060,  3] smbd/process.c:1298
(switch_message)
  switch message SMBtrans2 (pid 28903) conn 0x7f5e35f0dbb0
[2011/05/26 15:27:02.144104,  4] smbd/uid.c:257(change_to_user)
  change_to_user: Skipping user change - already user
[2011/05/26 15:27:02.144153,  3] smbd/trans2.c:7722
(call_trans2setfilepathinfo)
  call_trans2setfilepathinfo(8) test-dir (fnum 13342) info_level=1004 
totdata=40
[2011/05/26 15:27:02.144199,  3] smbd/trans2.c:7320
(smbd_do_setfilepathinfo)
  smbd_do_setfilepathinfo: test-dir (fnum 13342) info_level=1004 totdata=40
[2011/05/26 15:27:02.144245,  6] smbd/trans2.c:5518(smb_set_file_dosmode)
  smb_set_file_dosmode: dosmode: 0x90
[2011/05/26 15:27:02.144288,  8] smbd/dosmode.c:613(dos_mode)
  dos_mode: test-dir
[2011/05/26 15:27:02.144332,  8] smbd/dosmode.c:207(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning d
[2011/05/26 15:27:02.144387,  8] smbd/dosmode.c:666(dos_mode)
  dos_mode returning d
[2011/05/26 15:27:02.144431, 10] smbd/trans2.c:5524(smb_set_file_dosmode)
  smb_set_file_dosmode: file test-dir : setting dos mode 0x90
[2011/05/26 15:27:02.144475, 10] smbd/dosmode.c:701(file_set_dosmode)
  file_set_dosmode: setting dos mode 0x10 on file test-dir
[2011/05/26 15:27:02.144526,  8] smbd/dosmode.c:613(dos_mode)
  dos_mode: test-dir
[2011/05/26 15:27:02.144571,  8] smbd/dosmode.c:207(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning d
[2011/05/26 15:27:02.144615,  8] smbd/dosmode.c:666(dos_mode)
  dos_mode returning d
[2011/05/26 15:27:02.144659,  3] smbd/dosmode.c:166(unix_mode)
  unix_mode(test-dir) returning 0775
[2011/05/26 15:27:02.144710, 10] modules/vfs_posixacl.c:89
(posixacl_sys_acl_set_file)
  Calling acl_set_file: test-dir, 0
[2011/05/26 15:27:02.144762, 10] modules/vfs_posixacl.c:108
(posixacl_sys_acl_set_file)
  acl_set_file failed: Operation not permitted
[2011/05/26 15:27:02.144815, 10] smbd/open.c:3381(create_file_default)
  create_file: access_mask = 0x2 file_attributes = 0x0, share_access = 
0x7, create_disposition = 0x1 create_options = 0x0 oplock_request = 0x8 
root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), fname = test-dir
[2011/05/26 15:27:02.144863,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [test-dir] [/srv/samba/file-shares/testshare]
[2011/05/26 15:27:02.144917, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [test-dir] -> [/srv/samba/file-shares/
testshare/test-dir]
[2011/05/26 15:27:02.144963,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: test-dir reduced to /srv/samba/file-shares/testshare/
test-dir
[2011/05/26 15:27:02.145007, 10] smbd/open.c:2906(create_file_unixpath)
  create_file_unixpath: access_mask = 0x2 file_attributes = 0x0, 
share_access = 0x7, create_disposition = 0x1 create_options = 0x0 
oplock_request = 0x8 ea_list = 0x(nil), sd = 0x(nil), fname = test-dir
[2011/05/26 15:27:02.145055,  5] smbd/files.c:119(file_new)
  allocated file structure 9247, fnum = 13343 (2 used)
[2011/05/26 15:27:02.145101,  3] smbd/dosmode.c:166(unix_mode)
  unix_mode(test-dir) returning 0764
[2011/05/26 15:27:02.145145, 10] smbd/open.c:1533(open_file_ntcreate)
  open_file_ntcreate: fname=test-dir, dos_attrs=0x0 access_mask=0x2 
share_access=0x7 create_disposition = 0x1 create_options=0x0 unix 
mode=0764 oplock_request=8
[2011/05/26 15:27:02.145192,  3] smbd/vfs.c:881(check_reduced_name)
  check_reduced_name [test-dir] [/srv/samba/file-shares/testshare]
[2011/05/26 15:27:02.145242, 10] smbd/vfs.c:968(check_reduced_name)
  check_reduced_name realpath [test-dir] -> [/srv/samba/file-shares/
testshare/test-dir]
[2011/05/26 15:27:02.145287,  3] smbd/vfs.c:1038(check_reduced_name)
  check_reduced_name: test-dir reduced to /srv/samba/file-shares/testshare/
test-dir
[2011/05/26 15:27:02.145330,  8] smbd/dosmode.c:613(dos_mode)
  dos_mode: test-dir
[2011/05/26 15:27:02.145374,  8] smbd/dosmode.c:207(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning d
[2011/05/26 15:27:02.145417,  8] smbd/dosmode.c:666(dos_mode)
  dos_mode returning d
[2011/05/26 15:27:02.145460, 10] smbd/open.c:1715(open_file_ntcreate)
  open_file_ntcreate: fname=test-dir, after mapping access_mask=0x2
[2011/05/26 15:27:02.145510, 10] lib/dbwrap_tdb.c:100(db_tdb_fetch_locked)
  Locking key 01FE0000000000000160
[2011/05/26 15:27:02.145556, 10] lib/dbwrap_tdb.c:129(db_tdb_fetch_locked)
  Allocated locked data 0x0x7f5e35f32b60
[2011/05/26 15:27:02.145601, 10] locking/locking.c:552(parse_share_modes)
  parse_share_modes: delete_on_close: 0, owrt: Thu 26 May 2011 12:18:38 PM 
CEST CEST, cwrt: Thu 01 Jan 1970 01:00:00 AM CET CET, tok: 0, 
num_share_modes: 1
[2011/05/26 15:27:02.145661, 10] locking/locking.c:655(parse_share_modes)
  parse_share_modes: share_mode_entry[0]:  pid = 28903, share_access = 
0x7, private_options = 0x200000, access_mask = 0x100180, mid = 0x0, type= 
0x0, gen_id = 6, uid = 1000, flags = 0, file_id fe01:2d6001:0
[2011/05/26 15:27:02.145706, 10] smbd/open.c:671(share_conflict)
  share_conflict: entry->access_mask = 0x100180, entry->share_access = 
0x7, entry->private_options = 0x200000
[2011/05/26 15:27:02.145732, 10] smbd/open.c:674(share_conflict)
  share_conflict: access_mask = 0x2, share_access = 0x7
[2011/05/26 15:27:02.145742, 10] smbd/open.c:683(share_conflict)
  share_conflict: No conflict due to entry->access_mask = 0x100180
[2011/05/26 15:27:02.145751,  4] smbd/open.c:1977(open_file_ntcreate)
  calling open_file with flags=0x1 flags2=0x0 mode=0764, access_mask = 
0x2, open_access_mask = 0x2
[2011/05/26 15:27:02.145766, 10] smbd/open.c:170(fd_open)
  fd_open: name test-dir, flags = 01 mode = 0764, fd = -1. Is a directory
[2011/05/26 15:27:02.145779,  3] smbd/open.c:461(open_file)
  Error opening file test-dir (NT_STATUS_FILE_IS_A_DIRECTORY) 
(local_flags=1) (flags=1)

As I said, 'test-dir' is a directory. If my understand of the log is 
correct samba confuses a directory with a file? Why would this happen?

Felix




More information about the samba mailing list