From 72c4709eefbfac429eca3ed8fb66decd03ed098d Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 25 Mar 2011 13:30:46 +0000 Subject: implement a validnames option that can be used to fine-tune the test for valid user and group names using a regular expression git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1411 ef36b2f9-881f-0410-afb5-c4e39611909c --- tests/Makefile.am | 2 +- tests/test_common.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 272ce04..f132208 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -73,7 +73,7 @@ test_getpeercred_SOURCES = test_getpeercred.c test_getpeercred_LDADD = ../compat/libcompat.a test_common_SOURCES = test_common.c -test_common_LDADD = ../nslcd/log.o ../nslcd/common.o ../nslcd/cfg.o \ +test_common_LDADD = ../nslcd/log.o ../nslcd/common.o \ ../nslcd/alias.o ../nslcd/ether.o ../nslcd/group.o \ ../nslcd/host.o ../nslcd/netgroup.o ../nslcd/network.o \ ../nslcd/passwd.o ../nslcd/protocol.o ../nslcd/rpc.o \ diff --git a/tests/test_common.c b/tests/test_common.c index 092867b..ee96733 100644 --- a/tests/test_common.c +++ b/tests/test_common.c @@ -26,6 +26,11 @@ #include #include "nslcd/common.h" +#include "nslcd/cfg.h" + +/* we include nslcd/cfg.c here to use cfg_defaults() to set the default + regular expression used in test_isvalidname() */ +#include "nslcd/cfg.c" static void test_isvalidname(void) { @@ -41,6 +46,8 @@ static void test_isvalidname(void) /* the main program... */ int main(int UNUSED(argc),char UNUSED(*argv[])) { + nslcd_cfg=(struct ldap_config *)malloc(sizeof(struct ldap_config)); + cfg_defaults(nslcd_cfg); test_isvalidname(); return 0; } -- cgit v1.2.3