]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pybindings: xattr_native raises OSError not TypeError
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 7 Sep 2022 00:56:37 +0000 (12:56 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 7 Sep 2022 05:01:37 +0000 (05:01 +0000)
Most likely it is a bad filename or attribute, not the wrong type of
argument.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14937

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/samba-tool-ntacl
source4/ntvfs/posix/python/pyxattr_native.c

index aa37955471cd31c68d68ae0d00245b62d1451574..cffdcd1788a076adda6df3a3835e00e8fb52ae81 100644 (file)
@@ -1,3 +1 @@
 ^samba.tests.samba_tool.ntacl.+test_with_missing_files
-^samba.tests.posixacl.+test_setntacl_smbd_setposixacl_getntacl
-^samba.tests.posixacl.+test_setposixacl_getntacl
index d242cd98a5d6484eb526c430516b69791c80fc58..7511e5c02bfd2087e569783c04aac0c24e62786e 100644 (file)
@@ -52,7 +52,7 @@ static PyObject *py_wrap_setxattr(PyObject *self, PyObject *args)
                if (errno == ENOTSUP) {
                        PyErr_SetFromErrno(PyExc_IOError);
                } else {
-                       PyErr_SetFromErrno(PyExc_TypeError);
+                       PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
                }
                return NULL;
        }
@@ -74,7 +74,7 @@ static PyObject *py_wrap_getxattr(PyObject *self, PyObject *args)
                if (errno == ENOTSUP) {
                        PyErr_SetFromErrno(PyExc_IOError);
                } else {
-                       PyErr_SetFromErrno(PyExc_TypeError);
+                       PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
                }
                talloc_free(mem_ctx);
                return NULL;
@@ -86,7 +86,7 @@ static PyObject *py_wrap_getxattr(PyObject *self, PyObject *args)
                if (errno == ENOTSUP) {
                        PyErr_SetFromErrno(PyExc_IOError);
                } else {
-                       PyErr_SetFromErrno(PyExc_TypeError);
+                       PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
                }
                talloc_free(mem_ctx);
                return NULL;