summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-slapi-plugins/ipa-pwd-extop
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-11-03 14:44:44 +0100
committerSimo Sorce <ssorce@redhat.com>2010-11-22 16:01:35 -0500
commit5da451876e76fa8bfc04a537d30c2d3c5ef84841 (patch)
tree4eae2286dbba4424b3d0f54888c6c51efca87ad3 /daemons/ipa-slapi-plugins/ipa-pwd-extop
parentb9f539ba19b40361265c7897a73a1f5757ed0e68 (diff)
downloadfreeipa-5da451876e76fa8bfc04a537d30c2d3c5ef84841.tar.gz
freeipa-5da451876e76fa8bfc04a537d30c2d3c5ef84841.tar.xz
freeipa-5da451876e76fa8bfc04a537d30c2d3c5ef84841.zip
Common include file for SLAPI plugin logging
Consolidate the common logging macros into common/util.h and use them in SLAPI plugins instead of calling slapi_log_error() directly. https://fedorahosted.org/freeipa/ticket/408 Signed-off-by: Simo Sorce <ssorce@redhat.com>
Diffstat (limited to 'daemons/ipa-slapi-plugins/ipa-pwd-extop')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am3
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h21
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c1
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c1
6 files changed, 8 insertions, 20 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
index 6358eceb..3577e48c 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am
@@ -1,8 +1,11 @@
NULL =
+PLUGIN_COMMON_DIR=../common
+
INCLUDES = \
-I. \
-I$(srcdir) \
+ -I$(PLUGIN_COMMON_DIR) \
-DPREFIX=\""$(prefix)"\" \
-DBINDIR=\""$(bindir)"\" \
-DLIBDIR=\""$(libdir)"\" \
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
index ed9637a0..8df766e0 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
@@ -38,6 +38,7 @@
* END COPYRIGHT BLOCK **/
#include "ipapwd.h"
+#include "util.h"
/*
* Password Modify - LDAP Extended Operation.
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h
index 5b15622f..523934cc 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h
@@ -64,26 +64,7 @@
#define IPAPWD_FEATURE_DESC "IPA Password Manager"
#define IPAPWD_PLUGIN_DESC "IPA Password Extended Operation plugin"
-#ifndef discard_const
-#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
-#endif
-
-#define log_func discard_const(__func__)
-
-#define LOG(fmt, ...) \
- slapi_log_error(SLAPI_LOG_PLUGIN, \
- IPAPWD_PLUGIN_NAME, \
- fmt, ##__VA_ARGS__)
-
-#define LOG_FATAL(fmt, ...) \
- slapi_log_error(SLAPI_LOG_FATAL, log_func, \
- "[file %s, line %d]: " fmt, \
- __FILE__, __LINE__, ##__VA_ARGS__)
-
-#define LOG_TRACE(fmt, ...) \
- slapi_log_error(SLAPI_LOG_TRACE, log_func, fmt, ##__VA_ARGS__)
-
-#define LOG_OOM() LOG_FATAL("Out of Memory!\n")
+#define IPA_PLUGIN_NAME IPAPWD_PLUGIN_NAME
#define IPAPWD_CHECK_CONN_SECURE 0x00000001
#define IPAPWD_CHECK_DN 0x00000002
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c
index 514274e7..92c388a2 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c
@@ -38,6 +38,7 @@
* END COPYRIGHT BLOCK **/
#include "ipapwd.h"
+#include "util.h"
/* Type of connection for this operation;*/
#define LDAP_EXTOP_PASSMOD_CONN_SECURE
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c
index 527e178f..45135016 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c
@@ -53,6 +53,7 @@
#include <time.h>
#include "ipapwd.h"
+#include "util.h"
/* krbTicketFlags */
#define KTF_DISALLOW_POSTDATED 0x00000001
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c
index 6636d611..44b280bf 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_prepost.c
@@ -53,6 +53,7 @@
#include <time.h>
#include "ipapwd.h"
+#include "util.h"
#define IPAPWD_OP_NULL 0
#define IPAPWD_OP_ADD 1