[SCM] Samba Shared Repository - branch master updated

Stefan (metze) Metzmacher metze at samba.org
Thu Sep 22 23:02:46 MDT 2011


Am 23.09.2011 07:01, schrieb Matthieu Patou:
> On 22/09/2011 21:14, Stefan (metze) Metzmacher wrote:
>> Hi Matthieu,
>>
>>> diff --git a/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> b/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> index 2b28aca..a08557e 100644
>>> --- a/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> +++ b/source4/ntvfs/posix/python/pyxattr_tdb.c
>>> @@ -60,9 +60,8 @@ static PyObject *py_wrap_setxattr(PyObject *self,
>>> PyObject *args)
>>>       status = push_xattr_blob_tdb_raw(eadb, mem_ctx, attribute,
>>> filename, -1,
>>>                                       &blob);
>>>       if (!NT_STATUS_IS_OK(status)) {
>>> -        PyErr_FromNTSTATUS(status);
>>>           talloc_free(mem_ctx);
>>> -        return NULL;
>>> +        PyErr_NTSTATUS_IS_ERR_RAISE(status);
>>>       }
>>>       talloc_free(mem_ctx);
>>>       Py_RETURN_NONE;
>>> @@ -91,9 +90,8 @@ static PyObject *py_wrap_getxattr(PyObject *self,
>>> PyObject *args)
>>>       status = pull_xattr_blob_tdb_raw(eadb, mem_ctx, attribute,
>>> filename,
>>>                                        -1, 100,&blob);
>>>       if (!NT_STATUS_IS_OK(status) || blob.length<  0) {
>>> -        PyErr_FromNTSTATUS(status);
>>>           talloc_free(mem_ctx);
>>> -        return NULL;
>>> +        PyErr_NTSTATUS_IS_ERR_RAISE(status);
>> Why this changes? What was the problem?
>>
>> NT_STATUS_IS_ERR() is not the same as !NT_STATUS_IS_OK()
> Well the problem is that without this if your status was != OK you'll
> get error like instead of getting the right exception.
> "ERROR(<type 'exceptions.SystemError'>): uncaught exception - error
> return without exception set"
> 
> 
> As PyErr_FromNTSTATUS(status) is not the same as PyErr_SetNTSTATUS(status)
> 
> If _IS_ERR is not the same then we need to have this code:
> if (!NT_STATUS_IS_OK(status)) {
>         PyErr_SetNTSTATUS(status);
>         talloc_free(mem_ctx);
>         return NULL;
>     }

yes, that looks more sane to me.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-cvs/attachments/20110923/41a74b08/attachment.pgp>


More information about the samba-cvs mailing list