summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-01-23 13:58:52 -0500
committerSimo Sorce <idra@samba.org>2009-01-27 11:44:12 -0500
commit9dbee539a4c7e04e7cf41f3bfb16ef7c28274fcc (patch)
treedf58163284c8a1cf79e4e6868a194f255490016d /server
parent8d8743ebf8f02bdb1cc479779fa4a275ec39b5b3 (diff)
downloadsssd-9dbee539a4c7e04e7cf41f3bfb16ef7c28274fcc.tar.gz
sssd-9dbee539a4c7e04e7cf41f3bfb16ef7c28274fcc.tar.bz2
sssd-9dbee539a4c7e04e7cf41f3bfb16ef7c28274fcc.zip
Automatically generate the config.ldb if it doesn't exist (i.e. First startup)
Diffstat (limited to 'server')
-rw-r--r--server/Makefile.in3
-rw-r--r--server/confdb/confdb.c89
-rw-r--r--server/configure.ac5
-rw-r--r--server/server.mk4
4 files changed, 91 insertions, 10 deletions
diff --git a/server/Makefile.in b/server/Makefile.in
index 6c7bdfd9..aabb80dd 100644
--- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -16,6 +16,7 @@ builddir = @builddir@
sharedbuilddir = @sharedbuilddir@
INSTALLCMD = @INSTALL@
EXTRA_OBJ=@EXTRA_OBJ@
+SSSD_LIBEXEC_PATH = @SSSD_LIBEXEC_PATH@
PACKAGE_VERSION = @PACKAGE_VERSION@
srvdir = $(srcdir)
@@ -51,7 +52,7 @@ LIBS = @LIBS@ $(TALLOC_LIBS) $(TDB_LIBS) $(EVENTS_LIBS) $(POPT_LIBS) $(LDB_LIBS)
PICFLAG = @PICFLAG@
CFLAGS += -g -I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
$(POPT_CFLAGS) $(TALLOC_CFLAGS) $(TDB_CFLAGS) $(EVENTS_CFLAGS) $(LDB_CFLAGS) $(DBUS_CFLAGS)\
- -DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"$(SHLIBEXT)\" -DUSE_MMAP=1 @CFLAGS@
+ -DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"$(SHLIBEXT)\" -DSSSD_LIBEXEC_PATH=\"$(SSSD_LIBEXEC_PATH)\" -DUSE_MMAP=1 @CFLAGS@
MDLD = @MDLD@
MDLD_FLAGS = @MDLD_FLAGS@
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index 9a0e365e..f9cd20a1 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -408,19 +408,96 @@ static int confdb_test(struct confdb_ctx *cdb)
static int confdb_init_db(struct confdb_ctx *cdb)
{
- const char *verval[] = { CONFDB_VERSION, NULL };
+ const char *val[2];
int ret;
+ TALLOC_CTX *tmp_ctx;
+
+ tmp_ctx = talloc_new(cdb);
+ if(tmp_ctx == NULL) return ENOMEM;
+
+ val[0] = CONFDB_VERSION;
+ val[1] = NULL;
+ /* Add the confdb version */
ret = confdb_add_param(cdb,
false,
"config",
"version",
- verval);
- if (ret != EOK) {
- return ret;
- }
+ val);
+ if (ret != EOK) goto done;
+
+ /* Set up default monitored services */
+ val[0] = "Local service configuration";
+ ret = confdb_add_param(cdb, false, "config/services", "description", val);
+ if (ret != EOK) goto done;
+
+#if 0 /* Not yet implemented */
+/* PAM */
+#endif /* PAM */
+
+/* NSS */
+ /* set the sssd_nss description */
+ val[0] = "NSS Responder Configuration";
+ ret = confdb_add_param(cdb, false, "config/services/nss", "description", val);
+ if (ret != EOK) goto done;
+
+ /* Set the sssd_nss command path */
+ val[0] = talloc_asprintf(tmp_ctx, "%s/sssd_nss", SSSD_LIBEXEC_PATH);
+ ret = confdb_add_param(cdb, false, "config/services/nss", "command", val);
+ if (ret != EOK) goto done;
+
+ /* Set the sssd_nss socket path */
+ val[0] = talloc_asprintf(tmp_ctx, "%s/sssd_nss", PIPE_PATH);
+ ret = confdb_add_param(cdb, false, "config/services/nss", "unixSocket", val);
+ if (ret != EOK) goto done;
+
+ /* Add NSS to the list of active services */
+ val[0] = "nss";
+ ret = confdb_add_param(cdb, false, "config/services", "activeServices", val);
+ if (ret != EOK) goto done;
+
+/* Data Provider */
+ /* set the sssd_dp description */
+ val[0] = "Data Provider Configuration";
+ ret = confdb_add_param(cdb, false, "config/services/dp", "description", val);
+ if (ret != EOK) goto done;
+
+ /* Set the sssd_dp command path */
+ val[0] = talloc_asprintf(tmp_ctx, "%s/sssd_dp", SSSD_LIBEXEC_PATH);
+ ret = confdb_add_param(cdb, false, "config/services/dp", "command", val);
+ if (ret != EOK) goto done;
+
+ /* Add the Data Provider to the list of active services */
+ val[0] = "dp";
+ ret = confdb_add_param(cdb, false, "config/services", "activeServices", val);
+ if (ret != EOK) goto done;
+
+#if 0 /* Not yet implemented */
+/* InfoPipe */
+#endif
+
+/* Domains */
+ val[0] = "Domains served by SSSD";
+ ret = confdb_add_param(cdb, false, "config/domains", "description", val);
+ if (ret != EOK) goto done;
+
+ /* Default LOCAL domain */
+ val[0] = "Reserved domain for local configurations";
+ ret = confdb_add_param(cdb, false, "config/domains/LOCAL", "description", val);
+ if (ret != EOK) goto done;
+
+ val[0] = "local";
+ ret = confdb_add_param(cdb, false, "config/domains/LOCAL", "provider", val);
+ if (ret != EOK) goto done;
+
+ val[0] = "cn=local,dc=sysdb";
+ ret = confdb_add_param(cdb, false, "config/domains/LOCAL", "basedn", val);
+ if (ret != EOK) goto done;
- return EOK;
+
+done:
+ talloc_free(tmp_ctx);
+ return ret;
}
int confdb_init(TALLOC_CTX *mem_ctx,
diff --git a/server/configure.ac b/server/configure.ac
index ddf9d47b..94c057f4 100644
--- a/server/configure.ac
+++ b/server/configure.ac
@@ -11,7 +11,7 @@ AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
AC_DEFUN([SMB_ENABLE], [echo -n ""])
-AC_INIT(ldb, 0.9.2)
+AC_INIT(sssd, 0.1.0)
AC_CONFIG_SRCDIR([autogen.sh])
AC_LIBREPLACE_ALL_CHECKS
@@ -26,6 +26,9 @@ AC_CONFIG_HEADER(config.h)
TESTS=""
EXTRA_OBJ=""
+SSSD_LIBEXEC_PATH=$libexecdir/$PACKAGE_NAME
+AC_SUBST(SSSD_LIBEXEC_PATH)
+
m4_include(build_macros.m4)
BUILD_WITH_SHARED_BUILD_DIR
diff --git a/server/server.mk b/server/server.mk
index 34ff0162..34c2c874 100644
--- a/server/server.mk
+++ b/server/server.mk
@@ -34,8 +34,8 @@ NSSSRV_OBJ = \
install:: all
${INSTALLCMD} -d $(DESTDIR)$(sbindir)
${INSTALLCMD} -m 700 sbin/sssd $(DESTDIR)$(sbindir)
- ${INSTALLCMD} -d $(libexecdir)
- ${INSTALLCMD} -m 700 $(LIBEXECBINS) $(libexecdir)
+ ${INSTALLCMD} -d $(DESTDIR)$(SSSD_LIBEXEC_PATH)
+ ${INSTALLCMD} -m 700 $(LIBEXECBINS) $(DESTDIR)$(SSSD_LIBEXEC_PATH)
sbin/sssd: $(SERVER_OBJ) $(UTIL_OBJ)
$(CC) -o sbin/sssd $(SERVER_OBJ) $(UTIL_OBJ) $(LDFLAGS) $(LIBS)