diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-25 17:38:10 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-25 17:38:10 +0200 |
commit | 2a743814acac368dd09ea0e222e5dcd16b72af57 (patch) | |
tree | 869e182fe2eeb4143fe5100853baae2aa2ee4880 /tests/test_myldap.c | |
parent | b9dbe019a442b0d202722faad5570ebc38bb0dd0 (diff) |
have the binary look up the file name and only use the shell script wrapper to determine if LDAP server is available
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@697 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'tests/test_myldap.c')
-rw-r--r-- | tests/test_myldap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_myldap.c b/tests/test_myldap.c index c127b58..1e9f5da 100644 --- a/tests/test_myldap.c +++ b/tests/test_myldap.c @@ -391,8 +391,16 @@ static void test_connections(void) /* the main program... */ int main(int argc,char *argv[]) { - assert(argc==2); - cfg_init(argv[1]); + char *srcdir; + char fname[100]; + /* build the name of the file */ + srcdir=getenv("srcdir"); + if (srcdir==NULL) + srcdir="."; + snprintf(fname,sizeof(fname),"%s/nss-ldapd-test.conf",srcdir); + fname[sizeof(fname)-1]='\0'; + /* initialize configuration */ + cfg_init(fname); /* partially initialize logging */ log_setdefaultloglevel(LOG_DEBUG); test_search(); |