[Samba] Samba 3.4.3 and DOS read only

Jim Gallagher jim at thegallaghers.biz
Sun Aug 26 23:08:14 MDT 2012


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


On Sun, Aug 26, 2012 at 4:24 PM, Günter Kukkukk <linux at 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
>


More information about the samba mailing list