nsssrv.c revision fd25e68446ae86135489edb0823607b394f4ec40
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder/*
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer SSSD
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
6b26240dca29e026900a83d51c75ca230a072a16Thiemo Wiedemeyer NSS Responder
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
2eeec5240b424984e3ee26296da1eeab6c6d739eChristian Maeder This program is free software; you can redistribute it and/or modify
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer it under the terms of the GNU General Public License as published by
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer the Free Software Foundation; either version 3 of the License, or
7520452bb30b5abbd471f82352fc4c1c937e02c5Till Mossakowski (at your option) any later version.
7520452bb30b5abbd471f82352fc4c1c937e02c5Till Mossakowski
7520452bb30b5abbd471f82352fc4c1c937e02c5Till Mossakowski This program is distributed in the hope that it will be useful,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer but WITHOUT ANY WARRANTY; without even the implied warranty of
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer GNU General Public License for more details.
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer You should have received a copy of the GNU General Public License
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer along with this program. If not, see <http://www.gnu.org/licenses/>.
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer*/
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <stdio.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <unistd.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <fcntl.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <sys/types.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <sys/stat.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <sys/socket.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <sys/un.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <string.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <sys/time.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include <errno.h>
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder#include <popt.h>
521045d36343cd17dd217a81d4b9422ad6ab6a07Christian Maeder#include <dbus/dbus.h>
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer#include "util/util.h"
0193c86704431f83731015a77cb613d67ae4e3c2Thiemo Wiedemeyer#include "responder/nss/nsssrv.h"
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer#include "responder/nss/nsssrv_private.h"
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer#include "responder/nss/nsssrv_mmap_cache.h"
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer#include "responder/nss/nsssrv_netgroup.h"
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer#include "responder/nss/nss_iface.h"
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer#include "responder/common/negcache.h"
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer#include "db/sysdb.h"
7ae38566aaf40710cd83ffa3ba25655c4ad22741Thiemo Wiedemeyer#include "confdb/confdb.h"
1a389234e68da7c3d087b038307ed8c66fc6dc32Thiemo Wiedemeyer#include "sbus/sssd_dbus.h"
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer#include "responder/common/responder_packet.h"
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder#include "responder/common/responder.h"
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include "responder/common/responder_sbus.h"
082d0630a77f163bf6df110776d7d8de04025110Mihai Codescu#include "providers/data_provider.h"
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include "monitor/monitor_interfaces.h"
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include "sbus/sbus_client.h"
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#include "util/util_sss_idmap.h"
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#define DEFAULT_PWFIELD "*"
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#define DEFAULT_NSS_FD_LIMIT 8192
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer#define SHELL_REALLOC_INCREMENT 5
b6a59f004903ac7bc96323ee3ef09c01fd221157Christian Maeder#define SHELL_REALLOC_MAX 50
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyerstatic int nss_clear_memcache(struct sbus_request *dbus_req, void *data);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyerstatic int nss_clear_netgroup_hash_table(struct sbus_request *dbus_req, void *data);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyerstruct mon_cli_iface monitor_nss_methods = {
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu { &mon_cli_iface_meta, 0 },
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer .resInit = monitor_common_res_init,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer .goOffline = NULL,
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer .resetOffline = NULL,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer .rotateLogs = responder_logrotate,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer .clearMemcache = nss_clear_memcache,
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer .clearEnumCache = nss_clear_netgroup_hash_table,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer .sysbusReconnect = NULL,
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder};
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maederstatic int nss_clear_memcache(struct sbus_request *dbus_req, void *data)
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder{
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder errno_t ret;
7ae38566aaf40710cd83ffa3ba25655c4ad22741Thiemo Wiedemeyer int memcache_timeout;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer struct resp_ctx *rctx = talloc_get_type(data, struct resp_ctx);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer struct nss_ctx *nctx = (struct nss_ctx*) rctx->pvt_ctx;
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder
4e9e95ba35a68f3c767bc0b23ebf9e904e442517Christian Maeder ret = unlink(SSS_NSS_MCACHE_DIR"/"CLEAR_MC_FLAG);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (ret != 0) {
79d103748927615310322af6f7806c7cef11a802Christian Maeder ret = errno;
ecd98975b8a8ab5a7bc075562bdab51cf47d2a90Christian Maeder if (ret == ENOENT) {
ecd98975b8a8ab5a7bc075562bdab51cf47d2a90Christian Maeder DEBUG(SSSDBG_TRACE_FUNC,
f9e0b18852b238ddb649d341194e05d7200d1bbeChristian Maeder "CLEAR_MC_FLAG not found. Nothing to do.\n");
697e63e30aa3c309a1ef1f9357745111f8dfc5a9Christian Maeder goto done;
ecd98975b8a8ab5a7bc075562bdab51cf47d2a90Christian Maeder } else {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer DEBUG(SSSDBG_CRIT_FAILURE, "Failed to unlink file: %s.\n",
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer strerror(ret));
4b136ad539bd9f4e115dff4eee4d552a42d4437eChristian Maeder return ret;
f456529a89bfb620d39e5fd5b0a53b24643db96dDominik Luecke }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
4c8d3c5a9e938633f6147b5a595b9b93bfca99e6Christian Maeder
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer /* CLEAR_MC_FLAG removed successfully. Clearing memory caches. */
4c8d3c5a9e938633f6147b5a595b9b93bfca99e6Christian Maeder
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer ret = confdb_get_int(rctx->cdb,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer CONFDB_NSS_CONF_ENTRY,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer CONFDB_MEMCACHE_TIMEOUT,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer 300, &memcache_timeout);
93eeaffa1087fc6eae3f19b8ca5affb7802799fdThiemo Wiedemeyer if (ret != EOK) {
415b2b968b52f687ba19f57aa85c9c5ee36f91e0Thiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder "Unable to get memory cache entry timeout.\n");
2028dc2c091bb60343e15985948a59b955276cbfChristian Maeder return ret;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
16e45483b5ce48f0b92d01c817242a8c9b8bae02Christian Maeder /* TODO: read cache sizes from configuration */
40b73e7d13a858afeac95321fcdb9ac216bfbf01Thiemo Wiedemeyer DEBUG(SSSDBG_TRACE_FUNC, "Clearing memory caches.\n");
ddc662fdf0207eae2034d7b68ae5e2225c575207Thiemo Wiedemeyer ret = sss_mmap_cache_reinit(nctx, SSS_MC_CACHE_ELEMENTS,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer (time_t) memcache_timeout,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu &nctx->pwd_mc_ctx);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_CRIT_FAILURE,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer "passwd mmap cache invalidation failed\n");
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer return ret;
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer }
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer ret = sss_mmap_cache_reinit(nctx, SSS_MC_CACHE_ELEMENTS,
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer (time_t) memcache_timeout,
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer &nctx->grp_mc_ctx);
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer if (ret != EOK) {
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer DEBUG(SSSDBG_CRIT_FAILURE,
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer "group mmap cache invalidation failed\n");
03bbcb1fefdbd8bc4e8329ca2688809d84aff0a9Christian Maeder return ret;
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer }
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer ret = sss_mmap_cache_reinit(nctx, SSS_MC_CACHE_ELEMENTS,
03bbcb1fefdbd8bc4e8329ca2688809d84aff0a9Christian Maeder (time_t)memcache_timeout,
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer &nctx->initgr_mc_ctx);
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder if (ret != EOK) {
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer DEBUG(SSSDBG_CRIT_FAILURE,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer "initgroups mmap cache invalidation failed\n");
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer return ret;
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanudone:
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder return sbus_request_return_and_finish(dbus_req, DBUS_TYPE_INVALID);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu}
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyerstatic int nss_clear_netgroup_hash_table(struct sbus_request *dbus_req, void *data)
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer{
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer errno_t ret;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu struct resp_ctx *rctx = talloc_get_type(data, struct resp_ctx);
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer struct nss_ctx *nctx = (struct nss_ctx*) rctx->pvt_ctx;
ddc662fdf0207eae2034d7b68ae5e2225c575207Thiemo Wiedemeyer
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer ret = nss_orphan_netgroups(nctx);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) {
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder DEBUG(SSSDBG_CRIT_FAILURE,
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder "Could not invalidate netgroups\n");
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu return ret;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu return sbus_request_return_and_finish(dbus_req, DBUS_TYPE_INVALID);
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder}
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
1ac36418f204bbe56f4cd951a979180721758999Christian Maederstatic errno_t nss_get_etc_shells(TALLOC_CTX *mem_ctx, char ***_shells)
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer{
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu int i = 0;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu char *sh;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu char **shells = NULL;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu TALLOC_CTX *tmp_ctx;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu errno_t ret;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu int size;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu tmp_ctx = talloc_new(NULL);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (!tmp_ctx) return ENOMEM;
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer shells = talloc_array(tmp_ctx, char *, SHELL_REALLOC_INCREMENT);
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder if (!shells) {
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer ret = ENOMEM;
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder goto done;
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer }
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder size = SHELL_REALLOC_INCREMENT;
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer setusershell();
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer while ((sh = getusershell())) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu shells[i] = talloc_strdup(shells, sh);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (!shells[i]) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu endusershell();
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder ret = ENOMEM;
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder goto done;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_TRACE_FUNC, "Found shell %s in /etc/shells\n", shells[i]);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu i++;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (i == size) {
79d103748927615310322af6f7806c7cef11a802Christian Maeder size += SHELL_REALLOC_INCREMENT;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (size > SHELL_REALLOC_MAX) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_FATAL_FAILURE,
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer "Reached maximum number of shells [%d]. "
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer "Users may be denied access. "
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer "Please check /etc/shells for sanity\n",
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer SHELL_REALLOC_MAX);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer break;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer shells = talloc_realloc(NULL, shells, char *,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer size);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (!shells) {
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder ret = ENOMEM;
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer goto done;
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer }
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer }
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer }
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer endusershell();
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder if (i + 1 < size) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu shells = talloc_realloc(NULL, shells, char *, i + 1);
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder if (!shells) {
86b2d79be961f0247a2eed10ed4f86d8d6a7639dChristian Maeder ret = ENOMEM;
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer goto done;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu shells[i] = NULL;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu *_shells = talloc_move(mem_ctx, &shells);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = EOK;
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maederdone:
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu talloc_zfree(tmp_ctx);
8f5219469b89a15dc6d4c2c30463775975f5841cRazvan Pascanu return ret;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu}
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyerstatic int nss_get_config(struct nss_ctx *nctx,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer struct confdb_ctx *cdb)
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer{
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder int ret;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu char *tmp_str;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer CONFDB_NSS_ENUM_CACHE_TIMEOUT, 120,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer &nctx->enum_cache_timeout);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer ret = confdb_get_bool(cdb, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_NSS_FILTER_USERS_IN_GROUPS, true,
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder &nctx->filter_users_in_groups);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_NSS_ENTRY_CACHE_NOWAIT_PERCENTAGE, 50,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu &nctx->cache_refresh_percent);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (nctx->cache_refresh_percent < 0 ||
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu nctx->cache_refresh_percent > 99) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_FATAL_FAILURE,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu "Configuration error: entry_cache_nowait_percentage is "
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu "invalid. Disabling feature.\n");
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer nctx->cache_refresh_percent = 0;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer ret = sss_ncache_prepopulate(nctx->rctx->ncache, cdb, nctx->rctx);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer goto done;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
ddc662fdf0207eae2034d7b68ae5e2225c575207Thiemo Wiedemeyer ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_NSS_PWFIELD, DEFAULT_PWFIELD,
1be357403a65d1954fd6b5f38e5cf8a630d8112fThiemo Wiedemeyer &nctx->pwfield);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_NSS_OVERRIDE_HOMEDIR, NULL,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu &nctx->override_homedir);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_NSS_FALLBACK_HOMEDIR, NULL,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu &nctx->fallback_homedir);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
aa07f9c4585a94514dcff2979d853d6e04c12fb9Thiemo Wiedemeyer CONFDB_NSS_OVERRIDE_SHELL, NULL,
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer &nctx->override_shell);
aa07f9c4585a94514dcff2979d853d6e04c12fb9Thiemo Wiedemeyer if (ret != EOK && ret != ENOENT) goto done;
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer
aa07f9c4585a94514dcff2979d853d6e04c12fb9Thiemo Wiedemeyer ret = confdb_get_string_as_list(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer CONFDB_NSS_ALLOWED_SHELL,
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer &nctx->allowed_shells);
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer if (ret != EOK && ret != ENOENT) goto done;
86b2d79be961f0247a2eed10ed4f86d8d6a7639dChristian Maeder
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer ret = confdb_get_string_as_list(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer CONFDB_NSS_VETOED_SHELL,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer &nctx->vetoed_shells);
aa07f9c4585a94514dcff2979d853d6e04c12fb9Thiemo Wiedemeyer if (ret != EOK && ret != ENOENT) goto done;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer ret = nss_get_etc_shells(nctx, &nctx->etc_shells);
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer if (ret != EOK) goto done;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
76ecd8e01387d1edc9197f3464073264fa2c789aThiemo Wiedemeyer CONFDB_NSS_SHELL_FALLBACK,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder CONFDB_DEFAULT_SHELL_FALLBACK,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer &nctx->shell_fallback);
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer if (ret != EOK) goto done;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
545d0cd78159cade346b579d06052638b19b0f72Thiemo Wiedemeyer ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_NSS_DEFAULT_SHELL,
545d0cd78159cade346b579d06052638b19b0f72Thiemo Wiedemeyer NULL,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer &nctx->default_shell);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder CONFDB_NSS_HOMEDIR_SUBSTRING,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_DEFAULT_HOMEDIR_SUBSTRING,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder &nctx->homedir_substr);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = confdb_get_string(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_IFP_USER_ATTR_LIST, NULL, &tmp_str);
5b00a9d748d5bea461601ed7ed5198dfd30cf2d2Thiemo Wiedemeyer if (ret != EOK) goto done;
5b00a9d748d5bea461601ed7ed5198dfd30cf2d2Thiemo Wiedemeyer
5b00a9d748d5bea461601ed7ed5198dfd30cf2d2Thiemo Wiedemeyer if (tmp_str == NULL) {
5b00a9d748d5bea461601ed7ed5198dfd30cf2d2Thiemo Wiedemeyer ret = confdb_get_string(cdb, nctx, CONFDB_IFP_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_IFP_USER_ATTR_LIST, NULL, &tmp_str);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) goto done;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer }
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer if (tmp_str != NULL) {
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer nctx->extra_attributes = parse_attr_list_ex(nctx, tmp_str, NULL);
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer if (nctx->extra_attributes == NULL) {
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer ret = ENOMEM;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer goto done;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer }
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer }
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer ret = 0;
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyerdone:
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer return ret;
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer}
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyerint nss_memorycache_update_initgroups(struct sbus_request *sbus_req,
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer void *data,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder const char *user,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder const char *domain,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer uint32_t *groups,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer int num_groups)
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder{
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer struct resp_ctx *rctx = talloc_get_type(data, struct resp_ctx);
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer struct nss_ctx *nctx = talloc_get_type(rctx->pvt_ctx, struct nss_ctx);
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer DEBUG(SSSDBG_TRACE_LIBS, "Updating inigroups memory cache of [%s@%s]\n",
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer user, domain);
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer nss_update_initgr_memcache(nctx, user, domain, num_groups, groups);
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder return iface_nss_memorycache_UpdateInitgroups_finish(sbus_req);
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer}
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyerstatic void nss_dp_reconnect_init(struct sbus_connection *conn,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer int status, void *pvt)
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer{
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer struct be_conn *be_conn = talloc_get_type(pvt, struct be_conn);
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer int ret;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder /* Did we reconnect successfully? */
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer if (status == SBUS_RECONNECT_SUCCESS) {
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer DEBUG(SSSDBG_CRIT_FAILURE, "Reconnected to the Data Provider.\n");
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer /* Identify ourselves to the data provider */
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer ret = rdp_register_client(be_conn, "NSS");
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer /* all fine */
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer if (ret == EOK) {
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer handle_requests_after_reconnect(be_conn->rctx);
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer return;
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer }
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer }
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder /* Failed to reconnect */
84ba39232a012abf2085c8a421ebce6abc52d56eThiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE, "Could not reconnect to %s provider.\n",
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer be_conn->domain->name);
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer /* FIXME: kill the frontend and let the monitor restart it ? */
545d0cd78159cade346b579d06052638b19b0f72Thiemo Wiedemeyer /* nss_shutdown(rctx); */
1a389234e68da7c3d087b038307ed8c66fc6dc32Thiemo Wiedemeyer}
1a389234e68da7c3d087b038307ed8c66fc6dc32Thiemo Wiedemeyer
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanuint nss_process_init(TALLOC_CTX *mem_ctx,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu struct tevent_context *ev,
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder struct confdb_ctx *cdb)
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu{
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu struct resp_ctx *rctx;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu struct sss_cmd_table *nss_cmds;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu struct be_conn *iter;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu struct nss_ctx *nctx;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer int memcache_timeout;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu int ret, max_retries;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu enum idmap_error_code err;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu int hret;
8681833aefdae18bfd52607b841373f024bbd99cChristian Maeder int fd_limit;
1a389234e68da7c3d087b038307ed8c66fc6dc32Thiemo Wiedemeyer
1a389234e68da7c3d087b038307ed8c66fc6dc32Thiemo Wiedemeyer nss_cmds = get_nss_cmds();
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = sss_process_init(mem_ctx, ev, cdb,
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer nss_cmds,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu SSS_NSS_SOCKET_NAME, -1, NULL, -1,
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu NSS_SBUS_SERVICE_NAME,
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder NSS_SBUS_SERVICE_VERSION,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu &monitor_nss_methods,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu "NSS",
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu nss_get_sbus_interface(),
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer nss_connection_setup,
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer &rctx);
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer if (ret != EOK) {
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n");
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer return ret;
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer }
37e30366abd83c00a5d5447b45694627fd783de8Cui Jian
da955132262baab309a50fdffe228c9efe68251dCui Jian nctx = talloc_zero(rctx, struct nss_ctx);
37e30366abd83c00a5d5447b45694627fd783de8Cui Jian if (!nctx) {
37e30366abd83c00a5d5447b45694627fd783de8Cui Jian DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing nss_ctx\n");
37e30366abd83c00a5d5447b45694627fd783de8Cui Jian ret = ENOMEM;
37e30366abd83c00a5d5447b45694627fd783de8Cui Jian goto fail;
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer }
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer nctx->rctx = rctx;
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder nctx->rctx->pvt_ctx = nctx;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder ret = nss_get_config(nctx, cdb);
40c18e3f63c23085e5bb36ea35efe141a87df8e4Klaus Luettich if (ret != EOK) {
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE, "fatal error getting nss config\n");
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer goto fail;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer }
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer
40c18e3f63c23085e5bb36ea35efe141a87df8e4Klaus Luettich /* Enable automatic reconnection to the Data Provider */
fe1f344573c570949fa4f255c68bb9026c609832Thiemo Wiedemeyer ret = confdb_get_int(nctx->rctx->cdb,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer CONFDB_NSS_CONF_ENTRY,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer CONFDB_SERVICE_RECON_RETRIES,
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer 3, &max_retries);
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder if (ret != EOK) {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu "Failed to set up automatic reconnection\n");
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer goto fail;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu for (iter = nctx->rctx->be_conns; iter; iter = iter->next) {
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder sbus_reconnect_init(iter->conn, max_retries,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu nss_dp_reconnect_init, iter);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer err = sss_idmap_init(sss_idmap_talloc, nctx, sss_idmap_talloc_free,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer &nctx->idmap_ctx);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (err != IDMAP_SUCCESS) {
109b67ffce2bad83667e2f4a319d2d7f380f91afThiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE, "sss_idmap_init failed.\n");
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer ret = EFAULT;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu goto fail;
4d3b50fc78a0c99ff2914fb23f3c7fba6e38d790Thiemo Wiedemeyer }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder /* Create the lookup table for netgroup results */
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu hret = sss_hash_create_ex(nctx, 10, &nctx->netgroups, 0, 0, 0, 0,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu netgroup_hash_delete_cb, NULL);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (hret != HASH_SUCCESS) {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer "Unable to initialize netgroup hash table\n");
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer ret = EIO;
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer goto fail;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer /* create mmap caches */
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer /* Remove the CLEAR_MC_FLAG file if exists. */
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer ret = unlink(SSS_NSS_MCACHE_DIR"/"CLEAR_MC_FLAG);
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer if (ret != 0 && errno != ENOENT) {
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer ret = errno;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer DEBUG(SSSDBG_CRIT_FAILURE,
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer "Failed to unlink file [%s]. This can cause memory cache to "
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer "be purged when next log rotation is requested. %d: %s\n",
5107ba7da675778f2fded68493512b60eff8a455Christian Maeder SSS_NSS_MCACHE_DIR"/"CLEAR_MC_FLAG, ret, strerror(ret));
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = confdb_get_int(nctx->rctx->cdb,
5107ba7da675778f2fded68493512b60eff8a455Christian Maeder CONFDB_NSS_CONF_ENTRY,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu CONFDB_MEMCACHE_TIMEOUT,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu 300, &memcache_timeout);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) {
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE,
0dba5bbaaef2f620f3b83a16ab6b229c3dd50c98Christian Maeder "Failed to get 'memcache_timeout' option from confdb.\n");
0dba5bbaaef2f620f3b83a16ab6b229c3dd50c98Christian Maeder goto fail;
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer }
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer /* TODO: read cache sizes from configuration */
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer ret = sss_mmap_cache_init(nctx, "passwd", SSS_MC_PASSWD,
5044e8de9e6fde7a139a5e34324c92a4d08a6e73Thiemo Wiedemeyer SSS_MC_CACHE_ELEMENTS, (time_t)memcache_timeout,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer &nctx->pwd_mc_ctx);
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder if (ret) {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer DEBUG(SSSDBG_CRIT_FAILURE, "passwd mmap cache is DISABLED\n");
8f5219469b89a15dc6d4c2c30463775975f5841cRazvan Pascanu }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer ret = sss_mmap_cache_init(nctx, "group", SSS_MC_GROUP,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu SSS_MC_CACHE_ELEMENTS, (time_t)memcache_timeout,
ddc662fdf0207eae2034d7b68ae5e2225c575207Thiemo Wiedemeyer &nctx->grp_mc_ctx);
ddc662fdf0207eae2034d7b68ae5e2225c575207Thiemo Wiedemeyer if (ret) {
8f5219469b89a15dc6d4c2c30463775975f5841cRazvan Pascanu DEBUG(SSSDBG_CRIT_FAILURE, "group mmap cache is DISABLED\n");
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = sss_mmap_cache_init(nctx, "initgroups", SSS_MC_INITGROUPS,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu SSS_MC_CACHE_ELEMENTS, (time_t)memcache_timeout,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu &nctx->initgr_mc_ctx);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_CRIT_FAILURE, "inigroups mmap cache is DISABLED\n");
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer }
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer /* Set up file descriptor limits */
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer ret = confdb_get_int(nctx->rctx->cdb,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer CONFDB_NSS_CONF_ENTRY,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer CONFDB_SERVICE_FD_LIMIT,
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder DEFAULT_NSS_FD_LIMIT,
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer &fd_limit);
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer if (ret != EOK) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_FATAL_FAILURE,
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer "Failed to set up file descriptor limit\n");
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer goto fail;
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer }
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer responder_set_fd_limit(fd_limit);
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer ret = schedule_get_domains_task(rctx, rctx->ev, rctx, nctx->rctx->ncache);
79d103748927615310322af6f7806c7cef11a802Christian Maeder if (ret != EOK) {
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n");
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer goto fail;
4b136ad539bd9f4e115dff4eee4d552a42d4437eChristian Maeder }
b6a59f004903ac7bc96323ee3ef09c01fd221157Christian Maeder
b6a59f004903ac7bc96323ee3ef09c01fd221157Christian Maeder ret = sss_ad_default_names_ctx(nctx, &nctx->global_names);
b6a59f004903ac7bc96323ee3ef09c01fd221157Christian Maeder if (ret != EOK) {
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder DEBUG(SSSDBG_CRIT_FAILURE, "sss_ad_default_names_ctx failed.\n");
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu goto fail;
8f5219469b89a15dc6d4c2c30463775975f5841cRazvan Pascanu }
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu DEBUG(SSSDBG_TRACE_FUNC, "NSS Initialization complete\n");
4b136ad539bd9f4e115dff4eee4d552a42d4437eChristian Maeder
4b136ad539bd9f4e115dff4eee4d552a42d4437eChristian Maeder return EOK;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanufail:
966a6c024c828387023fccb0cd0049f78687e5dcThiemo Wiedemeyer talloc_free(rctx);
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer return ret;
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer}
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyerint main(int argc, const char *argv[])
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer{
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer int opt;
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer poptContext pc;
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer struct main_context *main_ctx;
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder int ret;
4b136ad539bd9f4e115dff4eee4d552a42d4437eChristian Maeder uid_t uid;
c40b7badd217089d8a256dabdf8f7d4e219ca215Thiemo Wiedemeyer gid_t gid;
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer struct poptOption long_options[] = {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer POPT_AUTOHELP
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer SSSD_MAIN_OPTS
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer SSSD_SERVER_OPTS(uid, gid)
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder POPT_TABLEEND
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder };
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder /* Set debug level to invalid value so we can deside if -d 0 was used. */
38122cbf09ad3dcc31a826cc4093f630515a5cfcChristian Maeder debug_level = SSSDBG_INVALID;
521045d36343cd17dd217a81d4b9422ad6ab6a07Christian Maeder
521045d36343cd17dd217a81d4b9422ad6ab6a07Christian Maeder umask(DFL_RSP_UMASK);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer pc = poptGetContext(argv[0], argc, argv, long_options, 0);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer while((opt = poptGetNextOpt(pc)) != -1) {
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer switch(opt) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu default:
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu fprintf(stderr, "\nInvalid option %s: %s\n\n",
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder poptBadOption(pc, 0), poptStrerror(opt));
79d103748927615310322af6f7806c7cef11a802Christian Maeder poptPrintUsage(pc, stderr, 0);
038fc609b1d0dfe9698c4cab26fc7db2225820efMihai Codescu return 1;
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu }
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer }
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder poptFreeContext(pc);
836aa06d367f900bee9aa762250471bcd00b5a9dChristian Maeder
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer DEBUG_INIT(debug_level);
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer
66b035879accdc5f8337726173f800286a87fd78Christian Maeder /* set up things like debug, signals, daemonization, etc... */
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder debug_log_file = "sssd_nss";
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder
1ac36418f204bbe56f4cd951a979180721758999Christian Maeder ret = server_setup("sssd[nss]", 0, uid, gid, CONFDB_NSS_CONF_ENTRY,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer &main_ctx);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer if (ret != EOK) return 2;
66fd8f017efdb8a6c862c3f1856dfaef90865dd5Thiemo Wiedemeyer
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = die_if_parent_died();
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu if (ret != EOK) {
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu /* This is not fatal, don't return */
a4e6fb26100f53e3b1e9f5b97c2e0a0c129294e5Christian Maeder DEBUG(SSSDBG_OP_FAILURE,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu "Could not set up to exit when parent process does\n");
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu }
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu ret = nss_process_init(main_ctx,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu main_ctx->event_ctx,
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu main_ctx->confdb_ctx);
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu if (ret != EOK) return 3;
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu
71654489020a03cf6ce9f2947f3da26a996f9c32Razvan Pascanu /* loop on main */
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu server_loop(main_ctx);
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu
9b01b265715d725c17d51619d297bbb97f37d1b5Thiemo Wiedemeyer return 0;
9b01b265715d725c17d51619d297bbb97f37d1b5Thiemo Wiedemeyer}
36f69d35e01d2d6b6bdc165b49661f2a80af8687Mihai Codescu
8b23feb0879618f786f08152c6df6b6e2cb8898bMihai Codescu