summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Huerner <ingo.huerner@xse.de>2014-11-04 13:30:35 +0100
committerIngo Huerner <ingo.huerner@xse.de>2014-11-04 13:30:35 +0100
commitadbfc3e8b2fa6ab4962667624c008b36e24d7bf9 (patch)
treed70fc18a08f971918bbff479dc1ad75def270bf4
parentf60ab501f1cf35e554714f7413e3f7f461f8134c (diff)
downloadpersistence-client-library-adbfc3e8b2fa6ab4962667624c008b36e24d7bf9.tar.gz
Disable application validation in pclInitLibrary; activate this feature using --enable-appcheck in the configure step
-rw-r--r--configure.ac19
-rw-r--r--src/persistence_client_library.c6
2 files changed, 24 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 2e40aec..25d7b19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,6 +163,25 @@ fi
######################################################################
+# enable persistence application security check ###########
+AC_ARG_ENABLE([appcheck],
+ [AS_HELP_STRING([--enable-appcheck],[Enable application security check])],
+ [use_appcheck=$enableval],
+ [use_appcheck="no"])
+
+AM_CONDITIONAL([USE_APPCHECK], [test x"$use_appcheck" = "no"])
+
+if test "$use_appcheck" != "yes" -a "$use_appcheck" != "no"; then
+ AC_MSG_ERROR([Invalid application security check: $use_appcheck. Only "yes" or "no" is valid])
+else
+ AC_MSG_NOTICE([Use application security check: $use_appcheck])
+
+ if test "$use_appcheck" = "yes"; then
+ AC_DEFINE_UNQUOTED([USE_APPCHECK], [1], [application check enabled])
+ fi
+fi
+######################################################################
+
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging, default: no]),
diff --git a/src/persistence_client_library.c b/src/persistence_client_library.c
index d675695..e01a8f2 100644
--- a/src/persistence_client_library.c
+++ b/src/persistence_client_library.c
@@ -79,7 +79,8 @@ int pclInitLibrary(const char* appName, int shutdownMode)
DLT_REGISTER_CONTEXT(gPclDLTContext,"PCL","Context for persistence client library logging");
DLT_LOG(gPclDLTContext, DLT_LOG_INFO, DLT_STRING("pclInitLibrary => I N I T Persistence Client Library - "), DLT_STRING(appName),
DLT_STRING("- init counter: "), DLT_INT(gPclInitialized) );
-
+#if USE_APPCHECK
+ printf("SECURITY check enabled!!!!!\n");
/* security check for valid application:
if the RCT table exists, the application is proven to be valid,
otherwise return EPERS_NOPRCTABLE */
@@ -88,6 +89,7 @@ int pclInitLibrary(const char* appName, int shutdownMode)
if(access(rctFilename, F_OK) == 0)
{
+#endif
char blacklistPath[DbPathMaxLen] = {0};
#if USE_FILECACHE
@@ -161,11 +163,13 @@ int pclInitLibrary(const char* appName, int shutdownMode)
gAppId[MaxAppNameLen-1] = '\0';
gPclInitialized++;
+#if USE_APPCHECK
}
else
{
rval = EPERS_NOPRCTABLE;
}
+#endif
}
else if(gPclInitialized >= PCLinitialized)
{