[PATCH] s4:libcli/raw: Add option to set per packet case sensitive flag
Samuel Cabrero
scabrero at zentyal.com
Wed Nov 20 05:49:51 MST 2013
Done. I have also signed the patches.
On Wednesday 20 November 2013 12:30:18 Jelmer Vernooij wrote:
> Quick note on the python bindings here:
>
> On Wed, Nov 20, 2013 at 12:09:33PM +0100, Samuel Cabrero wrote:
> > index fb981c7..a24dbd8 100644
> > --- a/source4/libcli/pysmb.c
> > +++ b/source4/libcli/pysmb.c
> > @@ -528,6 +528,31 @@ static PyObject *py_close_file(pytalloc_Object *self,
> > PyObject *args, PyObject *>
> > Py_RETURN_NONE;
> >
> > }
> >
> > +/*
> > + * Set the case sensitive flag on the packets
> > + */
> > +static PyObject *py_smb_case_sensitive(pytalloc_Object *self, PyObject
> > *args) +{
> > + NTSTATUS status;
> > + char s;
> > + bool sensitive;
> > + struct smb_private_data *spdata;
> > +
> > + if (!PyArg_ParseTuple(args, "b:case_sensitive", &s)) {
> > + return NULL;
> > + }
> > + sensitive = s ? true : false;
> > +
> > + spdata = self->ptr;
> > + status = smbcli_set_case_sensitive(spdata->tree, sensitive);
> > +
> > + if (NT_STATUS_IS_OK(status)) {
> > + Py_RETURN_TRUE;
> > + }
> > +
> > + Py_RETURN_FALSE;
> > +}
>
> Please raise exceptions for NTSTATUS and return None. Returning true/false
> loses information (i.e. what kind of error occurred) and makes it easy to
> ignore errors.
>
> Jelmer
--
Samuel Cabrero - Developer
scabrero at zentyal.com
Easy IT for small business
www.zentyal.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s4-libcli-raw-Add-new-command-to-set-per-packet-case.patch
Type: text/x-patch
Size: 9046 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131120/9c47fb1a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s4-libcli-raw-Add-test-for-per-packet-case-sensitive.patch
Type: text/x-patch
Size: 7042 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131120/9c47fb1a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-s4-libcli-raw-pysmb-Raise-exception-on-failed-case_s.patch
Type: text/x-patch
Size: 917 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131120/9c47fb1a/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131120/9c47fb1a/attachment.pgp>
More information about the samba-technical
mailing list