From 04b428bc32f9199f054fbe98052248735eaf4dce Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Mon, 7 Mar 2011 07:56:00 -0800 Subject: [PATCH] Merge from trunk revs 1660 and 1661: Update swig to export all current interface fns, and update change_hatv and change_hat_vargs prototypes to use long (this would be an ABI change; however, there are no known users of those particular functions). Acked-By: Steve Beattie --- libraries/libapparmor/src/apparmor.h | 4 ++-- libraries/libapparmor/swig/SWIG/libapparmor.i | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libraries/libapparmor/src/apparmor.h b/libraries/libapparmor/src/apparmor.h index 5d7156022..4ae0a03cf 100644 --- a/libraries/libapparmor/src/apparmor.h +++ b/libraries/libapparmor/src/apparmor.h @@ -31,8 +31,8 @@ extern int aa_change_hat(const char *subprofile, unsigned long magic_token); extern int aa_change_profile(const char *profile); extern int aa_change_onexec(const char *profile); -extern int aa_change_hatv(const char *subprofiles[], unsigned int token); -extern int (aa_change_hat_vargs)(unsigned int token, int count, ...); +extern int aa_change_hatv(const char *subprofiles[], unsigned long token); +extern int (aa_change_hat_vargs)(unsigned long token, int count, ...); #define __macroarg_counter(Y...) __macroarg_count1 ( , ##Y) #define __macroarg_count1(Y...) __macroarg_count2 (Y, 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) diff --git a/libraries/libapparmor/swig/SWIG/libapparmor.i b/libraries/libapparmor/swig/SWIG/libapparmor.i index 014839a64..1f2ede323 100644 --- a/libraries/libapparmor/swig/SWIG/libapparmor.i +++ b/libraries/libapparmor/swig/SWIG/libapparmor.i @@ -2,13 +2,20 @@ %{ #include "aalogparse.h" -extern int aa_change_hat(const char *subprofile, unsigned long magic_token); -extern int aa_change_profile(const char *profile, unsigned long magic_token); +#include "apparmor.h" %} %include "typemaps.i" %include "aalogparse.h" -extern int aa_change_hat(const char *subprofile, unsigned long magic_token); -extern int aa_change_profile(const char *profile, unsigned long magic_token); + +/* swig doesn't like the macro magic we do in apparmor.h so the fn prototypes + * are manually inserted here + */ + +extern int aa_change_hat(const char *subprofile, unsigned long magic_token); +extern int aa_change_profile(const char *profile); +extern int aa_change_onexec(const char *profile); +extern int aa_change_hatv(const char *subprofiles[], unsigned long token); +extern int aa_change_hat_vargs(unsigned long token, int count, ...);