GithubHelp home page GithubHelp logo

Comments (10)

taladar avatar taladar commented on June 8, 2024

Same issue in Gentoo unstable with the same versions of libcap-ng and swig. I have not really found the correct %exception based replacement syntax though.

@jplesnik What did you use to replace that block?

from libcap-ng.

stevegrubb avatar stevegrubb commented on June 8, 2024

This code was copied over from the audit project. The audit project was modified 5 months ago to pin point the exception to audit_open. Libcap-ng doesn't quite have a function like that. I suppose the except code can be deleted and let exceptions be thrown in the python code. I don't have a good sense of how many projects that might affect. Python is not normally used for daemons or setuid programs. So, maybe there's no risk in deleting the exception handler?

from libcap-ng.

lucabonnix avatar lucabonnix commented on June 8, 2024

If you want to keep the exception handler, you can simply change "%except(python)" with "%exception" and add a dedicated exception for void functions (otherwise "result" variable is not defined):

--- libcap-ng-0.8.4.old/bindings/src/capng_swig.i       2023-12-20 16:23:01.000000000 +0100
+++ libcap-ng-0.8.4/bindings/src/capng_swig.i   2024-01-04 12:53:12.131746399 +0100
@@ -30,7 +30,16 @@
 
 %varargs(16, signed capability = 0) capng_updatev;
 
-%except(python) {
+%exception capng_clear {
+  $action
+}
+%exception capng_fill {
+  $action
+}
+%exception capng_setpid {
+  $action
+}
+%exception {
   $action
   if (result < 0) {
     PyErr_SetFromErrno(PyExc_OSError);

But with the previous swig version the "%except(python)" was simply ignored, so maybe it is safe to remove it at all.

from libcap-ng.

stevegrubb avatar stevegrubb commented on June 8, 2024

I think I'll elect to just delete the exception handler. Less to go deprecated.

from libcap-ng.

stevegrubb avatar stevegrubb commented on June 8, 2024

And a new package pushed into rawhide. I'll go ahead and close this. If anything else comes up, feel free to re-open.

from libcap-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.