Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afb-auth: export method to check a single permission
[src/app-framework-binder.git]
/
src
/
afb-auth.c
diff --git
a/src/afb-auth.c
b/src/afb-auth.c
index
5c62f9f
..
17d355b
100644
(file)
--- a/
src/afb-auth.c
+++ b/
src/afb-auth.c
@@
-29,8
+29,6
@@
#include "afb-cred.h"
#include "verbose.h"
#include "afb-cred.h"
#include "verbose.h"
-static int check_permission(struct afb_xreq *xreq, const char *permission);
-
int afb_auth_check(struct afb_xreq *xreq, const struct afb_auth *auth)
{
switch (auth->type) {
int afb_auth_check(struct afb_xreq *xreq, const struct afb_auth *auth)
{
switch (auth->type) {
@@
-46,7
+44,7
@@
int afb_auth_check(struct afb_xreq *xreq, const struct afb_auth *auth)
case afb_auth_Permission:
if (xreq->cred && auth->text)
case afb_auth_Permission:
if (xreq->cred && auth->text)
- return check_permission(xreq, auth->text);
+ return
afb_auth_
check_permission(xreq, auth->text);
/* TODO: handle case of self permission */
return 1;
/* TODO: handle case of self permission */
return 1;
@@
-73,7
+71,7
@@
int afb_auth_check(struct afb_xreq *xreq, const struct afb_auth *auth)
static cynara *handle;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static cynara *handle;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
static int
check_permission(struct afb_xreq *xreq, const char *permission)
+
int afb_auth_
check_permission(struct afb_xreq *xreq, const char *permission)
{
int rc;
{
int rc;
@@
-99,7
+97,7
@@
static int check_permission(struct afb_xreq *xreq, const char *permission)
/*********************************************************************************/
#else
/*********************************************************************************/
#else
-
static int
check_permission(struct afb_xreq *xreq, const char *permission)
+
int afb_auth_
check_permission(struct afb_xreq *xreq, const char *permission)
{
WARNING("Granting permission %s by default of backend", permission);
return 1;
{
WARNING("Granting permission %s by default of backend", permission);
return 1;