system context "sysctx"],
[enable_keychain=$enableval])
if test "x$enable_keychain" != "x" ; then
- AC_DEFINE_UNQUOTED(KEYCHAIN_SYSCTX, ["$enable_keychain"], [Keychain system context])
- AC_SUBST(KEYCHAIN_SYSCTX, ["#KeychainSystemContext = $enable_keychain"])
+ AC_DEFINE_UNQUOTED(KEYCHAIN_SYSCTX,
+ ["$enable_keychain"],
+ [Keychain system context])
+ AC_SUBST(KEYCHAIN_SYSCTX,
+ ["#KeychainSystemContext = $enable_keychain"])
else
- AC_SUBST(KEYCHAIN_SYSCTX, ["#KeychainSystemContext = \"\""])
+ AC_SUBST(KEYCHAIN_SYSCTX,
+ ["#KeychainSystemContext = \"\""])
fi
+AC_ARG_ENABLE(storagedir,
+ [ --enable-storagedir=path
+ enable storage at location "path"
+ instead of default "/var/db"],
+ [enable_storagedir=$enableval],
+ [enable_storagedir="/var/db"])
+AC_DEFINE_UNQUOTED(BASE_STORAGE_DIR,
+ ["$enable_storagedir"],
+ [Base path for user specific storage directories])
+AC_SUBST(BASE_STORAGE_DIR,
+ ["#StoragePath = $enable_storagedir"])
+
AC_ARG_ENABLE(debug,
[ --enable-debug enable debug features],
[enable_debug=yes], [enable_debug=no])
through config.h.
</para>
</formalpara>
+
+ <formalpara>
+ <title><systemitem>--enable-storagedir=path</systemitem></title>
+
+ <para>
+ Sets the base path for user specific storage directories where
+ database files will be located.
+ Default location is <filename>/var/db</filename>
+ </para>
+ </formalpara>
</refsect1>
<refsect1 id="building-packages">
<title>GSignond configuration</title>
<xi:include href="xml/gsignond-config.xml"/>
<xi:include href="xml/gsignond-config-general.xml"/>
- <xi:include href="xml/gsignond-config-db.xml"/>
<xi:include href="xml/gsignond-config-dbus.xml"/>
</chapter>
#
[General]
-# Directory for binary executables.
-#BinDir =
-#
# Define extension / platform adaptation module to use.
# 'default' is a dummy one with no encrypted storage, but with basic Unix
# discretionary access control.
#Extension = default
#
-# Extension directory where extension modules are located.
-#ExtensionsDir =
-#
# Base path where user specific database directories will be located.
-# Default: /var/db
-#StoragePath =
-#
-# Location for authentication plugins.
-#PluginDir =
+@BASE_STORAGE_DIR@
#
# Timeout for unloading cached plugin instances.
#PluginTimeout = 0
@KEYCHAIN_SYSCTX@
#
-# Database related settings.
-#
-[Storage]
-
-# File name for the metadata database. (excluding path)
-#MetadataDBFilename = metadata.db
-#
-# File name for the credential database. (excluding path)
-#SecretDBFilename = secret.db
-
-#
# D-Bus related settings.
#
[ObjectTimeouts]
+++ /dev/null
-/* vi: set et sw=4 ts=4 cino=t0,(0: */
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of gsignond
- *
- * Copyright (C) 2012 Intel Corporation.
- *
- * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-#ifndef __GSIGNOND_CONFIG_DB_H_
-#define __GSIGNOND_CONFIG_DB_H_
-
-/**
- * SECTION:gsignond-config-db
- * @title: Database configuration
- * @short_description: gSSO database configuration keys
- * @include: gsignond/gsignond-config.h
- *
- * Database configuration keys are defined below. See #GSignondConfig for how to use them.
- */
-
-/**
- * GSIGNOND_CONFIG_DB_SSO:
- *
- * A prefix for database keys. Should be used only when defining new keys.
- */
-#define GSIGNOND_CONFIG_DB_SSO "Storage"
-/**
- * GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME:
- *
- * The filename of the credentials database.
- *
- * Default value: "secret.db".
- */
-#define GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME GSIGNOND_CONFIG_DB_SSO \
- "/SecretDBFilename"
-/**
- * GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME:
- *
- * The filename of the metadata database.
- *
- * Default value: "metadata.db".
- */
-#define GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME GSIGNOND_CONFIG_DB_SSO \
- "/MetadataDBFilename"
-
-#endif /* __GSIGNOND_DB_CONFIG_H_ */
* A prefix for general keys. Should be used only when defining new keys.
*/
#define GSIGNOND_CONFIG_GENERAL "General"
+
/**
* GSIGNOND_CONFIG_GENERAL_STORAGE_PATH:
*
#define GSIGNOND_CONFIG_GENERAL_STORAGE_PATH GSIGNOND_CONFIG_GENERAL \
"/StoragePath"
/**
- * GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR:
- *
- * The path where gSSO is looking for available extension modules.
- *
- * Default value: $(pkglibdir)/extensions, can be overriden in debug
- * builds by setting SSO_EXTENSIONS_DIR environment variable.
- */
-#define GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR GSIGNOND_CONFIG_GENERAL \
- "/ExtensionsDir"
-/**
- * GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR:
- *
- * The path where gSSO is looking for available plugins.
- *
- * Default value: $(pkglibdir)/plugins, can be overriden in debug
- * builds by setting SSO_PLUGINS_DIR environment variable.
- */
-#define GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR GSIGNOND_CONFIG_GENERAL \
- "/PluginsDir"
-/**
- * GSIGNOND_CONFIG_GENERAL_BIN_DIR:
- *
- * The path where gSSO is looking for the gsignond-plugind binary when it needs
- * to start a plugin process. Can be used for finding other supplementary binaries in
- * the future.
- *
- * Default value: $(bindir), can be overriden in debug
- * builds by setting SSO_BIN_DIR environment variable.
- */
-#define GSIGNOND_CONFIG_GENERAL_BIN_DIR GSIGNOND_CONFIG_GENERAL \
- "/BinDir"
-/**
* GSIGNOND_CONFIG_GENERAL_EXTENSION:
*
* The name of the gSSO extension to use. If not specified, the default
*
* Path provided by #GSignondStorageManager for storing user-specific
* information, including secret and metadata databases.
+ *
+ * This is run-time value and any value read from configuration file
+ * is overwritten.
*
* Value provided by the default implementation:
* #GSIGNOND_CONFIG_GENERAL_STORAGE_PATH + "/gsignond." + g_get_user_name().
#include <glib-object.h>
#include "gsignond-config-general.h"
-#include "gsignond-config-db.h"
#include "gsignond-config-dbus.h"
G_BEGIN_DECLS
-I. \
$(GSIGNOND_CFLAGS) \
-DGSIGNOND_PLUGINS_DIR='"$(pluginsdir)"' \
- -DGSIGNOND_EXTENSIONS_DIR='"$(extensionsdir)"' \
-DGSIGNOND_BIN_DIR='"$(bindir)"' \
-DGSIGNOND_SYSCONF_DIR='"$(sysconfdir)"' \
$(NULL)
#include "gsignond/gsignond-log.h"
#include "gsignond/gsignond-secret-storage.h"
+#define GSIGNOND_SECRET_DB_FILENAME "secret.db"
+
/**
* SECTION:gsignond-secret-storage
* @short_description: provides access to the database that stores user credentials and identity/method cache
_open_db (GSignondSecretStorage *self)
{
const gchar *dir = NULL;
- const gchar *filename = NULL;
gchar *db_filename = NULL;
gboolean ret = FALSE;
ERR ("No directory specified in config object for secret db...");
return FALSE;
}
- filename = gsignond_config_get_string (self->config,
- GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME);
- if (!filename) {
- ERR ("Database filename not specified");
- return FALSE;
- }
- db_filename = g_build_filename (dir, filename, NULL);
+ db_filename = g_build_filename (dir, GSIGNOND_SECRET_DB_FILENAME, NULL);
if (!db_filename) {
ERR ("Invalid db filename...");
return FALSE;
*
* Opens (and initializes) the database. The implementation should take
* care of creating the DB, if it doesn't exist, and it should use
- * #GSIGNOND_CONFIG_GENERAL_SECURE_DIR and #GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME
+ * #GSIGNOND_CONFIG_GENERAL_SECURE_DIR
* to determine database location in the filesystem.
*
* The default implementation is using SQLite for the storage.
#include "gsignond/gsignond-config.h"
#include "gsignond/gsignond-config-general.h"
-#include "gsignond/gsignond-config-db.h"
#include "gsignond/gsignond-config-dbus.h"
#include "gsignond/gsignond-log.h"
#include "gsignond/gsignond-dictionary.h"
*/
-#define GSIGNOND_DB_METADATA_DEFAULT_DB_FILENAME "metadata.db"
-#define GSIGNOND_DB_SECRET_DEFAULT_DB_FILENAME "secret.db"
-
struct _GSignondConfigPrivate
{
gchar *config_file_path;
G_DEFINE_TYPE (GSignondConfig, gsignond_config, G_TYPE_OBJECT);
-
-static void
-_set_storage_path (GSignondConfig *self, const gchar *value)
-{
- gchar *storage_path = g_build_filename (value,
- "gsignond.general",
- NULL);
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_STORAGE_PATH,
- storage_path);
- g_free (storage_path);
-}
-
static gboolean
_load_config (GSignondConfig *self)
{
INFO ("found config : '%s/%s' - '%s'", groups[i], keys[j], value);
- /* construct a full storage path for wipe safety */
- if (g_strcmp0 (key, GSIGNOND_CONFIG_GENERAL_STORAGE_PATH) == 0)
- _set_storage_path (self, value);
- else
- gsignond_config_set_string (self, key, value);
-
g_free (key);
g_free (value);
}
return TRUE;
}
-#ifdef ENABLE_DEBUG
-static void
-_load_environment (GSignondConfig *self)
-{
- const gchar *e_val = 0;
- guint timeout = 0;
-
- e_val = g_getenv ("SSO_DAEMON_TIMEOUT");
- if (e_val && (timeout = atoi(e_val)))
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_DBUS_DAEMON_TIMEOUT,
- e_val);
-
- e_val = g_getenv ("SSO_IDENTITY_TIMEOUT");
- if (e_val && (timeout = atoi(e_val)))
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_DBUS_IDENTITY_TIMEOUT,
- e_val);
-
- e_val = g_getenv ("SSO_AUTH_SESSION_TIMEOUT");
- if (e_val && (timeout = atoi(e_val)))
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_DBUS_AUTH_SESSION_TIMEOUT,
- e_val);
-
- e_val = g_getenv ("SSO_PLUGIN_TIMEOUT");
- if (e_val && (timeout = atoi(e_val)))
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_PLUGIN_TIMEOUT,
- e_val);
-
- e_val = g_getenv ("SSO_PLUGINS_DIR");
- if (e_val)
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR,
- e_val);
-
- e_val = g_getenv ("SSO_EXTENSIONS_DIR");
- if (e_val)
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR,
- e_val);
-
- e_val = g_getenv ("SSO_BIN_DIR");
- if (e_val)
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_BIN_DIR,
- e_val);
-
- e_val = g_getenv ("SSO_EXTENSION");
- if (e_val)
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_EXTENSION,
- e_val);
-
- e_val = g_getenv ("SSO_STORAGE_PATH");
- if (e_val)
- _set_storage_path (self, e_val);
-}
-#endif /* ENABLE_DEBUG */
-
/**
* gsignond_config_get_integer:
* @self: an instance of #GSignondConfig
self->priv->config_file_path = NULL;
self->priv->config_table = gsignond_dictionary_new();
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR,
- (GSIGNOND_PLUGINS_DIR));
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR,
- (GSIGNOND_EXTENSIONS_DIR));
- gsignond_config_set_string (self,
- (GSIGNOND_CONFIG_GENERAL_BIN_DIR),
- (GSIGNOND_BIN_DIR));
-
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_GENERAL_STORAGE_PATH,
- "/var/db");
-
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_DB_SECRET_DB_FILENAME,
- GSIGNOND_DB_SECRET_DEFAULT_DB_FILENAME);
- gsignond_config_set_string (self,
- GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME,
- GSIGNOND_DB_METADATA_DEFAULT_DB_FILENAME);
-
if (!_load_config (self))
WARN ("load configuration failed, using default settings");
-# ifdef ENABLE_DEBUG
- _load_environment (self);
-# endif
}
static void
#include <gmodule.h>
+#include "config.h"
+
#include "gsignond/gsignond-log.h"
#include "gsignond-plugin-loader.h"
GSignondConfig* config,
gchar* plugin_type)
{
- gchar* plugin_filename = g_module_build_path (
- gsignond_config_get_string (config,
- GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), plugin_type);
- GSignondPlugin *plugin = gsignond_load_plugin_with_filename (plugin_type,
- plugin_filename);
+ const gchar *plugin_path = GSIGNOND_PLUGINS_DIR;
+ gchar *plugin_filename;
+ GSignondPlugin *plugin;
+
+# ifdef ENABLE_DEBUG
+ const gchar *env_val = g_getenv("SSO_PLUGINS_DIR");
+ if (env_val)
+ plugin_path = env_val;
+# endif
+ plugin_filename = g_module_build_path (plugin_path, plugin_type);
+ plugin = gsignond_load_plugin_with_filename (plugin_type,
+ plugin_filename);
g_free(plugin_filename);
return plugin;
}
#include <glib/gstdio.h>
+#include "config.h"
+
#include "gsignond/gsignond-log.h"
#include "gsignond/gsignond-storage-manager.h"
#include "gsignond/gsignond-utils.h"
const gchar *storage_path = gsignond_config_get_string (
self->config,
GSIGNOND_CONFIG_GENERAL_STORAGE_PATH);
- if (storage_path)
- self->location = g_build_filename (storage_path,
- user_dir,
- NULL);
- else
- self->location = g_build_filename ("/var/db",
- user_dir,
- NULL);
+ if (!storage_path)
+ storage_path = BASE_STORAGE_DIR;
+# ifdef ENABLE_DEBUG
+ const gchar *env_val = g_getenv("SSO_STORAGE_PATH");
+ if (env_val)
+ storage_path = env_val;
+# endif
+ self->location = g_build_filename (storage_path, user_dir, NULL);
g_free (user_dir);
DBG ("secure dir %s", self->location);
}
gsignond_pubhdr = ../../include/gsignond
gsignond_include_HEADERS = \
$(gsignond_pubhdr)/gsignond-access-control-manager.h \
- $(gsignond_pubhdr)/gsignond-config-db.h \
$(gsignond_pubhdr)/gsignond-config-dbus.h \
$(gsignond_pubhdr)/gsignond-config-general.h \
$(gsignond_pubhdr)/gsignond-config.h \
-I$(top_builddir) \
-I$(top_srcdir)/include/ \
-I$(top_srcdir)/src/ \
+ -DGSIGNOND_EXTENSIONS_DIR='"$(extensionsdir)"' \
$(GSIGNOND_CFLAGS) \
$(NULL)
#include "common/db/gsignond-db-error.h"
#include "gsignond-db-metadata-database.h"
+#define GSIGNOND_METADATA_DB_FILENAME "metadata.db"
+
#define RETURN_IF_NOT_OPEN(obj, retval) \
if (gsignond_db_sql_database_is_open (obj) == FALSE) { \
GError* last_error = gsignond_db_create_error( \
gboolean
gsignond_db_metadata_database_open (GSignondDbMetadataDatabase *self)
{
- const gchar *filename = NULL;
-
g_return_val_if_fail (GSIGNOND_DB_IS_METADATA_DATABASE (self), FALSE);
if (gsignond_db_sql_database_is_open (GSIGNOND_DB_SQL_DATABASE (self)))
return TRUE;
- filename = gsignond_config_get_string (self->config,
- GSIGNOND_CONFIG_DB_METADATA_DB_FILENAME);
-
return _gsignond_db_metadata_database_open (
- GSIGNOND_DB_SQL_DATABASE (self), filename,
+ GSIGNOND_DB_SQL_DATABASE (self),
+ GSIGNOND_METADATA_DB_FILENAME,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
}
* 02110-1301 USA
*/
-#include "gsignond-daemon.h"
-
#include <gmodule.h>
+#include "config.h"
+
+#include "gsignond-daemon.h"
+
#include "gsignond/gsignond-config.h"
#include "gsignond/gsignond-log.h"
#include "gsignond/gsignond-error.h"
{
gboolean res = TRUE;
gboolean symfound;
- const gchar *ext_path;
+ const gchar *ext_path = GSIGNOND_EXTENSIONS_DIR;
const gchar *ext_name;
gchar *mod_name;
gchar *mod_filename;
gchar *initf_name;
GSignondExtension* (*ext_init) (void);
- ext_path = gsignond_config_get_string (self->priv->config,
- GSIGNOND_CONFIG_GENERAL_EXTENSIONS_DIR);
+# ifdef ENABLE_DEBUG
+ const gchar *env_val = g_getenv ("SSO_EXTENSIONS_DIR");
+ if (env_val)
+ ext_path = env_val;
+# endif
ext_name = gsignond_config_get_string (self->priv->config,
GSIGNOND_CONFIG_GENERAL_EXTENSION);
if (ext_name && !ext_path) return FALSE;
-I$(top_srcdir)/src \
-I$(top_srcdir)/include \
-I$(top_builddir)/src \
+ -DGSIGNOND_BIN_DIR='"$(bindir)"' \
+ -DGSIGNOND_PLUGINS_DIR='"$(pluginsdir)"' \
$(GSIGNOND_CFLAGS)
libgsignond_plugins_la_LIBADD = \
#include <string.h>
#include <stdio.h>
+#include "config.h"
+
#include "gsignond/gsignond-log.h"
#include "common/gsignond-plugin-loader.h"
#include "gsignond-plugin-proxy-factory.h"
static void _enumerate_plugins(GSignondPluginProxyFactory* self)
{
- GDir* plugin_dir = g_dir_open(gsignond_config_get_string (self->config,
- GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), 0, NULL);
+ const gchar *plugin_path = GSIGNOND_PLUGINS_DIR;
+
+# ifdef ENABLE_DEBUG
+ const gchar *env_val = g_getenv("SSO_PLUGINS_DIR");
+ if (env_val)
+ plugin_path = env_val;
+# endif
+ GDir* plugin_dir = g_dir_open(plugin_path, 0, NULL);
if (plugin_dir == NULL) {
WARN ("plugin directory empty");
return;
self->methods = g_malloc0(sizeof(gchar*) * (n_plugins + 1));
- DBG ("enumerate plugins in %s (factory=%p)",
- gsignond_config_get_string (self->config,
- GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR),
- self
- );
+ DBG ("enumerate plugins in %s (factory=%p)", plugin_path, self);
gchar **method_iter = self->methods;
while (1) {
const gchar* plugin_soname = g_dir_read_name(plugin_dir);
* 02110-1301 USA
*/
+#include "config.h"
+
#include "gsignond/gsignond-log.h"
#include "gsignond/gsignond-error.h"
#include "gsignond/gsignond-plugin-interface.h"
GSignondPluginRemote *plugin = NULL;
GSignondPipeStream *stream = NULL;
gboolean ret = FALSE;
+ const gchar *bin_path = GSIGNOND_BIN_DIR;
+ const gchar *plugin_path = GSIGNOND_PLUGINS_DIR;
+
+# ifdef ENABLE_DEBUG
+ const gchar *env_val = g_getenv("SSO_BIN_DIR");
+ if (env_val)
+ bin_path = env_val;
+ env_val = g_getenv("SSO_PLUGINS_DIR");
+ if (env_val)
+ plugin_path = env_val;
+# endif
/* This guarantees that writes to a pipe will never cause
* a process terminanation via SIGPIPE, and instead a proper
/* Spawn child process */
argv = g_malloc0 ((3 + 1) * sizeof (gchar *));
- argv[0] = g_build_filename (gsignond_config_get_string (config,
- GSIGNOND_CONFIG_GENERAL_BIN_DIR), GSIGNOND_PLUGIND_NAME, NULL);
- argv[1] = g_module_build_path (gsignond_config_get_string (config,
- GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), plugin_type);
+ argv[0] = g_build_filename (bin_path, GSIGNOND_PLUGIND_NAME, NULL);
+ argv[1] = g_module_build_path (plugin_path, plugin_type);
argv[2] = g_strdup(plugin_type);
ret = g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_DO_NOT_REAP_CHILD, NULL,
#include <mntent.h>
#include <ecryptfs.h>
+#include "config.h"
+
#include "tizen-storage-manager.h"
#include "gsignond/gsignond-log.h"
#include "gsignond/gsignond-utils.h"
gchar *user_dir = g_strdup_printf ("gsignond.%s", g_get_user_name ());
const gchar *storage_path = gsignond_config_get_string (
- config,
+ parent->config,
GSIGNOND_CONFIG_GENERAL_STORAGE_PATH);
- if (storage_path)
- parent->location = g_build_filename (storage_path,
- user_dir,
- NULL);
- else
- parent->location = g_build_filename ("/var/db",
- user_dir,
- NULL);
+ if (!storage_path)
+ storage_path = BASE_STORAGE_DIR;
+# ifdef ENABLE_DEBUG
+ const gchar *env_val = g_getenv("SSO_STORAGE_PATH");
+ if (env_val)
+ storage_path = env_val;
+# endif
+ parent->location = g_build_filename (storage_path, user_dir, NULL);
g_free (user_dir);
self->priv->cdir = g_strdup_printf ("%s.efs", parent->location);
DBG ("location %s encryption point %s", parent->location, self->priv->cdir);
fail_if(exe_name == NULL);
fail_if (g_setenv ("G_MESSAGES_DEBUG", "all", TRUE) == FALSE);
- fail_if (g_setenv ("SSO_IDENTITY_TIMEOUT", "5", TRUE) == FALSE);
- fail_if (g_setenv ("SSO_DAEMON_TIMEOUT", "5", TRUE) == FALSE);
- fail_if (g_setenv ("SSO_AUTH_SESSION_TIMEOUT", "5", TRUE) == FALSE);
+ fail_if (g_setenv ("GSIGNOND_CONFIG", "daemontest.conf", TRUE) == FALSE);
fail_if (g_setenv ("SSO_STORAGE_PATH", "/tmp/gsignond", TRUE) == FALSE);
fail_if (g_setenv ("SSO_KEYCHAIN_SYSCTX", exe_name, TRUE) == FALSE);
- fail_if (g_setenv ("SSO_PLUGIN_TIMEOUT", "5", TRUE) == FALSE);
DBG ("Programe pid %d, name : %s\n", getpid(), exe_name);
free(exe_name);
--- /dev/null
+#
+# This group contains top-level settings.
+#
+[General]
+
+# Define extension / platform adaptation module to use.
+# 'default' is a dummy one with no encrypted storage, but with basic Unix
+# discretionary access control.
+#Extension = default
+#
+# Base path where user specific database directories will be located.
+#StoragePath = /tmp/gsignond
+#
+# Timeout for unloading cached plugin instances.
+PluginTimeout = 5
+#
+# System security context of the keychain UI
+#KeychainSystemContext = ""
+
+#
+# D-Bus related settings.
+#
+[ObjectTimeouts]
+
+# Timeout for the daemon. Daemon will exit after specified idle time.
+DaemonTimeout = 5
+#
+# Timeout for the identity objects.
+IdentityTimeout = 5
+#
+# Timeout for the authentication session objects.
+AuthSessionTimeout = 5
+
GSignondConfig *config = NULL;
/* CASE 1: proxy timeout disabled */
- g_setenv ("SSO_PLUGIN_TIMEOUT", "0", TRUE);
-
config = gsignond_config_new();
fail_if(config == NULL);
+ gsignond_config_set_integer (config, GSIGNOND_CONFIG_PLUGIN_TIMEOUT, 0);
- factory = gsignond_plugin_proxy_factory_new ( config);
+ factory = gsignond_plugin_proxy_factory_new (config);
fail_if (factory == NULL);
proxy1 = gsignond_plugin_proxy_factory_get_plugin (factory, "ssotest");
g_object_unref (factory);
/* CASE 2: proxy timeout enbled */
- g_setenv ("SSO_PLUGIN_TIMEOUT", "1", TRUE);
-
config = gsignond_config_new();
fail_if(config == NULL);
+ gsignond_config_set_integer (config, GSIGNOND_CONFIG_PLUGIN_TIMEOUT, 1);
factory = gsignond_plugin_proxy_factory_new (config);
fail_if (factory == NULL);
g_object_unref(factory);
/* CASE 3: proxy timeout enable - request recently closed plugin */
- g_setenv ("SSO_PLUGIN_TIMEOUT", "2", TRUE);
config = gsignond_config_new ();
fail_if (config == NULL);
+ gsignond_config_set_integer (config, GSIGNOND_CONFIG_PLUGIN_TIMEOUT, 2);
factory = gsignond_plugin_proxy_factory_new(config);
fail_if (factory == NULL);
GSignondPluginDaemon *daemon = NULL;
const gchar *plugin_type = "password";
- GSignondConfig* config = gsignond_config_new ();
- fail_if(config == NULL);
+ const gchar *plugin_dir = g_getenv("SSO_PLUGINS_DIR");
+ fail_if (plugin_dir == NULL);
- gchar *plugin_path = g_module_build_path (gsignond_config_get_string (
- config, GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), "nonexisting");
+ gchar *plugin_path = g_module_build_path (plugin_dir, "nonexisting");
fail_if (plugin_path == NULL);
daemon = gsignond_plugin_daemon_new (plugin_path, "nonexisting", 0, 1);
g_free (plugin_path);
fail_if (daemon != NULL);
- plugin_path = g_module_build_path (gsignond_config_get_string (
- config, GSIGNOND_CONFIG_GENERAL_PLUGINS_DIR), plugin_type);
+ plugin_path = g_module_build_path (plugin_dir, plugin_type);
fail_if (plugin_path == NULL);
daemon = gsignond_plugin_daemon_new (plugin_path, plugin_type, 0, 1);
g_free (plugin_path);
fail_if (daemon == NULL);
g_object_unref (daemon);
daemon = NULL;
- g_object_unref(config);
}
END_TEST