Comments (10)
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.
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.
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.
I think I'll elect to just delete the exception handler. Less to go deprecated.
from libcap-ng.
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)
- capng_get_caps_process vs sandbox HOT 3
- Warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare] in lookup_table.c and cap-ng.c HOT 2
- capng_updatev (python) doesnt work HOT 2
- `capng_apply` applies ambient caps too early? HOT 7
- `capng_apply` does not notice it failed to apply a capability HOT 6
- How to support conditional compilation with/without CAPNG_AMBIENT & CAPNG_SELECT_ALL? HOT 4
- Upgrade to libcap-ng 0.8.1 breaks GNOME Keyring and other projects HOT 15
- Improve last cap detection HOT 4
- libdrop_ambient breaks compile if PR_CAP_AMBIENT is undefined HOT 4
- Detect kernel support of PR_CAP_AMBIENT at runtime HOT 5
- libcap-ng used by "/usr/sbin/mount.cifs" failed due to not having CAP_SETPCAP in capng_apply HOT 3
- capng_change_id() can leave PR_SET_KEEPCAPS set to 1 on failure HOT 4
- Tarball distribution issues. HOT 3
- Problem with namespaces HOT 5
- Why to modify capng_updatev parameter type to signed for python bindings HOT 2
- Misleading output in configure HOT 2
- Source version corresponding to libdrop_ambient 0.0.0 HOT 2
- 0.8.4: autoreconf fails HOT 4
- undefined reference to `pthread_atfork' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcap-ng.