Partha Sarathi
2016-Mar-30 22:43 UTC
[Samba] Fwd: Fwd: Setting FS Quota against SAMBA share from windows2k12
Thanks Jeremy for the comment on unwanted code. Please find the updated patch. Regards, --Partha On Tue, Mar 29, 2016 at 4:03 PM, Jeremy Allison <jra at samba.org> wrote:> On Tue, Mar 29, 2016 at 02:33:48PM -0700, Partha Sarathi wrote: > > Thanks Jeremy. > > > > Please find the updated patch for review. > > More changes (sorry). This code: > > + if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { > + return NT_STATUS_INVALID_LEVEL; > + } > + > + if (!CAN_WRITE(conn)) { > + /* Allow POSIX opens. The open path will deny > + * any non-readonly opens. */ > + if (info_level != SMB_POSIX_PATH_OPEN) { > + return NT_STATUS_DOS(ERRSRV, ERRaccess); > + } > + } > > isn't needed. It's boilerplate from smbd_do_setfilepathinfo() > and really doesn't apply here. > > > On Tue, Mar 29, 2016 at 9:44 AM, Jeremy Allison <jra at samba.org> wrote: > > > > > On Mon, Mar 28, 2016 at 10:23:38PM -0700, Partha Sarathi wrote: > > > > Hi Folks, > > > > > > > > Attached the patch which fixes the SMB2_SETINFO to handle > > > > the SMB2_INFO_FILESYSTEM info type and SMB_FS_QUOTA_INFORMATION info > > > level. > > > > > > > > Please let me now your feedback on the patch. > > > > > > > > Regards, > > > > --Partha > > > > > > Hi Partha, > > > > > > Thanks so much for the patch ! > > > > > > Quick look over, one change I'd like is to change > > > the parameters to smbd_do_setfsinfo() from int to > > > size_t for: > > > > > > + int data_size; > > > + int ret_size = 0; > > > > > > I know the previous versions of these functions > > > took 'int' but these things really are unsigned, > > > so I'd like to tighten this up for future code. > > > > > > Cheers, > > > > > > Jeremy. > > > > > > > ---------- Forwarded message ---------- > > > > From: Partha Sarathi <partha at exablox.com> > > > > Date: Fri, Mar 25, 2016 at 12:00 PM > > > > Subject: Setting FS Quota against SAMBA share from windows2k12 > > > > To: samba at lists.samba.org, samba-technical < > > > samba-technical at lists.samba.org> > > > > > > > > > > > > Hi Folks, > > > > > > > > I tried to set quota(soft limit and hard limit) on a share from > > > > Windows2k12R2 and I noticed "NT_STATUS_INVALID_PARAMETER" error for > the > > > > SMB2 setinfo request. Attached the packet capture for your reference. > > > > > > > > SAMBA version 4.3.4 > > > > > > > > The below is the corresponding debug log > > > > > > > > [2016/03/25 10:38:21.333815, 10, pid=17987, effective(0, 110000513), > > > > real(0, 0)] > ../source3/smbd/smb2_setinfo.c:379(smbd_smb2_setinfo_send) > > > > smbd_smb2_setinfo_send: $Extend/$Quota:$Q:$INDEX_ALLOCATION - fnum > > > > 2762575723 > > > > [2016/03/25 10:38:21.333824, 10, pid=17987, effective(0, 110000513), > > > > real(0, 0)] > > > ../source3/smbd/smb2_server.c:2789(smbd_smb2_request_error_ex) > > > > smbd_smb2_request_error_ex: idx[1] > status[NT_STATUS_INVALID_PARAMETER] > > > || > > > > at ../source3/smbd/smb2_setinfo.c:132 > > > > [2016/03/25 10:38:21.333831, 10, pid=17987, effective(0, 110000513), > > > > real(0, 0)] > ../source3/smbd/smb2_server.c:2680(smbd_smb2_request_done_ex) > > > > smbd_smb2_request_done_ex: idx[1] > status[NT_STATUS_INVALID_PARAMETER] > > > > body[8] dyn[yes:1] at ../source3/smbd/smb2_server.c:2837 > > > > > > > > > > > > When I looked at the code the > > > > > > > > The* smbd_smb2_setinfo_send()* is handling only the below two info > types > > > > and its not handling *SMB2_0_INFO_FILESYSTEM*. > > > > > > > > case 0x01:/* SMB2_SETINFO_FILE */ > > > > > > > > case 0x03:/* SMB2_SETINFO_SECURITY */ > > > > > > > > > > > > From the MS-SMB2 spec it looks like there is a specific info type for > > > > handling the FILESYSTEM requests as below and in samba this info > type is > > > > not considered . Is it a known issue or I am missing anything ? > > > > > > > > *3.3.5.21.2 Handling SMB2_0_INFO_FILESYSTEM * > > > > > > > > The information classes that are supported for setting underlying > object > > > > store information are listed in section 2.2.39. Documentation for > these > > > is > > > > provided [MS-FSCC] section 2.5. Requests for information classes not > > > listed > > > > in section 2.2.39 but documented in section 2.5 of [MS-FSCC] for > Uses of > > > > "Set" or "LOCAL" MUST be failed with STATUS_NOT_SUPPORTED. Requests > for > > > > information classes not documented in section 2.5 of [MS-FSCC] or > > > > documented in section 2.5 of [MS-FSCC] for Uses of only "Query" MUST > be > > > > failed with STATUS_INVALID_INFO_CLASS. > > > > > > > > If the object store supports security and the information class is > > > > FileFsControlInformation or FileFsObjectIdInformation and > > > Open.GrantedAccess > > > > does not include FILE_WRITE_DATA, the server MUST fail the request > with > > > > STATUS_ACCESS_DENIED. > > > > > > > > The server MUST apply the information requested to the underlying > object > > > > store.<359> If the underlying object store returns an error, the > server > > > > MUST fail the request with the error code received. Otherwise, the > server > > > > MUST initialize an SMB2 SET_INFO Response following the syntax given > in > > > > section 2.2.40. The response MUST then be sent to the client. > > > > > > > > --Partha > > > > > > > > > > > > > > > > > > -- > > Thanks & Regards > > -Partha > > >-- Thanks & Regards -Partha -- Thanks & Regards -Partha
Possibly Parallel Threads
- Setting FS Quota against SAMBA share from windows2k12
- Security permissions issues after changing idmap backend from RID to AUTORID
- Security permissions issues after changing idmap backend from RID to AUTORID
- Security permissions issues after changing idmap backend from RID to AUTORID
- Security permissions issues after changing idmap backend from RID to AUTORID