if test "x${have_cynara}" = "xyes"; then
AC_DEFINE([HAVE_CYNARA], [1], [Define to 1 if you have cynara])
PEPPER_REQUIRES="$PEPPER_REQUIRES cynara-client cynara-creds-socket cynara-session libsmack"
+ PEPPER_CFLAGS+="$CYNARA_CFLAGS -DHAVE_CYNARA=1 "
+ PEPPER_LIBS+="$CYNARA_LIBS "
fi
AM_CONDITIONAL([HAVE_CYNARA], [test "x${have_cynara}" = "xyes"])
libpepper_devicemgr_includedir=$(includedir)/pepper
libpepper_devicemgr_include_HEADERS = devicemgr.h pepper-devicemgr.h
-libpepper_devicemgr_la_CFLAGS = $(AM_CFLAGS) $(PEPPER_DEVICEMGR_CFLAGS) $(CYNARA_CFLAGS)
-libpepper_devicemgr_la_LIBADD = $(PEPPER_DEVICEMGR_LIBS) $(CYNARA_LIBS)
+libpepper_devicemgr_la_CFLAGS = $(AM_CFLAGS) $(PEPPER_DEVICEMGR_CFLAGS)
+libpepper_devicemgr_la_LIBADD = $(PEPPER_DEVICEMGR_LIBS)
libpepper_devicemgr_la_SOURCES = devicemgr-internal.h \
devicemgr.c \
libpepper_keyrouter_includedir=$(includedir)/pepper
libpepper_keyrouter_include_HEADERS = keyrouter.h pepper-keyrouter.h
-libpepper_keyrouter_la_CFLAGS = $(AM_CFLAGS) $(PEPPER_KEYROUTER_CFLAGS) $(CYNARA_CFLAGS)
-libpepper_keyrouter_la_LIBADD = $(PEPPER_KEYROUTER_LIBS) $(CYNARA_LIBS)
+libpepper_keyrouter_la_CFLAGS = $(AM_CFLAGS) $(PEPPER_KEYROUTER_CFLAGS)
+libpepper_keyrouter_la_LIBADD = $(PEPPER_KEYROUTER_LIBS)
libpepper_keyrouter_la_SOURCES = keyrouter-internal.h \
keyrouter.c \
#include <cynara-client.h>
#include <cynara-creds-socket.h>
#include <sys/smack.h>
-#endif
+#include <stdarg.h>
+#include <stdio.h>
+
+#define CYNARA_BUFSIZE 128
-#ifdef HAVE_CYNARA
static cynara *g_cynara = NULL;
static int g_cynara_refcount = 0;
static int g_cynara_init_count = 0;
int ret;
va_list args;
- const int CYNARA_BUFSIZE = 128;
char buf[CYNARA_BUFSIZE] = "\0", tmp[CYNARA_BUFSIZE + CYNARA_BUFSIZE] = "\0";
if (fmt) {
snprintf(uid_str, 15, "%d", (int)uid);
client_session = cynara_session_from_pid(pid);
- PEPPER_CHECK(client_session, finish, "");
+ PEPPER_CHECK(client_session, goto finish, "");
ret = cynara_check(g_cynara,
client_smack,
if (ret == CYNARA_API_ACCESS_ALLOWED)
res = PEPPER_TRUE;
else
- _pepper_security_log_print(ret, "rule: %s, client_smack: %s, pid: %d", rule, client_smack, pid);
+ _pepper_security_log_print(ret, "privilege: %s, client_smack: %s, pid: %d", privilege, client_smack, pid);
finish:
PEPPER_TRACE("Privilege Check For '%s' %s pid:%u uid:%u client_smack:%s(len:%d) client_session:%s ret:%d",
pepper_security_init(void)
{
#ifdef HAVE_CYNARA
- int ret;
+ int ret = CYNARA_API_SUCCESS;
int retry_cnt = 0;
static pepper_bool_t retried = PEPPER_FALSE;
#ifdef HAVE_CYNARA
if (g_cynara_refcount < 1)
{
- PEPPER_ERROR("%s called without pepper_security_init");
+ PEPPER_ERROR("%s called without pepper_security_init\n", __FUNCTION__);
return 0;
}
g_cynara = NULL;
}
#endif
+
return 1;
}