1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-02-27 06:54:15 +01:00

setup travis to do multi-os builds

This commit is contained in:
Klas Lindfors 2015-10-08 09:12:31 +02:00
parent 7aa75e0af8
commit 9c8553f297
3 changed files with 38 additions and 4 deletions

View File

@ -1,4 +1,7 @@
language: c language: c
os:
- linux
- osx
compiler: compiler:
- gcc - gcc
- clang - clang
@ -7,12 +10,9 @@ env:
- CONFIGURE_ARGS="--without-ldap" EXTRA="libykpers-1-dev" - CONFIGURE_ARGS="--without-ldap" EXTRA="libykpers-1-dev"
- CONFIGURE_ARGS="--without-cr" EXTRA="libldap2-dev libnet-ldap-server-perl" - CONFIGURE_ARGS="--without-cr" EXTRA="libldap2-dev libnet-ldap-server-perl"
- CONFIGURE_ARGS="--without-ldap --without-cr" - CONFIGURE_ARGS="--without-ldap --without-cr"
before_install:
- sudo add-apt-repository -y ppa:yubico/stable
- sudo apt-get update -qq || true
- sudo apt-get install -qq -y --no-install-recommends libykclient-dev libpam0g-dev libyubikey-dev asciidoc docbook-xml xsltproc libxml2-utils $EXTRA
script: tests/aux/build-and-test.sh script: tests/aux/build-and-test.sh
matrix: matrix:
include: include:
- compiler: gcc - compiler: gcc
os: linux
env: COVERAGE="--enable-coverage" EXTRA="libldap2-dev libykpers-1-dev libnet-ldap-server-perl lcov" env: COVERAGE="--enable-coverage" EXTRA="libldap2-dev libykpers-1-dev libnet-ldap-server-perl lcov"

View File

@ -5,6 +5,20 @@ set -x
autoreconf -i autoreconf -i
if [ "x$TRAVIS_OS_NAME" != "xosx" ]; then
sudo add-apt-repository -y ppa:yubico/stable
sudo apt-get update -qq || true
sudo apt-get install -qq -y --no-install-recommends libykclient-dev libpam0g-dev libyubikey-dev asciidoc docbook-xml xsltproc libxml2-utils $EXTRA
else
brew install pkg-config
brew install libtool
brew install asciidoc
brew install libyubikey
brew install ykclient
brew install ykpers
cpanp install Net::LDAP::Server
fi
./configure $CONFIGURE_ARGS $COVERAGE ./configure $CONFIGURE_ARGS $COVERAGE
make check make check
if [ "x$COVERAGE" != "x" ]; then if [ "x$COVERAGE" != "x" ]; then

View File

@ -38,7 +38,14 @@
#include <assert.h> #include <assert.h>
#include <security/pam_appl.h> #include <security/pam_appl.h>
#ifdef HAVE_PAM_MODUTIL_DROP_PRIV
#include <security/pam_modutil.h> #include <security/pam_modutil.h>
#else
#include <pwd.h>
struct pam_modutil_privs {
int noop;
};
#endif
#define YKVAL_PORT1 "17502" #define YKVAL_PORT1 "17502"
#define YKVAL_PORT2 "30559" #define YKVAL_PORT2 "30559"
@ -83,7 +90,11 @@ static const struct data *test_get_data(void *id) {
return &_data[(long)id]; return &_data[(long)id];
} }
#ifdef OPENPAM
const char * pam_strerror(const pam_handle_t *pamh, int errnum) {
#else
const char * pam_strerror(pam_handle_t *pamh, int errnum) { const char * pam_strerror(pam_handle_t *pamh, int errnum) {
#endif
fprintf(stderr, "in pam_strerror()\n"); fprintf(stderr, "in pam_strerror()\n");
return "error"; return "error";
} }
@ -94,7 +105,16 @@ int pam_set_data(pam_handle_t *pamh, const char *module_data_name, void *data,
return PAM_SUCCESS; return PAM_SUCCESS;
} }
int pam_get_data(const pam_handle_t *pamh, const char *module_data_name, const void **data) {
fprintf(stderr, "in pam_get_data() %s\n", module_data_name);
return PAM_SUCCESS;
}
#ifdef OPENPAM
int pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt) {
#else
int pam_get_user(const pam_handle_t *pamh, const char **user, const char *prompt) { int pam_get_user(const pam_handle_t *pamh, const char **user, const char *prompt) {
#endif
fprintf(stderr, "in pam_get_user()\n"); fprintf(stderr, "in pam_get_user()\n");
*user = test_get_data((void*)pamh)->user; *user = test_get_data((void*)pamh)->user;
return PAM_SUCCESS; return PAM_SUCCESS;