comments and format fixes
This patch applies on the previous 2 and adds comments and fixes some formatting as discussed on list. BTW, I've never heard any authoritative style preferences for this repository. While I agree with these particular changes (* going with var rather than type) clearly not everyone does (such as the original author of that code) and I'd prefer not to make subjective/arbitrary style changes without some input on what the upstream preferred style is.
libsepol/include/sepol/handle.h +3 -3
@@ -3,7 +3,7 @@struct sepol_handle ;typedef struct sepol_handle sepol_handle_t ; -typedef void (*sepol_handle_callback_fn_t ) (void * varg,sepol_handle_t * handle,const char * fmt, ...); +typedef void (*sepol_handle_callback_fn_t ) (void *varg,sepol_handle_t *handle,const char *fmt, ...);/* Create and return a sepol handle. */ extern sepol_handle_t *sepol_handle_create (void );
@@ -12,13 +12,13 @@extern void sepol_handle_set_callback (sepol_handle_t *h,sepol_handle_callback_fn_t fn,void *varg);/* Call the callback for a sepol handle */ -extern void sepol_handle_do_callback (sepol_handle_t * handle,const char * fmt, ...); +extern void sepol_handle_do_callback (sepol_handle_t *handle,const char *fmt, ...);/* Get the severity level of the last message */ extern int sepol_handle_get_level (sepol_handle_t *h);/* Destroy a sepol handle. */ -extern void sepol_handle_destroy (sepol_handle_t *); +extern void sepol_handle_destroy (sepol_handle_t *h);#endif
libsepol/include/sepol/policydb/expand.h +28 -15
57 lines not on this page · raw message
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines
From: Stephen Smalley [mailto:[email protected]]
Quoted 1 line · Joshua Brindle
This patch applies on the previous 2 and adds comments and
fixes some
Quoted 4 lines
formatting as discussed on list. BTW, I've never heard any authoritative style preferences for this repository. While I agree with these particular changes (* going with var rather than type) clearly not everyone does (such as the original author of
Quoted 8 lines
that code)
Quoted 1 line
and I'd prefer not to make subjective/arbitrary style
changes without
Quoted 1 line
some input on what the upstream preferred style is.
Personally, I prefer that as well, but we did apply Lindent to the entire tree, so it seems best to stay with its style...
I don't think lindent changes where the * is, since its like that all over the repo still..
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Joshua Brindle
This patch applies on the previous 2 and adds comments and fixes some formatting as discussed on list. BTW, I've never heard any authoritative style preferences for this repository. While I agree with these particular changes (* going with var rather than type) clearly not everyone does (such as the original author of that code) and I'd prefer not to make subjective/arbitrary style changes without some input on what the upstream preferred style is.
Personally, I prefer that as well, but we did apply Lindent to the entire tree, so it seems best to stay with its style...
Quoted 93 lines
Index:
libsepol/include/sepol/handle.h
===================================================================libsepol/include/sepol/handle.h +3
-3@@ -3,7 +3,7 @@struct sepol_handle ;typedef struct sepol_handle sepol_handle_t ; -typedef void (*sepol_handle_callback_fn_t ) (void * varg,sepol_handle_t * handle,const char * fmt, ...); +typedef void (*sepol_handle_callback_fn_t ) (void *varg,sepol_handle_t *handle,const char *fmt, ...);/* Create and return a sepol handle. */ extern sepol_handle_t *sepol_handle_create (void );@@ -12,13 +12,13 @@extern void sepol_handle_set_callback (sepol_handle_t *h,sepol_handle_callback_fn_t fn,void *varg);/* Call the callback for a sepol handle */ -extern void sepol_handle_do_callback (sepol_handle_t * handle,const char * fmt, ...); +extern void sepol_handle_do_callback (sepol_handle_t *handle,const char *fmt, ...);/* Get the severity level of the last message */ extern int sepol_handle_get_level (sepol_handle_t *h);/* Destroy a sepol handle. */ -extern void sepol_handle_destroy (sepol_handle_t *); +extern void sepol_handle_destroy (sepol_handle_t *h);#endif Index:
libsepol/include/sepol/policydb/expand.h
===================================================================libsepol/include/sepol/policydb/expand.h +28
-15@@ -29,29 +29,42 @@#include <sepol/handle.h> #include <sepol/policydb/conditional.h> +/* +* Expand only the avrules for a module (optionally including +* neverallow rules). It is valid for this function to expand +* base into itself (i.e. base == out); the typemap for this +* special case should map type[i] to i+1. No assertion or +* hierarchy checking is performed. +*/ extern int expand_module_avrules (sepol_handle_t *handle,policydb_t *base,policydb_t *out,uint32_t *typemap,int verbose,int expand_neverallow); -extern int expand_module (sepol_handle_t * handle, -policydb_t * base,policydb_t * out, +/* +* Expand all parts of a module. Neverallow rules are not +* expanded (only copied). It is not valid to expand base +* into itself. If check is non-zero, performs hierarchy +* and assertion checking. +*/ +extern int expand_module (sepol_handle_t *handle, +policydb_t *base,policydb_t *out,int verbose,int check); -extern int convert_type_ebitmap (ebitmap_t * src,ebitmap_t * dst, -uint32_t * typemap); -extern int expand_convert_type_set (policydb_t * p,uint32_t * typemap, -type_set_t * set,ebitmap_t * types, +extern int convert_type_ebitmap (ebitmap_t *src,ebitmap_t *dst, +uint32_t *typemap); +extern int expand_convert_type_set (policydb_t *p,uint32_t *typemap, +type_set_t *set,ebitmap_t *types,unsigned char alwaysexpand); -extern int type_set_expand (type_set_t * set,ebitmap_t * t,policydb_t * p, +extern int type_set_expand (type_set_t * set,ebitmap_t *t,policydb_t *p,unsigned char alwaysexpand); -extern int role_set_expand (role_set_t * x,ebitmap_t * r,policydb_t * p); -extern int expand_rule (sepol_handle_t * handle, -policydb_t * source_pol, -avrule_t * source_rule,avtab_t * dest_avtab, -cond_av_list_t ** cond,cond_av_list_t ** other, +extern int role_set_expand (role_set_t *x,ebitmap_t *r,policydb_t *p); +extern int expand_rule (sepol_handle_t *handle, +policydb_t *source_pol, +avrule_t *source_rule,avtab_t *dest_avtab, +cond_av_list_t **cond,cond_av_list_t **other,int enabled); -extern int expand_avtab (policydb_t * p,avtab_t * a,avtab_t * expa); +extern int expand_avtab (policydb_t *p,avtab_t *a,avtab_t *expa); -extern int expand_cond_av_list (policydb_t * p,cond_av_list_t * l, -cond_av_list_t ** newl,avtab_t * expa); +extern int expand_cond_av_list (policydb_t *p,cond_av_list_t *l, +cond_av_list_t **newl,avtab_t *expa);#endif
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 12 lines · Joshua Brindle
Quoted 12 lines
From: Stephen Smalley [mailto:[email protected]]
Quoted 1 line · Joshua Brindle
This patch applies on the previous 2 and adds comments and
fixes some
Quoted 4 lines
formatting as discussed on list. BTW, I've never heard any authoritative style preferences for this repository. While I agree with these particular changes (* going with var rather than type) clearly not everyone does (such as the original author of
that code)
Quoted 1 line
and I'd prefer not to make subjective/arbitrary style
changes without
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
some input on what the upstream preferred style is.
Personally, I prefer that as well, but we did apply Lindent to the entire tree, so it seems best to stay with its style...
I don't think lindent changes where the * is, since its like that all over the repo still..
It appears to move it, but the behavior varies depending on whether you use a typedef'd type or not.
Before:
extern void f(int* a, struct foo* b, uint32_t* c);
After:
extern void f(int *a, struct foo *b, uint32_t * c);
Moral of the story: Don't use typedefs ;)
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.