summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2012-02-02 09:05:40 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-02-06 08:25:22 -0500
commit2d0550acbe07024d034fb616c1ec5b81929c4844 (patch)
tree9aac97e66e59313400936f52b0635f9e716896cd
parent16dff70ac66222e3b457790443cb283b1486e59e (diff)
downloadsssd-2d0550acbe07024d034fb616c1ec5b81929c4844.tar.gz
sssd-2d0550acbe07024d034fb616c1ec5b81929c4844.tar.bz2
sssd-2d0550acbe07024d034fb616c1ec5b81929c4844.zip
Add session target in data provider
-rw-r--r--src/confdb/confdb.h1
-rw-r--r--src/config/SSSDConfig.py1
-rwxr-xr-xsrc/config/SSSDConfigTest.py6
-rw-r--r--src/config/etc/sssd.api.conf1
-rw-r--r--src/providers/data_provider_be.c20
-rw-r--r--src/providers/dp_backend.h1
6 files changed, 27 insertions, 3 deletions
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 6aa457a4..ce9f3763 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -114,6 +114,7 @@
#define CONFDB_DOMAIN_CHPASS_PROVIDER "chpass_provider"
#define CONFDB_DOMAIN_SUDO_PROVIDER "sudo_provider"
#define CONFDB_DOMAIN_AUTOFS_PROVIDER "autofs_provider"
+#define CONFDB_DOMAIN_SESSION_PROVIDER "session_provider"
#define CONFDB_DOMAIN_COMMAND "command"
#define CONFDB_DOMAIN_TIMEOUT "timeout"
#define CONFDB_DOMAIN_ATTR "cn"
diff --git a/src/config/SSSDConfig.py b/src/config/SSSDConfig.py
index c27bade9..00ce5b79 100644
--- a/src/config/SSSDConfig.py
+++ b/src/config/SSSDConfig.py
@@ -87,6 +87,7 @@ option_strings = {
'chpass_provider' : _('Password change provider'),
'sudo_provider' : _('SUDO provider'),
'autofs_provider' : _('Autofs provider'),
+ 'session_provider' : _('Session-loading provider'),
# [domain]
'min_id' : _('Minimum user ID'),
diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py
index 2d6fa5ad..186bf364 100755
--- a/src/config/SSSDConfigTest.py
+++ b/src/config/SSSDConfigTest.py
@@ -496,7 +496,8 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
'access_provider',
'chpass_provider',
'sudo_provider',
- 'autofs_provider' ]
+ 'autofs_provider',
+ 'session_provider']
self.assertTrue(type(options) == dict,
"Options should be a dictionary")
@@ -821,7 +822,8 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
'access_provider',
'chpass_provider',
'sudo_provider',
- 'autofs_provider']
+ 'autofs_provider',
+ 'session_provider']
self.assertTrue(type(options) == dict,
"Options should be a dictionary")
diff --git a/src/config/etc/sssd.api.conf b/src/config/etc/sssd.api.conf
index 446bf950..ecc89dcf 100644
--- a/src/config/etc/sssd.api.conf
+++ b/src/config/etc/sssd.api.conf
@@ -60,6 +60,7 @@ access_provider = str, None, false
chpass_provider = str, None, false
sudo_provider = str, None, false
autofs_provider = str, None, false
+session_provider = str, None, false
[domain]
# Options available to all domains
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 367b374f..e7ba98fd 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -109,6 +109,7 @@ static struct bet_data bet_data[] = {
{BET_CHPASS, CONFDB_DOMAIN_CHPASS_PROVIDER, "sssm_%s_chpass_init"},
{BET_SUDO, CONFDB_DOMAIN_SUDO_PROVIDER, "sssm_%s_sudo_init"},
{BET_AUTOFS, CONFDB_DOMAIN_SUDO_PROVIDER, "sssm_%s_autofs_init"},
+ {BET_SESSION, CONFDB_DOMAIN_SESSION_PROVIDER, "sssm_%s_session_init"},
{BET_MAX, NULL, NULL}
};
@@ -577,8 +578,10 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
case SSS_PAM_CHAUTHTOK_PRELIM:
target = BET_CHPASS;
break;
- case SSS_PAM_SETCRED:
case SSS_PAM_OPEN_SESSION:
+ target = BET_SESSION;
+ break;
+ case SSS_PAM_SETCRED:
case SSS_PAM_CLOSE_SESSION:
pd->pam_status = PAM_SUCCESS;
goto done;
@@ -1697,6 +1700,21 @@ int be_process_init(TALLOC_CTX *mem_ctx,
"from provider [%s].\n", ctx->bet_info[BET_AUTOFS].mod_name));
}
+ ret = load_backend_module(ctx, BET_SESSION,
+ &ctx->bet_info[BET_SESSION],
+ ctx->bet_info[BET_ID].mod_name);
+ if (ret != EOK) {
+ if (ret != ENOENT) {
+ DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing data providers\n"));
+ return ret;
+ }
+ DEBUG(SSSDBG_CRIT_FAILURE, ("No Session module provided for [%s] !!\n",
+ be_domain));
+ } else {
+ DEBUG(SSSDBG_TRACE_ALL, ("Session backend target successfully loaded "
+ "from provider [%s].\n", ctx->bet_info[BET_SUDO].mod_name));
+ }
+
/* Handle SIGUSR1 to force offline behavior */
BlockSignals(false, SIGUSR1);
tes = tevent_add_signal(ctx->ev, ctx, SIGUSR1, 0,
diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h
index c053538b..68b2fa10 100644
--- a/src/providers/dp_backend.h
+++ b/src/providers/dp_backend.h
@@ -51,6 +51,7 @@ enum bet_type {
BET_CHPASS,
BET_SUDO,
BET_AUTOFS,
+ BET_SESSION,
BET_MAX
};