daemon/db: disabled ACL table triggers.
authorAmarnath Valluri <amarnath.valluri@linux.intel.com>
Thu, 25 Jul 2013 14:25:59 +0000 (17:25 +0300)
committerAmarnath Valluri <amarnath.valluri@linux.intel.com>
Thu, 25 Jul 2013 14:25:59 +0000 (17:25 +0300)
Removing an enty in ACL table is leading to remove linked
methods & mechanisms upon updating an identity. Which leads to break
token cache stored in secret storage for that identity + method combination.

Methods & Mechanisms should not be created/removed based on identity.
They should be some how link to existance of plugins. Till this change
effect 'delete methods/mechanisms triggers' are disabled.

configure.ac
src/daemon/db/gsignond-db-metadata-database.c

index 48297cc..e8aa740 100644 (file)
@@ -115,6 +115,13 @@ if test "x$enable_debug" = "xyes" ; then
     fi
 fi
 
+AC_ARG_ENABLE(acltriggers,
+              [  --enable-acltriggers    enable ACL before delete triggers],
+              [enable_acl_triggers=yes], [enable_acl_triggers=no])
+if test "x$enable_acl_triggers" = "xyes" ; then
+    AC_DEFINE(ENABLE_DB_ACL_TRIGGERS, [1], [Enable ACL triggers])
+fi
+
 AM_CONDITIONAL(USE_GTESTDBUS, [test x$gtestdbus = xyes])
 AC_SUBST(MESSAGE_BUS_TYPE, [$enable_dbus_type])
 
index 5584489..779738e 100644 (file)
@@ -22,6 +22,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA
  */
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <string.h>
 #include <sys/stat.h>
 
@@ -658,6 +661,7 @@ _gsignond_db_metadata_database_create (
             "    REFS.secctx_id = OLD.secctx_id) == 0;"
             "END;"
 
+#ifdef ENABLE_DB_ACL_TRIGGERS
             // Trigger for deleting orphan METHODS entries
             "CREATE TRIGGER fkdstale_ACL_method_id_METHODS_id"
             "BEFORE DELETE ON [ACL]"
@@ -675,6 +679,7 @@ _gsignond_db_metadata_database_create (
             "    AND (SELECT COUNT(*) FROM ACL WHERE "
             "    ACL.mechanism_id = OLD.mechanism_id) == 1;"
             "END;"
+#endif
 
             /*
              * triggers generated with