1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-01-31 16:52:19 +01:00

basic test for get_user_cfgfile_path()

This commit is contained in:
Klas Lindfors 2014-08-27 09:58:43 +02:00
parent 9a22fc0753
commit f58b225aaa
2 changed files with 20 additions and 4 deletions

View File

@ -39,13 +39,13 @@ lib_LTLIBRARIES = pam_yubico.la
pam_yubico_la_SOURCES = pam_yubico.c drop_privs.h drop_privs.c
# XXX add -Wl,-x too? PAM documentation suggests it.
pam_yubico_la_LIBADD = @LTLIBYKCLIENT@ @LIBLDAP@ @YKPERS_LIBS@ -lpam
pam_yubico_la_LIBADD = @LTLIBYKCLIENT@ @LIBLDAP@ -lpam
pam_yubico_la_LIBADD += libpam_util.la
pam_yubico_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = libpam_util.la
libpam_util_la_SOURCES = util.c util.h
libpam_util_la_LIBADD = @LTLIBYUBIKEY@
libpam_util_la_LIBADD = @LTLIBYUBIKEY@ @YKPERS_LIBS@
DEFS = -DDEBUG_PAM -DPAM_DEBUG @DEFS@
@ -56,8 +56,7 @@ bin_PROGRAMS = ykpamcfg
endif
ykpamcfg_SOURCES = ykpamcfg.c
ykpamcfg_LDADD = @YKPERS_LIBS@
ykpamcfg_LDADD += libpam_util.la
ykpamcfg_LDADD = libpam_util.la
if YKPERS
dist_man1_MANS = ykpamcfg.1

View File

@ -28,11 +28,28 @@
*/
#include <stdio.h>
#include <assert.h>
#include "util.h"
#if HAVE_CR
void test_get_user_cfgfile_path() {
char *file;
int ret = get_user_cfgfile_path("/foo/bar", "test", "root", &file);
fprintf(stderr, "foo: %s\n", file);
assert(strcmp(file, "/foo/bar/test") == 0);
}
#endif /* HAVE_CR */
int
main (int argc, char **argv)
{
#if HAVE_CR
test_get_user_cfgfile_path();
return 0;
#else
printf("skipping util tests since we're compiling without CR\n");
return 0;
#endif /* HAVE_CR */
}