Am Montag, 27. August 2012, 07:08:14 schrieb Jim Gallagher: > OK, this is getting interesting. When I use smbclient, flipping the RO > attrib flips sets the unix permissions as expected. > > Here is the basic wireshark trace. This capture below is between the samba > server and the Windows 2003 client. The capture starts after I have the > file properties dialog up, but before I set RO and select "OK". > > No. Time Source Destination Protocol > Info > 1 0.000000 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 2 0.001328 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 3 0.001586 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 4 0.002703 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 5 0.002824 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query FS Volume Info > 6 0.003585 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 7 0.003674 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query FS Attribute Info > 8 0.004379 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 9 0.004538 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 10 0.005512 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 11 0.005701 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 12 0.006656 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 13 0.006747 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query FS Attribute Info > 14 0.007461 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 15 0.008554 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 16 0.009607 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 17 0.009771 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 18 0.010686 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 19 0.010811 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query FS Volume Info > 20 0.011535 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 21 0.011614 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query FS Attribute Info > 22 0.012330 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 23 0.012480 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 24 0.013417 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 25 0.013582 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 26 0.014480 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 27 0.014879 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query FS Attribute Info > 28 0.030232 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 29 0.070392 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 30 0.071543 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 31 0.071681 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query Full FS Size Info > 32 0.072603 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 33 0.073288 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 34 0.074264 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 35 0.074354 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query Full FS Size Info > 36 0.075160 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 37 0.076763 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 38 0.077791 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 39 0.077905 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query Full FS Size Info > 40 0.088850 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 41 0.093045 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 42 0.097632 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 43 0.097814 <server IP> <client IP> SMB Trans2 > Request, QUERY_FS_INFO, Query Full FS Size Info > 44 0.098672 <client IP> <server IP> SMB Trans2 > Response, QUERY_FS_INFO > 45 0.233616 <server IP> <client IP> TCP > ls3bcast > microsoft-ds [ACK] Seq=1701 Ack=2123 Win=63756 Len=0 > 46 2.635716 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: \test.c > 47 2.636974 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 48 2.637319 <server IP> <client IP> SMB NT > Create AndX Request, FID: 0x2c3d, Path: \test.c > 49 2.638538 <client IP> <server IP> SMB NT > Create AndX Response, FID: 0x2c3d > 50 2.638638 <server IP> <client IP> SMB Trans2 > Request, QUERY_FILE_INFO, FID: 0x2c3d, Query File Internal Info > 51 2.639515 <client IP> <server IP> SMB Trans2 > Response, FID: 0x2c3d, QUERY_FILE_INFO > 52 2.640022 <server IP> <client IP> SMB Trans2 > Request, QUERY_FILE_INFO, FID: 0x2c3d, Query File Basic Info > 53 2.640894 <client IP> <server IP> SMB Trans2 > Response, FID: 0x2c3d, QUERY_FILE_INFO > 54 2.641001 <server IP> <client IP> SMB Trans2 > Request, QUERY_FILE_INFO, FID: 0x2c3d, Query File Standard Info > 55 2.641861 <client IP> <server IP> SMB Trans2 > Response, FID: 0x2c3d, QUERY_FILE_INFO > 56 2.642063 <server IP> <client IP> SMB Trans2 > Request, SET_FILE_INFO, FID: 0x2c3d > 57 2.642842 <client IP> <server IP> SMB Trans2 > Response, FID: 0x2c3d, SET_FILE_INFO > 58 2.642976 <server IP> <client IP> SMB Close > Request, FID: 0x2c3d > 59 2.643961 <client IP> <server IP> SMB Close > Response, FID: 0x2c3d > 60 2.645734 <server IP> <client IP> SMB NT > Create AndX Request, Path: \Thumbs.db > 61 2.646674 <client IP> <server IP> SMB NT > Create AndX Response, FID: 0x0000, Error: STATUS_OBJECT_NAME_NOT_FOUND > 62 2.648820 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 63 2.650038 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 64 2.650707 <server IP> <client IP> SMB Trans2 > Request, FIND_FIRST2, Pattern: \test.c > 65 2.651792 <client IP> <server IP> SMB Trans2 > Response, FIND_FIRST2, Files: test.c > 66 2.664268 <server IP> <client IP> SMB > Session Setup AndX Request, NTLMSSP_NEGOTIATE > 67 2.664415 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 68 2.664878 <client IP> <server IP> TCP > microsoft-ds > ls3bcast [ACK] Seq=3054 Ack=2944 Win=65535 Len=0 > 69 2.665736 <client IP> <server IP> SMB > Session Setup AndX Response, NTLMSSP_CHALLENGE, Error: > STATUS_MORE_PROCESSING_REQUIRED > 70 2.666220 <server IP> <client IP> SMB > Session Setup AndX Request, NTLMSSP_AUTH, User: \ > 71 2.666308 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 72 2.666716 <server IP> <client IP> SMB Trans2 > Request, FIND_FIRST2, Pattern: \test.c > 73 2.667233 <client IP> <server IP> TCP > microsoft-ds > ls3bcast [ACK] Seq=3530 Ack=3360 Win=65535 Len=0 > 74 2.675369 <client IP> <server IP> SMB > Session Setup AndX Response > 75 2.675710 <server IP> <client IP> SMB Tree > Connect AndX Request, Path: \\server.domain.com\IPC$ > 76 2.676012 <client IP> <server IP> SMB Trans2 > Response, FIND_FIRST2, Files: test.c > 77 2.677337 <server IP> <client IP> SMB Trans2 > Request, QUERY_PATH_INFO, Query File Basic Info, Path: > 78 2.677949 <client IP> <server IP> TCP > microsoft-ds > ls3bcast [ACK] Seq=3870 Ack=3572 Win=65535 Len=0 > 79 2.678581 <client IP> <server IP> SMB Tree > Connect AndX Response > 80 2.678906 <server IP> <client IP> SMB Trans2 > Request, GET_DFS_REFERRAL, File: \server.domain.com\test > 81 2.679080 <client IP> <server IP> SMB Trans2 > Response, QUERY_PATH_INFO > 82 2.679392 <server IP> <client IP> SMB Trans2 > Request, FIND_FIRST2, Pattern: \test.c > 83 2.679838 <client IP> <server IP> SMB Trans2 > Response, GET_DFS_REFERRAL, Error: STATUS_NOT_FOUND > 84 2.686475 <client IP> <server IP> SMB Trans2 > Response, FIND_FIRST2, Files: test.c > 85 2.686546 <server IP> <client IP> TCP > ls3bcast > microsoft-ds [ACK] Seq=3822 Ack=4253 Win=63413 Len=0 > 86 2.699063 <server IP> <client IP> SMB Trans2 > Request, GET_DFS_REFERRAL, File: \server.domain.com\test > 87 2.700549 <client IP> <server IP> SMB Trans2 > Response, GET_DFS_REFERRAL, Error: STATUS_NOT_FOUND > 88 2.858660 <server IP> <client IP> TCP > ls3bcast > microsoft-ds [ACK] Seq=3972 Ack=4292 Win=63374 Len=0 >
In that (ascii) wireshark trace, the command which would affect dos attributes, is SET_FILE_INFO - which is seen once in your trace above. Unfortunately the "File Attributes" are not listed in this short format. I've now also used windows file explorer's "file properties dialog" with - a 32Bit windows XP Pro box - a 64Bit windows 7 (home) box ("max protocol = NT1" set in smb.conf) With both all is working as expected. Both use the trans2 SET_FILE_INFO request (infolevel 1004) to set or unset the dos attributes (traced with wirehark). Also the samba smbd log contains the corresponding lines (log level = 4): [2012/08/27 23:07:37.031309, 3] smbd/trans2.c:8078(call_trans2setfilepathinfo) call_trans2setfilepathinfo(8) test.fil (fnum 46646) info_level=1004 totdata=40 [2012/08/27 23:07:37.031442, 3] smbd/trans2.c:7654(smbd_do_setfilepathinfo) smbd_do_setfilepathinfo: test.fil (fnum 46646) info_level=1004 totdata=40 [2012/08/27 23:07:37.031658, 3] smbd/dosmode.c:160(unix_mode) unix_mode(test.fil) returning 0644 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The latest line above should be seen in your smbd log, too! If you like, take a new sniff when toggling the read only bit 2 times - so on/off 2 times (using the file properties dialog). Save that file with wireshark as a binary file in standard pcap format and mail it to kukks at samba dot org. A corresponding debug 4 smbd logfile would be great. Cheers, Günter --- Note, cause i'm testing with latest samba git tree version, i had to set "max protocol = NT1" in smb.conf when using win7 to match your settings. But also with the new SMB2 calls, all is working fine. > On Sun, Aug 26, 2012 at 4:24 PM, Günter Kukkukk <li...@kukkukk.com> wrote: > > when you change a dos attribute, within wireshark you should see > > > > Set Information Request, Path:\yourfile > > Set Information Response > > > > packet pairs on the wire. > > The passed "File Attributes" can be also viewed. > > > > Haven't tried windows7 here, whether it uses a different approach. > > > > Can you try on your server itself: > > smbclient //localhost/test -U jim > > ... pw entry > > smb: \> setmode yourfile +r > > smb: \> setmode yourfile -r > > > > Cheers, Günter -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba