Bug 6561 - After upgrading from samba 3.2.8 to 3.4.0 keep getting NT_STATUS_ACCESS_DENIED deleting remote file
Summary: After upgrading from samba 3.2.8 to 3.4.0 keep getting NT_STATUS_ACCESS_DENIE...
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.4.0
Hardware: x64 Linux
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-17 10:11 UTC by Karim Elatov
Modified: 2013-04-21 00:42 UTC (History)
0 users

See Also:


Attachments
picture of the permissions (723.99 KB, image/png)
2009-07-17 16:12 UTC, Karim Elatov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karim Elatov 2009-07-17 10:11:03 UTC
I have recently updated samba from version 3.2.8 to 3.4.0 and for some weird reason now I can't remove files remotely.

Here is how it looks from my end.

soils:~>smbclient //bechtel/elatov -W AD
Enter elatov's password:
Domain=[AD] OS=[Unix] Server=[Samba 3.4.0]
smb: \> mkdir test4
smb: \> rmdir test4
smb: \> rm hashlib.pyc
NT_STATUS_ACCESS_DENIED deleting remote file \hashlib.pyc

I am able to create new files or folders and I can remove empty folders but I can't remove files.

Here is how my smb.conf file looks like.
============================================================
workgroup = AD
realm = AD.COLORADO.EDU
security = ads
password server = xxx.ad.colorado.edu xxx.ad.colorado.edu
encrypt passwords = yes
passdb backend = smbpasswd
idmap backend =

domain logons = no
domain master = no

winbind separator = +
# Disable idmapping of Windows SIDs to Unix UIDs
idmap config AD:readonly = yes

print command = lp -c -d%p %s
lpq command = lpq -P%p
lprm command = lprm -P%p %j

# disable guest/anonymous access
restrict anonymous = 2

log level = 10

[global]
        hosts allow =
        interfaces = 128.138.228.11/255.255.255.0 127.0.0.1/32
        bind interfaces only = yes
[homes]
        comment = Home directorys from bechtel
        guest ok = no
        read only = no
##
## BACKUP PC directories follow below
##
[pcbackups]
  comment = Share for PC Backups
  path = /data/pcbackups
  valid users = @AD+its-ds-ceae-bechtelserver @AD+"Terminal MSC Users"
  writeable=yes
  browseable=yes
===========================================================

and here are the contents of /var/log/samba/log.smbd when I try to remove the file with log level 10.
==============================================================================
[2009/07/17 08:56:24, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 44 20 06 00 56 05 06   00 04 01 00 00 00 00 5C   .D ..V.. .......\
  [0010] 00 68 00 61 00 73 00 68   00 6C 00 69 00 62 00 2E   .h.a.s.h .l.i.b..
  [0020] 00 70 00 79 00 63 00 00   00                       .p.y.c.. .
[2009/07/17 08:56:24,  3] smbd/process.c:1251(switch_message)
  switch message SMBtrans2 (pid 17698) conn 0x2af726275530
[2009/07/17 08:56:24,  4] smbd/uid.c:256(change_to_user)
  change_to_user: Skipping user change - already user
[2009/07/17 08:56:24,  3] smbd/trans2.c:1927(call_trans2findfirst)
  call_trans2findfirst: dirtype = 6, maxentries = 1366, close_after_first=0, close_if_end = 1 requires_resume_key = 1 level = 0x104, max_data_bytes = 16644
[2009/07/17 08:56:24,  5] smbd/filename.c:148(unix_convert)
  unix_convert called on file "hashlib.pyc"
[2009/07/17 08:56:24, 10] smbd/statcache.c:235(stat_cache_lookup)
  stat_cache_lookup: lookup failed for name [HASHLIB.PYC]
[2009/07/17 08:56:24,  5] smbd/statcache.c:138(stat_cache_add)
  stat_cache_add: Added entry (2af726272ac0:size b) HASHLIB.PYC -> hashlib.pyc
[2009/07/17 08:56:24,  5] smbd/filename.c:297(unix_convert)
  conversion finished hashlib.pyc -> hashlib.pyc
[2009/07/17 08:56:24,  5] smbd/trans2.c:2014(call_trans2findfirst)
  dir=./, mask = hashlib.pyc
[2009/07/17 08:56:24,  5] smbd/dir.c:394(dptr_create)
  dptr_create dir=./
[2009/07/17 08:56:24,  3] smbd/dir.c:512(dptr_create)
  creating new dirptr 256 for path ./, expect_close = 1
[2009/07/17 08:56:24,  4] smbd/trans2.c:2081(call_trans2findfirst)
  dptr_num is 256, wcard = hashlib.pyc, attr = 6
[2009/07/17 08:56:24,  8] smbd/trans2.c:2089(call_trans2findfirst)
  dirpath=<./> dontdescend=<>
[2009/07/17 08:56:24,  8] smbd/trans2.c:1302(get_lanman2_dir_entry)
  get_lanman2_dir_entry:readdir on dirptr 0x2af72281dae0 now at offset -1
[2009/07/17 08:56:24,  8] smbd/dosmode.c:474(dos_mode)
  dos_mode: ./hashlib.pyc
[2009/07/17 08:56:24,  8] smbd/dosmode.c:175(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning
[2009/07/17 08:56:24,  8] smbd/dosmode.c:521(dos_mode)
  dos_mode returning
[2009/07/17 08:56:24, 10] locking/locking.c:891(fetch_share_mode_unlocked)
  fetch_share_mode_unlocked: no share_mode record around (file not open)
[2009/07/17 08:56:24,  5] smbd/trans2.c:1445(get_lanman2_dir_entry)
  get_lanman2_dir_entry: found ./hashlib.pyc fname=hashlib.pyc
[2009/07/17 08:56:24, 10] smbd/trans2.c:1597(get_lanman2_dir_entry)
  get_lanman2_dir_entry: SMB_FIND_FILE_BOTH_DIRECTORY_INFO
[2009/07/17 08:56:24,  5] smbd/trans2.c:2145(call_trans2findfirst)
  call_trans2findfirst - (2) closing dptr_num 256
[2009/07/17 08:56:24,  4] smbd/dir.c:243(dptr_close_internal)
  closing dptr key 256
[2009/07/17 08:56:24,  9] smbd/trans2.c:820(send_trans2_replies)
  t2_rep: params_sent_thistime = 10, data_sent_thistime = 116, useable_space = 131010
[2009/07/17 08:56:24,  9] smbd/trans2.c:822(send_trans2_replies)
  t2_rep: params_to_send = 10, data_to_send = 116, paramsize = 10, datasize = 116
[2009/07/17 08:56:24,  5] lib/util.c:632(show_msg)
[2009/07/17 08:56:24,  5] lib/util.c:642(show_msg)
  size=184
  smb_com=0x32
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=136
  smb_flg2=51201
  smb_tid=1
  smb_pid=26944
  smb_uid=100
  smb_mid=12
  smt_wct=10
  smb_vwv[ 0]=   10 (0xA)
  smb_vwv[ 1]=  116 (0x74)
  smb_vwv[ 2]=    0 (0x0)
  smb_vwv[ 3]=   10 (0xA)
  smb_vwv[ 4]=   56 (0x38)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=  116 (0x74)
  smb_vwv[ 7]=   68 (0x44)
  smb_vwv[ 8]=    0 (0x0)
  smb_vwv[ 9]=    0 (0x0)
  smb_bcc=129
[2009/07/17 08:56:24, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 FD FF 01 00 01 00 00   00 00 00 00 00 74 00 00   ........ .....t..
  [0010] 00 00 00 00 00 80 E1 6F   A0 9E 00 CA 01 00 55 5C   .......o ......U\
  [0020] C8 31 01 CA 01 80 E1 6F   A0 9E 00 CA 01 80 E1 6F   .1.....o .......o
  [0030] A0 9E 00 CA 01 BD 0F 00   00 00 00 00 00 00 10 00   ........ ........
  [0040] 00 00 00 00 00 80 00 00   00 16 00 00 00 00 00 00   ........ ........
  [0050] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
  [0060] 00 00 00 00 00 00 00 00   00 00 00 68 00 61 00 73   ........ ...h.a.s
  [0070] 00 68 00 6C 00 69 00 62   00 2E 00 70 00 79 00 63   .h.l.i.b ...p.y.c
  [0080] 00                                                .
[2009/07/17 08:56:24,  4] smbd/trans2.c:2189(call_trans2findfirst)
  SMBtrans2 mask=hashlib.pyc directory=./ dirtype=6 numentries=1
[2009/07/17 08:56:24, 10] lib/util_sock.c:781(read_smb_length_return_keepalive)
  got smb length of 64
[2009/07/17 08:56:24,  6] smbd/process.c:1430(process_smb)
  got message type 0x0 of len 0x40
[2009/07/17 08:56:24,  3] smbd/process.c:1433(process_smb)
  Transaction 12 of length 68 (0 toread)
[2009/07/17 08:56:24,  5] lib/util.c:632(show_msg)
[2009/07/17 08:56:24,  5] lib/util.c:642(show_msg)
  size=64
  smb_com=0x6
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=8
  smb_flg2=51201
  smb_tid=1
  smb_pid=26944
  smb_uid=100
  smb_mid=13
  smt_wct=1
  smb_vwv[ 0]=    6 (0x6)
  smb_bcc=27
[2009/07/17 08:56:24, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 04 5C 00 68 00 61 00 73   00 68 00 6C 00 69 00 62   .\.h.a.s .h.l.i.b
  [0010] 00 2E 00 70 00 79 00 63   00 00 00                 ...p.y.c ...
[2009/07/17 08:56:24,  3] smbd/process.c:1251(switch_message)
  switch message SMBunlink (pid 17698) conn 0x2af726275530
[2009/07/17 08:56:24,  4] smbd/uid.c:256(change_to_user)
  change_to_user: Skipping user change - already user
[2009/07/17 08:56:24,  3] smbd/reply.c:2593(reply_unlink)
  reply_unlink : hashlib.pyc
[2009/07/17 08:56:24,  5] smbd/filename.c:148(unix_convert)
  unix_convert called on file "hashlib.pyc"
[2009/07/17 08:56:24, 10] smbd/statcache.c:274(stat_cache_lookup)
  stat_cache_lookup: lookup succeeded for name [HASHLIB.PYC] -> [hashlib.pyc]
[2009/07/17 08:56:24, 10] smbd/reply.c:2263(do_unlink)
  do_unlink: ./hashlib.pyc, dirtype = 6
[2009/07/17 08:56:24,  8] smbd/dosmode.c:474(dos_mode)
  dos_mode: ./hashlib.pyc
[2009/07/17 08:56:24,  8] smbd/dosmode.c:175(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning
[2009/07/17 08:56:24,  8] smbd/dosmode.c:521(dos_mode)
  dos_mode returning
[2009/07/17 08:56:24, 10] smbd/open.c:3365(create_file_default)
  create_file: access_mask = 0x10000 file_attributes = 0x80, share_access = 0x0, create_disposition = 0x1 create_options = 0x40 oplock_request = 0x0 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), create_file_flags = 0x0, fname = ./hashlib.pyc
[2009/07/17 08:56:24, 10] smbd/open.c:2896(create_file_unixpath)
  create_file_unixpath: access_mask = 0x10000 file_attributes = 0x80, share_access = 0x0, create_disposition = 0x1 create_options = 0x40 oplock_request = 0x0 ea_list = 0x(nil), sd = 0x(nil), fname = ./hashlib.pyc
[2009/07/17 08:56:24,  5] smbd/files.c:103(file_new)
  allocated file structure 52, fnum = 4148 (1 used)
[2009/07/17 08:56:24,  3] smbd/dosmode.c:135(unix_mode)
  unix_mode(./hashlib.pyc) returning 0744
[2009/07/17 08:56:24, 10] smbd/open.c:1475(open_file_ntcreate)
  open_file_ntcreate: fname=./hashlib.pyc, dos_attrs=0x80 access_mask=0x10000 share_access=0x0 create_disposition = 0x1 create_options=0x40 unix mode=0744 oplock_request=0
[2009/07/17 08:56:24,  8] smbd/dosmode.c:474(dos_mode)
  dos_mode: ./hashlib.pyc
[2009/07/17 08:56:24,  8] smbd/dosmode.c:175(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning
[2009/07/17 08:56:24,  8] smbd/dosmode.c:521(dos_mode)
  dos_mode returning
[2009/07/17 08:56:24, 10] smbd/open.c:1653(open_file_ntcreate)
  open_file_ntcreate: fname=./hashlib.pyc, after mapping access_mask=0x10000
[2009/07/17 08:56:24, 10] lib/dbwrap_tdb.c:100(db_tdb_fetch_locked)
  Locking key 11080000000000002548
[2009/07/17 08:56:24, 10] lib/dbwrap_tdb.c:129(db_tdb_fetch_locked)
  Allocated locked data 0x0x2af726272db0
[2009/07/17 08:56:24, 10] smbd/open.c:980(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x10 on file
[2009/07/17 08:56:24, 10] smbd/open.c:980(delay_for_oplocks)
  delay_for_oplocks: oplock type 0x10 on file
[2009/07/17 08:56:24,  4] smbd/open.c:1913(open_file_ntcreate)
  calling open_file with flags=0x0 flags2=0x0 mode=0744, access_mask = 0x10000, open_access_mask = 0x10000
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:3347(posix_get_nt_acl)
  posix_get_nt_acl: called for file ./hashlib.pyc
[2009/07/17 08:56:24, 10] lib/gencache.c:208(gencache_get)
  Returning valid cache entry: key = IDMAP/UID2SID/17227, value = S-1-5-352321536-500376443-279550357-203234921-35454, timeout = Fri Jul 24 08:25:54 2009
[2009/07/17 08:56:24, 10] passdb/lookup_sid.c:1333(uid_to_sid)
  uid 17227 -> sid S-1-5-352321536-500376443-279550357-203234921-35454
[2009/07/17 08:56:24, 10] lib/gencache.c:208(gencache_get)
  Returning expired cache entry: key = IDMAP/GID2SID/151, value = -, timeout = Fri Jul 17 08:56:13 2009
[2009/07/17 08:56:24,  5] passdb/lookup_sid.c:1378(gid_to_sid)
  gid_to_sid: winbind failed to find a sid for gid 151
[2009/07/17 08:56:24,  3] smbd/sec_ctx.c:210(push_sec_ctx)
  push_sec_ctx(17227, 151) : sec_ctx_stack_ndx = 1
[2009/07/17 08:56:24,  3] smbd/uid.c:428(push_conn_ctx)
  push_conn_ctx(100) : conn_ctx_stack_ndx = 0
[2009/07/17 08:56:24,  3] smbd/sec_ctx.c:310(set_sec_ctx)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2009/07/17 08:56:24,  5] auth/token_util.c:522(debug_nt_user_token)
  NT user token: (NULL)
[2009/07/17 08:56:24,  5] auth/token_util.c:548(debug_unix_user_token)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
[2009/07/17 08:56:24,  3] smbd/sec_ctx.c:418(pop_sec_ctx)
  pop_sec_ctx (17227, 151) - sec_ctx_stack_ndx = 0
[2009/07/17 08:56:24, 10] passdb/lookup_sid.c:1173(legacy_gid_to_sid)
  LEGACY: gid 151 -> sid S-1-22-2-151
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2498(canonicalise_acl)
  canonicalise_acl: Access ace entries before arrange :
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:817(print_canon_ace_list)
  print_canon_ace_list: canonicalise_acl: ace entries after arrange
  canon_ace index 0. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
  canon_ace index 2. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 180 to (NT) 12019f
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 100 to (NT) 120089
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 100 to (NT) 120089
[2009/07/17 08:56:24, 10] smbd/open.c:113(check_open_rights)
  check_open_rights: file ./hashlib.pyc requesting 0x10000 returning 0x10000 (NT_STATUS_ACCESS_DENIED)
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:3347(posix_get_nt_acl)
  posix_get_nt_acl: called for file .
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2498(canonicalise_acl)
  canonicalise_acl: Access ace entries before arrange :
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r-x
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r-x
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rwx
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:817(print_canon_ace_list)
  print_canon_ace_list: canonicalise_acl: ace entries after arrange
  canon_ace index 0. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rwx
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r-x
  canon_ace index 2. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r-x
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 1c0 to (NT) 1f01ff
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 140 to (NT) 1200a9
[2009/07/17 08:56:24, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 140 to (NT) 1200a9
[2009/07/17 08:56:24, 10] smbd/open.c:496(open_file)
  open_file: Access denied on file ./hashlib.pyc
[2009/07/17 08:56:24, 10] lib/dbwrap_tdb.c:42(db_tdb_record_destr)
  Unlocking key 11080000000000002548
[2009/07/17 08:56:24,  5] smbd/files.c:472(file_free)
  freed files structure 4148 (0 used)
[2009/07/17 08:56:24, 10] smbd/open.c:3217(create_file_unixpath)
  create_file_unixpath: NT_STATUS_ACCESS_DENIED
[2009/07/17 08:56:24, 10] smbd/open.c:3507(create_file_default)
  create_file: NT_STATUS_ACCESS_DENIED
[2009/07/17 08:56:24, 10] smbd/reply.c:2368(do_unlink)
  SMB_VFS_CREATEFILE failed: NT_STATUS_ACCESS_DENIED
[2009/07/17 08:56:24,  3] smbd/error.c:60(error_packet_set)
  error packet at smbd/reply.c(2603) cmd=6 (SMBunlink) NT_STATUS_ACCESS_DENIED
==============================================================================

I believe the last 3 messages are the most important ones 

===========================================================
[2009/07/17 08:56:24, 10] smbd/open.c:3217(create_file_unixpath)
  create_file_unixpath: NT_STATUS_ACCESS_DENIED
[2009/07/17 08:56:24, 10] smbd/open.c:3507(create_file_default)
  create_file: NT_STATUS_ACCESS_DENIED
[2009/07/17 08:56:24, 10] smbd/reply.c:2368(do_unlink)
  SMB_VFS_CREATEFILE failed: NT_STATUS_ACCESS_DENIED
[2009/07/17 08:56:24,  3] smbd/error.c:60(error_packet_set)
  error packet at smbd/reply.c(2603) cmd=6 (SMBunlink) NT_STATUS_ACCESS_DENIED
==============================================================

I have googled around and have tried every suggestion like the following: 

dos filemode = Yes
and
host msdfs = No
msdfs root = No

and many others but nothing has worked.

here is info about the machine that samba is running on.

bechtel:~>lsb_release -a
LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseClient
Description:    Red Hat Enterprise Linux Client release 5.3 (Tikanga)
Release:        5.3
Codename:       Tikanga

bechtel:~>uname -a
Linux bechtel.colorado.edu 2.6.18-128.1.16.el5 #1 SMP Fri Jun 26 10:53:31 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

bechtel:~>/usr/local/samba/sbin/smbd -V
Version 3.4.0

And here are my configure flags when I configured samba.

./configure --localstatedir=/var/adm/log/samba --prefix=/usr/local/samba --with-configdir=/usr/local/adm/config/samba --with-privatedir=/usr/local/adm/config/samba/private --with-sendfile-support=no


Any help is much appreciated.

Thanks
-Karim Elatov
Comment 1 Jeremy Allison 2009-07-17 15:10:19 UTC
Can you upload the exact permissions on this directory please, also a full debug level 10 which should give the exact token list of the connected user.

In Samba 3.4.0 we map POSIX permissions to Windows permissions, and you must have the DELETE permission on the file, or the DELETE_CHILD on the directory in order to delete a file. This is obviously not the case here and I'm trying to discover why.

Thanks !

Jeremy.
Comment 2 Karim Elatov 2009-07-17 16:12:40 UTC
Created attachment 4440 [details]
picture of the permissions

Picture of the asked permissions on the windows side.
Comment 3 Karim Elatov 2009-07-17 16:14:15 UTC
Here is the requested log.

================================================================================
[2009/07/17 15:00:46,  5] smbd/uid.c:368(change_to_root_user)
  change_to_root_user: now uid=(0,0) gid=(0,0)
[2009/07/17 15:00:46, 10] lib/util_sock.c:781(read_smb_length_return_keepalive)
  got smb length of 106
[2009/07/17 15:00:46,  6] smbd/process.c:1430(process_smb)
  got message type 0x0 of len 0x6a
[2009/07/17 15:00:46,  3] smbd/process.c:1433(process_smb)
  Transaction 100 of length 110 (0 toread)
[2009/07/17 15:00:46,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:46,  5] lib/util.c:642(show_msg)
  size=106
  smb_com=0x32
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51207
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61377
  smt_wct=15
  smb_vwv[ 0]=   38 (0x26)
  smb_vwv[ 1]=    0 (0x0)
  smb_vwv[ 2]=   10 (0xA)
  smb_vwv[ 3]=16384 (0x4000)
  smb_vwv[ 4]=    0 (0x0)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=    0 (0x0)
  smb_vwv[ 7]=    0 (0x0)
  smb_vwv[ 8]=    0 (0x0)
  smb_vwv[ 9]=   38 (0x26)
  smb_vwv[10]=   68 (0x44)
  smb_vwv[11]=    0 (0x0)
  smb_vwv[12]=    0 (0x0)
  smb_vwv[13]=    1 (0x1)
  smb_vwv[14]=    1 (0x1)
  smb_bcc=41
[2009/07/17 15:00:46, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 00 00 16 00 56 05 07   00 04 01 00 00 00 00 5C   .....V.. .......\
  [0010] 00 68 00 61 00 73 00 68   00 6C 00 69 00 62 00 2E   .h.a.s.h .l.i.b..
  [0020] 00 70 00 79 00 63 00 00   00                       .p.y.c.. .
[2009/07/17 15:00:46,  3] smbd/process.c:1251(switch_message)
  switch message SMBtrans2 (pid 28250) conn 0x2b29fbe8a940
[2009/07/17 15:00:46,  3] smbd/sec_ctx.c:310(set_sec_ctx)
  setting sec ctx (17227, 151) - sec_ctx_stack_ndx = 0
[2009/07/17 15:00:46,  5] auth/token_util.c:528(debug_nt_user_token)
  NT user token of user S-1-5-21-1275210071-492894223-682003330-111151
  contains 24 SIDs
  SID[  0]: S-1-5-21-1275210071-492894223-682003330-111151
  SID[  1]: S-1-5-21-1275210071-492894223-682003330-513
  SID[  2]: S-1-1-0
  SID[  3]: S-1-5-2
  SID[  4]: S-1-5-11
  SID[  5]: S-1-5-21-1275210071-492894223-682003330-211599
  SID[  6]: S-1-5-21-1275210071-492894223-682003330-177858
  SID[  7]: S-1-5-21-1275210071-492894223-682003330-168222
  SID[  8]: S-1-5-21-1275210071-492894223-682003330-213707
  SID[  9]: S-1-5-21-1275210071-492894223-682003330-204977
  SID[ 10]: S-1-5-21-1275210071-492894223-682003330-260187
  SID[ 11]: S-1-5-21-1275210071-492894223-682003330-204975
  SID[ 12]: S-1-5-21-1275210071-492894223-682003330-261495
  SID[ 13]: S-1-5-21-1275210071-492894223-682003330-233995
  SID[ 14]: S-1-5-21-1275210071-492894223-682003330-172794
  SID[ 15]: S-1-5-21-1275210071-492894223-682003330-199817
  SID[ 16]: S-1-5-21-1275210071-492894223-682003330-168519
  SID[ 17]: S-1-5-21-1275210071-492894223-682003330-172276
  SID[ 18]: S-1-5-21-1275210071-492894223-682003330-172171
  SID[ 19]: S-1-5-21-1275210071-492894223-682003330-177859
  SID[ 20]: S-1-5-21-1275210071-492894223-682003330-145299
  SID[ 21]: S-1-5-21-1275210071-492894223-682003330-212520
  SID[ 22]: S-1-5-21-1275210071-492894223-682003330-259494
  SID[ 23]: S-1-22-1-17227
  SE_PRIV  0x0 0x0 0x0 0x0
[2009/07/17 15:00:46,  5] auth/token_util.c:548(debug_unix_user_token)
  UNIX token of user 17227
  Primary group is 151 and contains 0 supplementary groups
[2009/07/17 15:00:46,  5] smbd/uid.c:353(change_to_user)
  change_to_user uid=(0,17227) gid=(0,151)
[2009/07/17 15:00:46,  3] smbd/trans2.c:1927(call_trans2findfirst)
  call_trans2findfirst: dirtype = 16, maxentries = 1366, close_after_first=1, close_if_end = 1 requires_resume_key = 1 level = 0x104, max_data_bytes = 16384
[2009/07/17 15:00:46,  5] smbd/filename.c:148(unix_convert)
  unix_convert called on file "hashlib.pyc"
[2009/07/17 15:00:46, 10] smbd/statcache.c:274(stat_cache_lookup)
  stat_cache_lookup: lookup succeeded for name [HASHLIB.PYC] -> [hashlib.pyc]
[2009/07/17 15:00:46,  5] smbd/trans2.c:2014(call_trans2findfirst)
  dir=./, mask = hashlib.pyc
[2009/07/17 15:00:46,  5] smbd/dir.c:394(dptr_create)
  dptr_create dir=./
[2009/07/17 15:00:46,  3] smbd/dir.c:512(dptr_create)
  creating new dirptr 256 for path ./, expect_close = 1
[2009/07/17 15:00:46,  4] smbd/trans2.c:2081(call_trans2findfirst)
  dptr_num is 256, wcard = hashlib.pyc, attr = 22
[2009/07/17 15:00:46,  8] smbd/trans2.c:2089(call_trans2findfirst)
  dirpath=<./> dontdescend=<>
[2009/07/17 15:00:46,  8] smbd/trans2.c:1302(get_lanman2_dir_entry)
  get_lanman2_dir_entry:readdir on dirptr 0x2b29fbe701e0 now at offset -1
[2009/07/17 15:00:46,  8] smbd/dosmode.c:474(dos_mode)
  dos_mode: ./hashlib.pyc
[2009/07/17 15:00:46,  8] smbd/dosmode.c:175(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning 
[2009/07/17 15:00:46,  8] smbd/dosmode.c:521(dos_mode)
  dos_mode returning 
[2009/07/17 15:00:46, 10] locking/locking.c:552(parse_share_modes)
  parse_share_modes: delete_on_close: 0, owrt: Thu 09 Jul 2009 08:07:43 AM MDT MDT, cwrt: Wed 31 Dec 1969 05:00:00 PM MST MST, tok: 0, num_share_modes: 1
[2009/07/17 15:00:46, 10] locking/locking.c:649(parse_share_modes)
  parse_share_modes: share_mode_entry[0]:  pid = 28250, share_access = 0x3, private_options = 0x40, access_mask = 0x20189, mid = 0x0, type= 0x3, gen_id = 14, uid = 17227, flags = 0, file_id 811:58f4825:0
[2009/07/17 15:00:46,  5] smbd/trans2.c:1445(get_lanman2_dir_entry)
  get_lanman2_dir_entry: found ./hashlib.pyc fname=hashlib.pyc
[2009/07/17 15:00:46, 10] smbd/trans2.c:1597(get_lanman2_dir_entry)
  get_lanman2_dir_entry: SMB_FIND_FILE_BOTH_DIRECTORY_INFO
[2009/07/17 15:00:46,  5] smbd/trans2.c:2145(call_trans2findfirst)
  call_trans2findfirst - (2) closing dptr_num 256
[2009/07/17 15:00:46,  4] smbd/dir.c:243(dptr_close_internal)
  closing dptr key 256
[2009/07/17 15:00:46,  9] smbd/trans2.c:820(send_trans2_replies)
  t2_rep: params_sent_thistime = 10, data_sent_thistime = 116, useable_space = 131010
[2009/07/17 15:00:46,  9] smbd/trans2.c:822(send_trans2_replies)
  t2_rep: params_to_send = 10, data_to_send = 116, paramsize = 10, datasize = 116
[2009/07/17 15:00:46,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:46,  5] lib/util.c:642(show_msg)
  size=184
  smb_com=0x32
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=136
  smb_flg2=51201
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61377
  smt_wct=10
  smb_vwv[ 0]=   10 (0xA)
  smb_vwv[ 1]=  116 (0x74)
  smb_vwv[ 2]=    0 (0x0)
  smb_vwv[ 3]=   10 (0xA)
  smb_vwv[ 4]=   56 (0x38)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=  116 (0x74)
  smb_vwv[ 7]=   68 (0x44)
  smb_vwv[ 8]=    0 (0x0)
  smb_vwv[ 9]=    0 (0x0)
  smb_bcc=129
[2009/07/17 15:00:46, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 FD FF 01 00 01 00 00   00 00 00 00 00 74 00 00   ........ .....t..
  [0010] 00 00 00 00 00 80 E1 6F   A0 9E 00 CA 01 00 93 8F   .......o ........
  [0020] A7 21 07 CA 01 80 E1 6F   A0 9E 00 CA 01 80 E1 6F   .!.....o .......o
  [0030] A0 9E 00 CA 01 BD 0F 00   00 00 00 00 00 00 00 10   ........ ........
  [0040] 00 00 00 00 00 80 00 00   00 16 00 00 00 00 00 00   ........ ........
  [0050] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
  [0060] 00 00 00 00 00 00 00 00   00 00 00 68 00 61 00 73   ........ ...h.a.s
  [0070] 00 68 00 6C 00 69 00 62   00 2E 00 70 00 79 00 63   .h.l.i.b ...p.y.c
  [0080] 00                                                . 
[2009/07/17 15:00:46,  4] smbd/trans2.c:2189(call_trans2findfirst)
  SMBtrans2 mask=hashlib.pyc directory=./ dirtype=22 numentries=1
[2009/07/17 15:00:46, 10] lib/util_sock.c:781(read_smb_length_return_keepalive)
  got smb length of 41
[2009/07/17 15:00:46,  6] smbd/process.c:1430(process_smb)
  got message type 0x0 of len 0x29
[2009/07/17 15:00:46,  3] smbd/process.c:1433(process_smb)
  Transaction 101 of length 45 (0 toread)
[2009/07/17 15:00:46,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:46,  5] lib/util.c:642(show_msg)
  size=41
  smb_com=0x4
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51207
  smb_tid=1
  smb_pid=65279
  smb_uid=100
  smb_mid=61441
  smt_wct=3
  smb_vwv[ 0]= 4141 (0x102D)
  smb_vwv[ 1]=65535 (0xFFFF)
  smb_vwv[ 2]=65535 (0xFFFF)
  smb_bcc=0
[2009/07/17 15:00:46,  3] smbd/process.c:1251(switch_message)
  switch message SMBclose (pid 28250) conn 0x2b29fbe8a940
[2009/07/17 15:00:46,  4] smbd/uid.c:256(change_to_user)
  change_to_user: Skipping user change - already user
[2009/07/17 15:00:46,  3] smbd/reply.c:4454(reply_close)
  close fd=31 fnum=4141 (numopen=2)
[2009/07/17 15:00:46,  6] smbd/close.c:454(set_close_write_time)
  close_write_time: Sat Feb  6 23:28:15 2106
[2009/07/17 15:00:46, 10] smbd/oplock_linux.c:135(linux_release_kernel_oplock)
  linux_release_kernel_oplock: file hashlib.pyc, file_id = 811:58f4825:0 gen_id = 14 has kernel oplock state of 1.
[2009/07/17 15:00:46, 10] lib/dbwrap_tdb.c:100(db_tdb_fetch_locked)
  Locking key 11080000000000002548
[2009/07/17 15:00:46, 10] lib/dbwrap_tdb.c:129(db_tdb_fetch_locked)
  Allocated locked data 0x0x2b29fbe7c7c0
[2009/07/17 15:00:46, 10] locking/locking.c:552(parse_share_modes)
  parse_share_modes: delete_on_close: 0, owrt: Thu 09 Jul 2009 08:07:43 AM MDT MDT, cwrt: Wed 31 Dec 1969 05:00:00 PM MST MST, tok: 0, num_share_modes: 1
[2009/07/17 15:00:46, 10] locking/locking.c:649(parse_share_modes)
  parse_share_modes: share_mode_entry[0]:  pid = 28250, share_access = 0x3, private_options = 0x40, access_mask = 0x20189, mid = 0x0, type= 0x3, gen_id = 14, uid = 17227, flags = 0, file_id 811:58f4825:0
[2009/07/17 15:00:46, 10] lib/dbwrap_tdb.c:42(db_tdb_record_destr)
  Unlocking key 11080000000000002548
[2009/07/17 15:00:46, 10] locking/posix.c:495(get_windows_lock_ref_count)
  get_windows_lock_count for file hashlib.pyc = 0
[2009/07/17 15:00:46, 10] locking/posix.c:521(delete_windows_lock_ref_count)
  delete_windows_lock_ref_count for file hashlib.pyc
[2009/07/17 15:00:46,  2] smbd/close.c:612(close_normal_file)
  elatov closed file hashlib.pyc (numopen=1) NT_STATUS_OK
[2009/07/17 15:00:46,  5] smbd/files.c:472(file_free)
  freed files structure 4141 (1 used)
[2009/07/17 15:00:46,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:46,  5] lib/util.c:642(show_msg)
  size=35
  smb_com=0x4
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=136
  smb_flg2=51201
  smb_tid=1
  smb_pid=65279
  smb_uid=100
  smb_mid=61441
  smt_wct=0
  smb_bcc=0
[2009/07/17 15:00:47, 10] lib/util_sock.c:781(read_smb_length_return_keepalive)
  got smb length of 110
[2009/07/17 15:00:47,  6] smbd/process.c:1430(process_smb)
  got message type 0x0 of len 0x6e
[2009/07/17 15:00:47,  3] smbd/process.c:1433(process_smb)
  Transaction 102 of length 114 (0 toread)
[2009/07/17 15:00:47,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:47,  5] lib/util.c:642(show_msg)
  size=110
  smb_com=0xa2
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51207
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61505
  smt_wct=24
  smb_vwv[ 0]=  255 (0xFF)
  smb_vwv[ 1]=57054 (0xDEDE)
  smb_vwv[ 2]= 6144 (0x1800)
  smb_vwv[ 3]= 4096 (0x1000)
  smb_vwv[ 4]=    0 (0x0)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=    0 (0x0)
  smb_vwv[ 7]=32768 (0x8000)
  smb_vwv[ 8]=  256 (0x100)
  smb_vwv[ 9]=    0 (0x0)
  smb_vwv[10]=    0 (0x0)
  smb_vwv[11]=    0 (0x0)
  smb_vwv[12]=    0 (0x0)
  smb_vwv[13]=    0 (0x0)
  smb_vwv[14]=    0 (0x0)
  smb_vwv[15]= 1792 (0x700)
  smb_vwv[16]=    0 (0x0)
  smb_vwv[17]=  256 (0x100)
  smb_vwv[18]=    0 (0x0)
  smb_vwv[19]=16384 (0x4000)
  smb_vwv[20]= 8192 (0x2000)
  smb_vwv[21]=  512 (0x200)
  smb_vwv[22]=    0 (0x0)
  smb_vwv[23]=    0 (0x0)
  smb_bcc=27
[2009/07/17 15:00:47, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 5C 00 68 00 61 00 73   00 68 00 6C 00 69 00 62   .\.h.a.s .h.l.i.b
  [0010] 00 2E 00 70 00 79 00 63   00 00 00                 ...p.y.c ...
[2009/07/17 15:00:47,  3] smbd/process.c:1251(switch_message)
  switch message SMBntcreateX (pid 28250) conn 0x2b29fbe8a940
[2009/07/17 15:00:47,  4] smbd/uid.c:256(change_to_user)
  change_to_user: Skipping user change - already user
[2009/07/17 15:00:47, 10] smbd/nttrans.c:483(reply_ntcreate_and_X)
  reply_ntcreate_and_X: flags = 0x10, access_mask = 0x10080 file_attributes = 0x0, share_access = 0x7, create_disposition = 0x1 create_options = 0x200040 root_dir_fid = 0x0, fname = hashlib.pyc
[2009/07/17 15:00:47, 10] smbd/open.c:3365(create_file_default)
  create_file: access_mask = 0x10080 file_attributes = 0x0, share_access = 0x7, create_disposition = 0x1 create_options = 0x200040 oplock_request = 0x0 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), create_file_flags = 0x1, fname = hashlib.pyc
[2009/07/17 15:00:47,  5] smbd/filename.c:148(unix_convert)
  unix_convert called on file "hashlib.pyc"
[2009/07/17 15:00:47, 10] smbd/statcache.c:274(stat_cache_lookup)
  stat_cache_lookup: lookup succeeded for name [HASHLIB.PYC] -> [hashlib.pyc]
[2009/07/17 15:00:47, 10] smbd/open.c:2896(create_file_unixpath)
  create_file_unixpath: access_mask = 0x10080 file_attributes = 0x0, share_access = 0x7, create_disposition = 0x1 create_options = 0x200040 oplock_request = 0x0 ea_list = 0x(nil), sd = 0x(nil), fname = hashlib.pyc
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:3347(posix_get_nt_acl)
  posix_get_nt_acl: called for file .
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2498(canonicalise_acl)
  canonicalise_acl: Access ace entries before arrange :
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r-x
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r-x
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rwx
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:817(print_canon_ace_list)
  print_canon_ace_list: canonicalise_acl: ace entries after arrange
  canon_ace index 0. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rwx
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r-x
  canon_ace index 2. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r-x
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 1c0 to (NT) 1f01ff
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 140 to (NT) 1200a9
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 140 to (NT) 1200a9
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:3347(posix_get_nt_acl)
  posix_get_nt_acl: called for file hashlib.pyc
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2498(canonicalise_acl)
  canonicalise_acl: Access ace entries before arrange :
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:817(print_canon_ace_list)
  print_canon_ace_list: canonicalise_acl: ace entries after arrange
  canon_ace index 0. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
  canon_ace index 2. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 180 to (NT) 12019f
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 100 to (NT) 120089
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 100 to (NT) 120089
[2009/07/17 15:00:47, 10] smbd/open.c:2952(create_file_unixpath)
  create_file_unixpath: open file hashlib.pyc for delete ACCESS_DENIED
[2009/07/17 15:00:47, 10] smbd/open.c:3217(create_file_unixpath)
  create_file_unixpath: NT_STATUS_ACCESS_DENIED
[2009/07/17 15:00:47, 10] smbd/open.c:3507(create_file_default)
  create_file: NT_STATUS_ACCESS_DENIED
[2009/07/17 15:00:47,  3] smbd/error.c:60(error_packet_set)
  error packet at smbd/nttrans.c(541) cmd=162 (SMBntcreateX) NT_STATUS_ACCESS_DENIED
[2009/07/17 15:00:47,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:47,  5] lib/util.c:642(show_msg)
  size=35
  smb_com=0xa2
  smb_rcls=34
  smb_reh=0
  smb_err=49152
  smb_flg=136
  smb_flg2=51201
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61505
  smt_wct=0
  smb_bcc=0
[2009/07/17 15:00:47, 10] lib/util_sock.c:781(read_smb_length_return_keepalive)
  got smb length of 110
[2009/07/17 15:00:47,  6] smbd/process.c:1430(process_smb)
  got message type 0x0 of len 0x6e
[2009/07/17 15:00:47,  3] smbd/process.c:1433(process_smb)
  Transaction 103 of length 114 (0 toread)
[2009/07/17 15:00:47,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:47,  5] lib/util.c:642(show_msg)
  size=110
  smb_com=0xa2
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51207
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61569
  smt_wct=24
  smb_vwv[ 0]=  255 (0xFF)
  smb_vwv[ 1]=57054 (0xDEDE)
  smb_vwv[ 2]= 6144 (0x1800)
  smb_vwv[ 3]= 4096 (0x1000)
  smb_vwv[ 4]=    0 (0x0)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=    0 (0x0)
  smb_vwv[ 7]=    0 (0x0)
  smb_vwv[ 8]=  256 (0x100)
  smb_vwv[ 9]=    0 (0x0)
  smb_vwv[10]=    0 (0x0)
  smb_vwv[11]=    0 (0x0)
  smb_vwv[12]=    0 (0x0)
  smb_vwv[13]=    0 (0x0)
  smb_vwv[14]=    0 (0x0)
  smb_vwv[15]= 1792 (0x700)
  smb_vwv[16]=    0 (0x0)
  smb_vwv[17]=  256 (0x100)
  smb_vwv[18]=    0 (0x0)
  smb_vwv[19]=16384 (0x4000)
  smb_vwv[20]= 8192 (0x2000)
  smb_vwv[21]=  512 (0x200)
  smb_vwv[22]=    0 (0x0)
  smb_vwv[23]=    0 (0x0)
  smb_bcc=27
[2009/07/17 15:00:47, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 5C 00 68 00 61 00 73   00 68 00 6C 00 69 00 62   .\.h.a.s .h.l.i.b
  [0010] 00 2E 00 70 00 79 00 63   00 00 00                 ...p.y.c ...
[2009/07/17 15:00:47,  3] smbd/process.c:1251(switch_message)
  switch message SMBntcreateX (pid 28250) conn 0x2b29fbe8a940
[2009/07/17 15:00:47,  4] smbd/uid.c:256(change_to_user)
  change_to_user: Skipping user change - already user
[2009/07/17 15:00:47, 10] smbd/nttrans.c:483(reply_ntcreate_and_X)
  reply_ntcreate_and_X: flags = 0x10, access_mask = 0x10000 file_attributes = 0x0, share_access = 0x7, create_disposition = 0x1 create_options = 0x200040 root_dir_fid = 0x0, fname = hashlib.pyc
[2009/07/17 15:00:47, 10] smbd/open.c:3365(create_file_default)
  create_file: access_mask = 0x10000 file_attributes = 0x0, share_access = 0x7, create_disposition = 0x1 create_options = 0x200040 oplock_request = 0x0 root_dir_fid = 0x0, ea_list = 0x(nil), sd = 0x(nil), create_file_flags = 0x1, fname = hashlib.pyc
[2009/07/17 15:00:47,  5] smbd/filename.c:148(unix_convert)
  unix_convert called on file "hashlib.pyc"
[2009/07/17 15:00:47, 10] smbd/statcache.c:274(stat_cache_lookup)
  stat_cache_lookup: lookup succeeded for name [HASHLIB.PYC] -> [hashlib.pyc]
[2009/07/17 15:00:47, 10] smbd/open.c:2896(create_file_unixpath)
  create_file_unixpath: access_mask = 0x10000 file_attributes = 0x0, share_access = 0x7, create_disposition = 0x1 create_options = 0x200040 oplock_request = 0x0 ea_list = 0x(nil), sd = 0x(nil), fname = hashlib.pyc
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:3347(posix_get_nt_acl)
  posix_get_nt_acl: called for file .
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2498(canonicalise_acl)
  canonicalise_acl: Access ace entries before arrange :
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r-x
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r-x
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rwx
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:817(print_canon_ace_list)
  print_canon_ace_list: canonicalise_acl: ace entries after arrange
  canon_ace index 0. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rwx
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r-x
  canon_ace index 2. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r-x
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 1c0 to (NT) 1f01ff
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 140 to (NT) 1200a9
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 140 to (NT) 1200a9
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:3347(posix_get_nt_acl)
  posix_get_nt_acl: called for file hashlib.pyc
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2498(canonicalise_acl)
  canonicalise_acl: Access ace entries before arrange :
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:817(print_canon_ace_list)
  print_canon_ace_list: canonicalise_acl: ace entries after arrange
  canon_ace index 0. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
  canon_ace index 2. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 180 to (NT) 12019f
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 100 to (NT) 120089
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:1092(map_canon_ace_perms)
  map_canon_ace_perms: Mapped (UNIX) 100 to (NT) 120089
[2009/07/17 15:00:47, 10] smbd/open.c:2952(create_file_unixpath)
  create_file_unixpath: open file hashlib.pyc for delete ACCESS_DENIED
[2009/07/17 15:00:47, 10] smbd/open.c:3217(create_file_unixpath)
  create_file_unixpath: NT_STATUS_ACCESS_DENIED
[2009/07/17 15:00:47, 10] smbd/open.c:3507(create_file_default)
  create_file: NT_STATUS_ACCESS_DENIED
[2009/07/17 15:00:47,  3] smbd/error.c:60(error_packet_set)
  error packet at smbd/nttrans.c(541) cmd=162 (SMBntcreateX) NT_STATUS_ACCESS_DENIED
[2009/07/17 15:00:47,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:47,  5] lib/util.c:642(show_msg)
  size=35
  smb_com=0xa2
  smb_rcls=34
  smb_reh=0
  smb_err=49152
  smb_flg=136
  smb_flg2=51201
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61569
  smt_wct=0
  smb_bcc=0
[2009/07/17 15:00:47, 10] lib/util_sock.c:781(read_smb_length_return_keepalive)
  got smb length of 100
[2009/07/17 15:00:47,  6] smbd/process.c:1430(process_smb)
  got message type 0x0 of len 0x64
[2009/07/17 15:00:47,  3] smbd/process.c:1433(process_smb)
  Transaction 104 of length 104 (0 toread)
[2009/07/17 15:00:47,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:47,  5] lib/util.c:642(show_msg)
  size=100
  smb_com=0x32
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51207
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61633
  smt_wct=15
  smb_vwv[ 0]=   32 (0x20)
  smb_vwv[ 1]=    0 (0x0)
  smb_vwv[ 2]=    2 (0x2)
  smb_vwv[ 3]=   40 (0x28)
  smb_vwv[ 4]=    0 (0x0)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=    0 (0x0)
  smb_vwv[ 7]=    0 (0x0)
  smb_vwv[ 8]=    0 (0x0)
  smb_vwv[ 9]=   32 (0x20)
  smb_vwv[10]=   68 (0x44)
  smb_vwv[11]=    0 (0x0)
  smb_vwv[12]=    0 (0x0)
  smb_vwv[13]=    1 (0x1)
  smb_vwv[14]=    5 (0x5)
  smb_bcc=35
[2009/07/17 15:00:47, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 00 00 EC 03 00 00 00   00 5C 00 68 00 61 00 73   ........ .\.h.a.s
  [0010] 00 68 00 6C 00 69 00 62   00 2E 00 70 00 79 00 63   .h.l.i.b ...p.y.c
  [0020] 00 00 00                                          ... 
[2009/07/17 15:00:47,  3] smbd/process.c:1251(switch_message)
  switch message SMBtrans2 (pid 28250) conn 0x2b29fbe8a940
[2009/07/17 15:00:47,  4] smbd/uid.c:256(change_to_user)
  change_to_user: Skipping user change - already user
[2009/07/17 15:00:47,  3] smbd/trans2.c:3952(call_trans2qfilepathinfo)
  call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 1004
[2009/07/17 15:00:47,  5] smbd/filename.c:148(unix_convert)
  unix_convert called on file "hashlib.pyc"
[2009/07/17 15:00:47, 10] smbd/statcache.c:274(stat_cache_lookup)
  stat_cache_lookup: lookup succeeded for name [HASHLIB.PYC] -> [hashlib.pyc]
[2009/07/17 15:00:47, 10] locking/locking.c:891(fetch_share_mode_unlocked)
  fetch_share_mode_unlocked: no share_mode record around (file not open)
[2009/07/17 15:00:47,  3] smbd/trans2.c:4066(call_trans2qfilepathinfo)
  call_trans2qfilepathinfo hashlib.pyc (fnum = -1) level=1004 call=5 total_data=0
[2009/07/17 15:00:47,  8] smbd/dosmode.c:474(dos_mode)
  dos_mode: hashlib.pyc
[2009/07/17 15:00:47,  8] smbd/dosmode.c:175(dos_mode_from_sbuf)
  dos_mode_from_sbuf returning 
[2009/07/17 15:00:47,  8] smbd/dosmode.c:521(dos_mode)
  dos_mode returning 
[2009/07/17 15:00:47, 10] smbd/trans2.c:4308(call_trans2qfilepathinfo)
  call_trans2qfilepathinfo: SMB_FILE_BASIC_INFORMATION
[2009/07/17 15:00:47,  5] smbd/trans2.c:4318(call_trans2qfilepathinfo)
  SMB_QFBI - create: Thu Jul  9 08:07:43 2009
   access: Fri Jul 17 15:00:46 2009
   write: Thu Jul  9 08:07:43 2009
   change: Thu Jul  9 08:07:43 2009
   mode: 80
[2009/07/17 15:00:47,  9] smbd/trans2.c:820(send_trans2_replies)
  t2_rep: params_sent_thistime = 2, data_sent_thistime = 40, useable_space = 131010
[2009/07/17 15:00:47,  9] smbd/trans2.c:822(send_trans2_replies)
  t2_rep: params_to_send = 2, data_to_send = 40, paramsize = 2, datasize = 40
[2009/07/17 15:00:47,  5] lib/util.c:632(show_msg)
[2009/07/17 15:00:47,  5] lib/util.c:642(show_msg)
  size=100
  smb_com=0x32
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=136
  smb_flg2=51201
  smb_tid=1
  smb_pid=3844
  smb_uid=100
  smb_mid=61633
  smt_wct=10
  smb_vwv[ 0]=    2 (0x2)
  smb_vwv[ 1]=   40 (0x28)
  smb_vwv[ 2]=    0 (0x0)
  smb_vwv[ 3]=    2 (0x2)
  smb_vwv[ 4]=   56 (0x38)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=   40 (0x28)
  smb_vwv[ 7]=   60 (0x3C)
  smb_vwv[ 8]=    0 (0x0)
  smb_vwv[ 9]=    0 (0x0)
  smb_bcc=45
[2009/07/17 15:00:47, 10] ../lib/util/util.c:304(_dump_data)
  [0000] 00 00 00 00 00 80 E1 6F   A0 9E 00 CA 01 00 93 8F   .......o ........
  [0010] A7 21 07 CA 01 80 E1 6F   A0 9E 00 CA 01 80 E1 6F   .!.....o .......o
  [0020] A0 9E 00 CA 01 80 00 00   00 00 00 00 00           ........ .....
[2009/07/17 15:01:40, 10] lib/events.c:105(run_events)
  Running timed event "smbd_idle_event_handler" 0x2b29fbe64650
[2009/07/17 15:01:40, 10] lib/events.c:287(s3_event_debug)
  s3_event: Destroying timer event 0x2b29fbe64650 "smbd_idle_event_handler"
[2009/07/17 15:01:40, 10] smbd/process.c:641(smbd_idle_event_handler)
  smbd_idle_event_handler: idle_evt(deadtime) (nil) called
[2009/07/17 15:01:40, 10] smbd/process.c:652(smbd_idle_event_handler)
  smbd_idle_event_handler: idle_evt(deadtime) (nil) rescheduled
[2009/07/17 15:01:40, 10] lib/events.c:287(s3_event_debug)
  s3_event: Added timed event "smbd_idle_event_handler": 0x2b29fbe74830
[2009/07/17 15:01:40, 10] lib/events.c:105(run_events)
  Running timed event "smbd_idle_event_handler" 0x2b29fbe74b20
[2009/07/17 15:01:40, 10] lib/events.c:287(s3_event_debug)
  s3_event: Destroying timer event 0x2b29fbe74b20 "smbd_idle_event_handler"
[2009/07/17 15:01:40, 10] smbd/process.c:641(smbd_idle_event_handler)
  smbd_idle_event_handler: idle_evt(housekeeping) (nil) called
[2009/07/17 15:01:40,  3] smbd/sec_ctx.c:310(set_sec_ctx)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2009/07/17 15:01:40,  5] auth/token_util.c:522(debug_nt_user_token)
  NT user token: (NULL)
[2009/07/17 15:01:40,  5] auth/token_util.c:548(debug_unix_user_token)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
=========================================================================

I beleive what you asked for is the following in the logs
===============================================================[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 0. Type = allow SID = S-1-1-0 other SMB_ACL_OTHER ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 1. Type = allow SID = S-1-22-2-151 gid 151 (systems) SMB_ACL_GROUP_OBJ ace_flags = 0x0 perms r--
[2009/07/17 15:00:47, 10] smbd/posix_acls.c:2511(canonicalise_acl)
  canon_ace index 2. Type = allow SID = S-1-5-352321536-500376443-279550357-203234921-35454 uid 17227 (elatov) SMB_ACL_USER_OBJ ace_flags = 0x0 perms rw-===
=====================================================================

it looks like I (elatov) have the (rw-===) permission on the file.

here is how the stat of the file looks like from smbclient

========================================================================
smb: \> soils:~>smbclient //bechtel/elatov -W AD
Enter elatov's password:
Domain=[AD] OS=[Unix] Server=[Samba 3.4.0]
smb: \> stat hashlib.pyc
File: \hashlib.pyc
Size: 4029              Blocks: 8       regular file
Inode: 93276197 Links: 1
Access: (0644/-rw-r--r--)       Uid: 17227      Gid: 151
Access: 2009-07-17 15:06:13 -0600
Modify: 2009-07-09 08:07:43 -0600
Change: 2009-07-09 08:07:43 -0600
smb: \> rm hashlib.pyc
NT_STATUS_ACCESS_DENIED deleting remote file \hashlib.pyc
==================================================================

and attached is a snapshot of the permissions from the windows side after I have mounted the share from the server (bechtel)


Comment 4 Karim Elatov 2009-07-20 17:33:05 UTC
(In reply to comment #1)
> Can you upload the exact permissions on this directory please, also a full
> debug level 10 which should give the exact token list of the connected user.
> 
> In Samba 3.4.0 we map POSIX permissions to Windows permissions, and you must
> have the DELETE permission on the file, or the DELETE_CHILD on the directory in
> order to delete a file. This is obviously not the case here and I'm trying to
> discover why.
> 
> Thanks !
> 
> Jeremy.
> 

Did you get my last response?

Sorry for bugging you :)

-Karim
Comment 5 Richard Sharpe 2013-04-20 23:34:30 UTC
There's been no activity on this bug since 2009. It seems like the guy who filed it no longer cares and that the original problem was that he did not have W access to the parent directory (required under UNIX to delete an entry in a directory).

Can we close this bug as invalid or something?
Comment 6 Karim Elatov 2013-04-21 00:42:35 UTC
Sure go ahead and close it. I really don't remember what happened to this... it was a long time ago.

Thanks,
-Karim
(In reply to comment #5)
> There's been no activity on this bug since 2009. It seems like the guy who
> filed it no longer cares and that the original problem was that he did not have
> W access to the parent directory (required under UNIX to delete an entry in a
> directory).
> 
> Can we close this bug as invalid or something?