diff mbox series

[5/7] libselinux: update Python binding

Message ID 20231109135148.42688-5-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit 9fcf4ccad323
Delegated to: Petr Lautrbach
Headers show
Series [1/7] Drop LGTM.com configuration | expand

Commit Message

Christian Göttsche Nov. 9, 2023, 1:51 p.m. UTC
Update for commit 494eb683f3d1 ("libselinux: add getpidprevcon").

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/src/selinuxswig_python_exception.i | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/libselinux/src/selinuxswig_python_exception.i b/libselinux/src/selinuxswig_python_exception.i
index a02f4923..e5e55a79 100644
--- a/libselinux/src/selinuxswig_python_exception.i
+++ b/libselinux/src/selinuxswig_python_exception.i
@@ -79,6 +79,22 @@ 
   }
 }
 
+%exception getpidprevcon {
+  $action
+  if (result < 0) {
+     PyErr_SetFromErrno(PyExc_OSError);
+     SWIG_fail;
+  }
+}
+
+%exception getpidprevcon_raw {
+  $action
+  if (result < 0) {
+     PyErr_SetFromErrno(PyExc_OSError);
+     SWIG_fail;
+  }
+}
+
 %exception getexeccon {
   $action
   if (result < 0) {