pam_wrapper.git
6 months agoBump version to 1.0.7 master pam_wrapper-1.0.7
Andreas Schneider [Tue, 25 Sep 2018 18:16:47 +0000 (20:16 +0200)]
Bump version to 1.0.7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
7 months agopwrap: Don't do a deep bind if we run with libasan
Andreas Schneider [Sat, 1 Sep 2018 17:46:36 +0000 (19:46 +0200)]
pwrap: Don't do a deep bind if we run with libasan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
7 months agopam_set_items: Add logging
Andreas Schneider [Thu, 20 Sep 2018 08:08:00 +0000 (10:08 +0200)]
pam_set_items: Add logging

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
7 months agopypamtest: Fix number of responses
Andreas Schneider [Mon, 25 Jun 2018 09:02:45 +0000 (11:02 +0200)]
pypamtest: Fix number of responses

The number of responses needs to match the number of provided messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
7 months agopwrap: Add PAM_TEXT_INFO and PAM_ERROR_MSG to responses
Andreas Schneider [Tue, 26 Jun 2018 06:46:44 +0000 (08:46 +0200)]
pwrap: Add PAM_TEXT_INFO and PAM_ERROR_MSG to responses

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
7 months agolibpamtest: Check that message count matches response count
Andreas Schneider [Mon, 25 Jun 2018 08:39:51 +0000 (10:39 +0200)]
libpamtest: Check that message count matches response count

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
7 months agocmake: Don't keep CMAKE_REQUIRED_LIBRARIES around
Andreas Schneider [Tue, 28 Aug 2018 09:18:36 +0000 (11:18 +0200)]
cmake: Don't keep CMAKE_REQUIRED_LIBRARIES around

This can cause issues with detecting features.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agoctest: Move to new dashboard
Andreas Schneider [Thu, 5 Jul 2018 08:16:27 +0000 (10:16 +0200)]
ctest: Move to new dashboard

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agocmake: Fix python2 and python3 detection
Andreas Schneider [Tue, 3 Jul 2018 09:33:04 +0000 (11:33 +0200)]
cmake: Fix python2 and python3 detection

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agopwrap: Improve error message
Andreas Schneider [Fri, 29 Jun 2018 13:23:34 +0000 (15:23 +0200)]
pwrap: Improve error message

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agopwrap: Don't clean the stale dir twice
Andreas Schneider [Fri, 29 Jun 2018 13:23:12 +0000 (15:23 +0200)]
pwrap: Don't clean the stale dir twice

This is already done above.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agotests: Fix length calulation
Andreas Schneider [Mon, 25 Jun 2018 09:02:22 +0000 (11:02 +0200)]
tests: Fix length calulation

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agoRename COPYING to LICENSE
Andreas Schneider [Fri, 22 Jun 2018 07:14:29 +0000 (09:14 +0200)]
Rename COPYING to LICENSE

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 months agocpack: Do not package build dirs in source tarball
Andreas Schneider [Fri, 22 Jun 2018 07:13:52 +0000 (09:13 +0200)]
cpack: Do not package build dirs in source tarball

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
12 months agoBump version to 1.0.6 pam_wrapper-1.0.6
Andreas Schneider [Tue, 27 Mar 2018 09:05:04 +0000 (11:05 +0200)]
Bump version to 1.0.6

Signed-off-by: Andreas Schneider <asn@samba.org>
12 months agopwrap: remove pdir handling from p_copy()
Ralph Boehme [Mon, 26 Mar 2018 16:03:08 +0000 (18:03 +0200)]
pwrap: remove pdir handling from p_copy()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agopwrap: Fix overflow checking
Ralph Boehme [Mon, 26 Mar 2018 14:42:00 +0000 (16:42 +0200)]
pwrap: Fix overflow checking

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
12 months agopwrap: Avoid strncpy in pwrap_init()
Andreas Schneider [Mon, 26 Mar 2018 13:45:43 +0000 (15:45 +0200)]
pwrap: Avoid strncpy in pwrap_init()

CID 47508

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agopwrap: Add missing config.h includes
Andreas Schneider [Tue, 27 Feb 2018 08:17:06 +0000 (09:17 +0100)]
pwrap: Add missing config.h includes

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agopwrap: Remove trailing whitespaces
Andreas Schneider [Thu, 22 Feb 2018 16:02:12 +0000 (17:02 +0100)]
pwrap: Remove trailing whitespaces

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agoBump version to 1.0.5 pam_wrapper-1.0.5
Andreas Schneider [Thu, 22 Feb 2018 14:46:12 +0000 (15:46 +0100)]
Bump version to 1.0.5

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
13 months agopwrap: Use a more unique name for pamdir
Nikos Mavrogiannopoulos [Mon, 19 Feb 2018 20:23:23 +0000 (21:23 +0100)]
pwrap: Use a more unique name for pamdir

Parallel builds fail quite predictable when using libpam_wrapper.
It seems that the temporary directory used are created sequentially
and that caused issues like:

PWRAP_ERROR(8157) - pwrap_load_lib_handle: Failed to dlopen library: /tmp/pam.0/lib/libpam.so.0: cannot open shared object file: No such file or directory

When a directory was cleaned up, incorrectly. I have not pin-pointed
the race condition, but this patch starts from a random letter (using
the PID of the process) in the temporary directory name, providing
better assurances of uniqueness.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
14 months agocmake: Build python2 and python3 modules if possible
Andreas Schneider [Mon, 12 Feb 2018 11:01:22 +0000 (12:01 +0100)]
cmake: Build python2 and python3 modules if possible

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
16 months agocmake: Improve PAM_WRAPPER_LOACATION
Andreas Schneider [Wed, 22 Nov 2017 14:27:44 +0000 (15:27 +0100)]
cmake: Improve PAM_WRAPPER_LOACATION

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
16 months agopam_wrapper: Use a constant string format specifier in test
Uri Simchoni [Wed, 22 Nov 2017 20:48:23 +0000 (20:48 +0000)]
pam_wrapper: Use a constant string format specifier in test

This fixes a warning about non-constant format specifier.
clang 4.0.0 warns against non-constant format specifier since
it cannot validate the format against the parameters.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
16 months agopam_wrapper: use uintptr_t as base for const-discarding
Uri Simchoni [Sun, 19 Nov 2017 13:08:30 +0000 (13:08 +0000)]
pam_wrapper: use uintptr_t as base for const-discarding

Seems like HAVE_INTPTR_T is not available on FreeBSD. Use
the uintptr_t-base const discarding to avoid picky compiler
warnings (other places in Samba also use uintptr_t).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
16 months agopam_wrapper: #ifdef-out unused functions
Uri Simchoni [Wed, 22 Nov 2017 14:23:26 +0000 (15:23 +0100)]
pam_wrapper: #ifdef-out unused functions

When pam_vsyslog is not available, avoid building functions
that are being used to wrap it, in order to avoid picky
compiler warnings.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
18 months agopypamtest: Fix Python 2.6 compatibility
Lumir Balhar [Fri, 13 Oct 2017 13:36:15 +0000 (15:36 +0200)]
pypamtest: Fix Python 2.6 compatibility

PyErr_NewExceptionWithDoc() isn't available in Python 2.6 so it can
be used only in higher versions of Python.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
23 months agoBump version to 1.0.4 pam_wrapper-1.0.4
Andreas Schneider [Mon, 15 May 2017 14:37:44 +0000 (16:37 +0200)]
Bump version to 1.0.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
23 months agopwrap: Do not leak srcfd on error
Andreas Schneider [Tue, 11 Apr 2017 06:39:44 +0000 (08:39 +0200)]
pwrap: Do not leak srcfd on error

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
23 months agopam_wrapper: Fix the build without pam_vsyslog
Volker Lendecke [Mon, 1 May 2017 15:57:27 +0000 (17:57 +0200)]
pam_wrapper: Fix the build without pam_vsyslog

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agoBump version to 1.0.3 pam_wrapper-1.0.3
Andreas Schneider [Thu, 6 Apr 2017 07:55:29 +0000 (09:55 +0200)]
Bump version to 1.0.3

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agodoc: Document PAM_WRAPPER_USE_SYSLOG variable
Andreas Schneider [Thu, 6 Apr 2017 09:51:32 +0000 (11:51 +0200)]
doc: Document PAM_WRAPPER_USE_SYSLOG variable

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agopwrap: Do not log to syslog by default but use our logging
Andreas Schneider [Thu, 6 Apr 2017 09:47:37 +0000 (11:47 +0200)]
pwrap: Do not log to syslog by default but use our logging

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agopwrap: Do an early return in pwrap_vlog if log level doesn't match
Andreas Schneider [Thu, 6 Apr 2017 10:08:54 +0000 (12:08 +0200)]
pwrap: Do an early return in pwrap_vlog if log level doesn't match

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agopwrap: Add pwrap_vlog() functions
Andreas Schneider [Thu, 6 Apr 2017 09:41:12 +0000 (11:41 +0200)]
pwrap: Add pwrap_vlog() functions

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agopwrap: Remove useless break
Andreas Schneider [Thu, 6 Apr 2017 07:56:15 +0000 (09:56 +0200)]
pwrap: Remove useless break

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agolibpamtest: Do not declare variable in for-loop
Andreas Schneider [Thu, 6 Apr 2017 07:15:07 +0000 (09:15 +0200)]
libpamtest: Do not declare variable in for-loop

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agopypamtest: Add sanity checks in new_conv_list()
Andreas Schneider [Thu, 6 Apr 2017 07:13:40 +0000 (09:13 +0200)]
pypamtest: Add sanity checks in new_conv_list()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agopypamtest: Do not use variable declaration in for-loop
Andreas Schneider [Thu, 6 Apr 2017 07:09:53 +0000 (09:09 +0200)]
pypamtest: Do not use variable declaration in for-loop

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2 years agocmake: Add Python 3.6 if we look for the python library
Andreas Schneider [Thu, 30 Mar 2017 06:46:44 +0000 (08:46 +0200)]
cmake: Add Python 3.6 if we look for the python library

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agopwrap: Do not discard const value
Andreas Schneider [Wed, 29 Mar 2017 14:16:18 +0000 (16:16 +0200)]
pwrap: Do not discard const value

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agocmake: Remove unused define
Andreas Schneider [Wed, 29 Mar 2017 13:53:20 +0000 (15:53 +0200)]
cmake: Remove unused define

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agocmake: Do not check for pam_(v)syslog twice
Andreas Schneider [Wed, 29 Mar 2017 13:51:06 +0000 (15:51 +0200)]
cmake: Do not check for pam_(v)syslog twice

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agoBump version to 1.0.2 pam_wrapper-1.0.2
Andreas Schneider [Tue, 24 May 2016 06:00:48 +0000 (08:00 +0200)]
Bump version to 1.0.2

Signed-off-by: Andreas Schneider <asn@samba.org>
2 years agopwrap: Disable audit on BSD
Andreas Schneider [Mon, 9 May 2016 07:51:00 +0000 (09:51 +0200)]
pwrap: Disable audit on BSD

This allows us to use pam_wrapper on BSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agomodules: Add the path where we install the helper PAM modules to the .pc file
Jakub Hrozek [Fri, 6 May 2016 10:00:10 +0000 (12:00 +0200)]
modules: Add the path where we install the helper PAM modules to the .pc file

A test needs to often know where are the helper pam modules
(pam_get_items.so and pam_set_items.so). This patch adds a new variable
to the pkg-config file that lets the user of pam_wrapper query the path
like this:
    $ pkg-config --variable=modules pam_wrapper
    /usr/lib64/pam_wrapper

And use that variable to define their own service files.

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agolibpamtest: Only reply in conversation for echo_on and echo_off
Jakub Hrozek [Thu, 5 May 2016 13:53:46 +0000 (15:53 +0200)]
libpamtest: Only reply in conversation for echo_on and echo_off

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoBump version to 1.0.1 pam_wrapper-1.0.1
Andreas Schneider [Mon, 18 Jan 2016 08:18:56 +0000 (09:18 +0100)]
Bump version to 1.0.1

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Fix a possible timing issue in p_copy()
Andreas Schneider [Fri, 15 Jan 2016 14:20:24 +0000 (15:20 +0100)]
pwrap: Fix a possible timing issue in p_copy()

Do not rely on stat before open - it is racy.
Open directly and treat failure appropriately.

CID: 47518

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Improve p_rmdirs() do avoid timing issues
Jakub Hrozek [Fri, 15 Jan 2016 11:55:51 +0000 (12:55 +0100)]
pwrap: Improve p_rmdirs() do avoid timing issues

When calling stat and rmdir, we could run into timing issues that the
stat information is incorrect till we are actually running the rmdir()
command. So we open the directory and have the handle open to avoid
that we work on outdated information. It is unlikely but Coverity
complains and we thought better fix it.

CID: 47519

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Remove superfloues lstat()
Andreas Schneider [Fri, 15 Jan 2016 10:11:50 +0000 (11:11 +0100)]
pwrap: Remove superfloues lstat()

There is no need to check if the file exists, just try to open it.

CID: 47520

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Make sure we have a terminating null byte
Andreas Schneider [Fri, 15 Jan 2016 10:44:14 +0000 (11:44 +0100)]
pwrap: Make sure we have a terminating null byte

This is just to silence Coverity.

CID: 47508

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopam_matrix: Set a secure umask before calling mkstemp()
Andreas Schneider [Fri, 15 Jan 2016 10:38:00 +0000 (11:38 +0100)]
pam_matrix: Set a secure umask before calling mkstemp()

CID: 47516

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Return EPROTONOSUPPORT in audit_open()
Andreas Schneider [Thu, 14 Jan 2016 16:04:33 +0000 (17:04 +0100)]
pwrap: Return EPROTONOSUPPORT in audit_open()

I don't know why but returning EINVAL doesn't work. It treats it as
success and tries to write to it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agocmake: Link python module against the python library
Andreas Schneider [Thu, 14 Jan 2016 16:04:07 +0000 (17:04 +0100)]
cmake: Link python module against the python library

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agocmake: Do not require a C++ compiler
Andreas Schneider [Thu, 14 Jan 2016 12:46:01 +0000 (13:46 +0100)]
cmake: Do not require a C++ compiler

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoInitial release of pam_wrapper 1.0.0
Andreas Schneider [Wed, 13 Jan 2016 08:42:09 +0000 (09:42 +0100)]
Initial release of pam_wrapper 1.0.0

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopam_matrix: Call umask before mkstemp()
Andreas Schneider [Wed, 13 Jan 2016 09:57:44 +0000 (10:57 +0100)]
pam_matrix: Call umask before mkstemp()

Without calling umask() we create and use insecure temporary files that
can leave application and system data vulnerable to attack. Unlikely in
a module created for testing, but better fix it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Make sure pam_library is null-terminated
Andreas Schneider [Wed, 13 Jan 2016 09:54:36 +0000 (10:54 +0100)]
pwrap: Make sure pam_library is null-terminated

We initialize the array with 0. So do not pass the full size of the
array to make sure the last byte is a null byte.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolibpamtest: Make sure ri is not used uninitialized
Andreas Schneider [Wed, 13 Jan 2016 09:50:05 +0000 (10:50 +0100)]
libpamtest: Make sure ri is not used uninitialized

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopwrap: Wrap audit_open() to fix sshd
Andreas Schneider [Fri, 18 Dec 2015 10:10:53 +0000 (11:10 +0100)]
pwrap: Wrap audit_open() to fix sshd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agoCoverity: Remove deadcode
Jakub Hrozek [Wed, 16 Dec 2015 14:17:42 +0000 (15:17 +0100)]
Coverity: Remove deadcode

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agoCoverity: Fix memory leak in libpamtest on error
Jakub Hrozek [Wed, 16 Dec 2015 14:20:48 +0000 (15:20 +0100)]
Coverity: Fix memory leak in libpamtest on error

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopython: Remove dead code in test_result_list_concat()
Andreas Schneider [Wed, 16 Dec 2015 14:19:56 +0000 (15:19 +0100)]
python: Remove dead code in test_result_list_concat()

There is a NULL check already above and the XDECREF does not set the
object to NULL.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agotests: Fix a possible memory leak in pwrap_conv()
Andreas Schneider [Wed, 16 Dec 2015 14:16:36 +0000 (15:16 +0100)]
tests: Fix a possible memory leak in pwrap_conv()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agotests: Do not dreference key before NULL check in string_in_list()
Andreas Schneider [Wed, 16 Dec 2015 14:13:59 +0000 (15:13 +0100)]
tests: Do not dreference key before NULL check in string_in_list()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agocmake: Link pam_wrapper to libdl
Andreas Schneider [Wed, 16 Dec 2015 14:02:43 +0000 (15:02 +0100)]
cmake: Link pam_wrapper to libdl

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agodoc: Also install pam_matrix manpage
Jakub Hrozek [Wed, 16 Dec 2015 12:40:13 +0000 (13:40 +0100)]
doc: Also install pam_matrix manpage

Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agocmake: Install pypamtest
Andreas Schneider [Wed, 16 Dec 2015 09:48:14 +0000 (10:48 +0100)]
cmake: Install pypamtest

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agocmake: Find the python executable and site libs
Andreas Schneider [Wed, 16 Dec 2015 09:36:22 +0000 (10:36 +0100)]
cmake: Find the python executable and site libs

This is needed to find the PYTHON_SITELIB directory for module
installation.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agocmake: Add FindPythonSiteLibs.cmake
Andreas Schneider [Wed, 16 Dec 2015 09:29:29 +0000 (10:29 +0100)]
cmake: Add FindPythonSiteLibs.cmake

This adds support do discover PYTHON_SITELIB location.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agocmake: Use python_add_module function
Andreas Schneider [Wed, 16 Dec 2015 09:16:32 +0000 (10:16 +0100)]
cmake: Use python_add_module function

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopwrap: Do not close negative fds in p_copy()
Andreas Schneider [Wed, 16 Dec 2015 14:24:13 +0000 (15:24 +0100)]
pwrap: Do not close negative fds in p_copy()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopwrap: Fix a resource leak in p_rmdirs()
Andreas Schneider [Wed, 16 Dec 2015 14:22:09 +0000 (15:22 +0100)]
pwrap: Fix a resource leak in p_rmdirs()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopwrap: Add more debug messages if something goes wrong
Andreas Schneider [Fri, 18 Dec 2015 09:50:47 +0000 (10:50 +0100)]
pwrap: Add more debug messages if something goes wrong

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopwrap: Do not fail on EOL in pwrap_clean_stale_dirs()
Andreas Schneider [Fri, 18 Dec 2015 09:50:29 +0000 (10:50 +0100)]
pwrap: Do not fail on EOL in pwrap_clean_stale_dirs()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopwrap: Close the pidfile in pwrap_init()
Andreas Schneider [Fri, 18 Dec 2015 09:49:00 +0000 (10:49 +0100)]
pwrap: Close the pidfile in pwrap_init()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopwrap: Add log message for directory cleanup
Andreas Schneider [Fri, 18 Dec 2015 09:26:14 +0000 (10:26 +0100)]
pwrap: Add log message for directory cleanup

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
3 years agopy: Fix strict aliasing rules in initpypamtest()
Andreas Schneider [Thu, 10 Dec 2015 16:36:09 +0000 (17:36 +0100)]
py: Fix strict aliasing rules in initpypamtest()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopy: Fix strict aliasing rules in set_pypamtest_exception()
Andreas Schneider [Thu, 10 Dec 2015 16:35:51 +0000 (17:35 +0100)]
py: Fix strict aliasing rules in set_pypamtest_exception()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopy: Make sure we do not use failed uninitialized
Andreas Schneider [Thu, 10 Dec 2015 16:32:18 +0000 (17:32 +0100)]
py: Make sure we do not use failed uninitialized

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agopy: Make sure we do not dereference a NULL pointer
Andreas Schneider [Thu, 10 Dec 2015 16:30:57 +0000 (17:30 +0100)]
py: Make sure we do not dereference a NULL pointer

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolibpamtest: Do not call pam_end() if tc is not set
Andreas Schneider [Thu, 10 Dec 2015 16:13:52 +0000 (17:13 +0100)]
libpamtest: Do not call pam_end() if tc is not set

This fixes a build warning.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agolibpamtest: Make sure reply is initialized
Andreas Schneider [Thu, 10 Dec 2015 16:10:55 +0000 (17:10 +0100)]
libpamtest: Make sure reply is initialized

Fixes a build warning

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agotests: Do not run python test if python is not present
Andreas Schneider [Thu, 10 Dec 2015 16:03:46 +0000 (17:03 +0100)]
tests: Do not run python test if python is not present

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
3 years agoctest: Drop ctest results via https
Andreas Schneider [Thu, 10 Dec 2015 15:03:49 +0000 (16:03 +0100)]
ctest: Drop ctest results via https

Signed-off-by: Andreas Schneider <asn@samba.org>
3 years agotests: Fix printf attribute warnings
Andreas Schneider [Wed, 25 Nov 2015 15:53:01 +0000 (16:53 +0100)]
tests: Fix printf attribute warnings

Signed-off-by: Andreas Schneider <asn@samba.org>
3 years agopam_matrix: Add OpenPAM (BSD) support
Andreas Schneider [Fri, 20 Nov 2015 14:03:25 +0000 (15:03 +0100)]
pam_matrix: Add OpenPAM (BSD) support

Includes:
    - pwrap: Fix errno if ENODATA is not available
    - nwrap: Add FTW return values if not defined
    - pwrap: Add support for BSD prompt and strerror functions
    - pwrap: Add detection for pam_syslog and pam_vsyslog

3 years agocmake: Add cmake config files for libpamtest
Andreas Schneider [Wed, 11 Nov 2015 15:37:12 +0000 (16:37 +0100)]
cmake: Add cmake config files for libpamtest

Signed-off-by: Andreas Schneider <asn@samba.org>
3 years agocmake: Ignore build directories
Andreas Schneider [Wed, 11 Nov 2015 15:29:03 +0000 (16:29 +0100)]
cmake: Ignore build directories

Signed-off-by: Andreas Schneider <asn@samba.org>
3 years agocmake: Set correct versions for libraries
Andreas Schneider [Wed, 11 Nov 2015 15:28:38 +0000 (16:28 +0100)]
cmake: Set correct versions for libraries

Signed-off-by: Andreas Schneider <asn@samba.org>
3 years agopython: Support python2
Andreas Schneider [Tue, 10 Nov 2015 14:53:08 +0000 (15:53 +0100)]
python: Support python2

3 years agolibpamtest: Add Python bindings
Jakub Hrozek [Wed, 4 Nov 2015 15:59:41 +0000 (16:59 +0100)]
libpamtest: Add Python bindings

So far only for Python3

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

3 years agopwrap: Add pamtest_strerror()
Jakub Hrozek [Thu, 5 Nov 2015 21:20:53 +0000 (22:20 +0100)]
pwrap: Add pamtest_strerror()

3 years agoImprove build
Andreas Schneider [Thu, 5 Nov 2015 20:12:10 +0000 (21:12 +0100)]
Improve build

3 years agos/PAM_WRAPPER_CONFDIR/PAM_WRAPPER_SERVICEDIR
Andreas Schneider [Tue, 3 Nov 2015 15:05:39 +0000 (16:05 +0100)]
s/PAM_WRAPPER_CONFDIR/PAM_WRAPPER_SERVICEDIR

3 years agoSQ into clean stale dirs
Jakub Hrozek [Wed, 25 Nov 2015 15:12:09 +0000 (16:12 +0100)]
SQ into clean stale dirs

3 years agopwrap: Clean stale dirs
Andreas Schneider [Tue, 3 Nov 2015 14:44:32 +0000 (15:44 +0100)]
pwrap: Clean stale dirs

3 years agolibpamtest: Handle NULL passwords in libpamtest
Jakub Hrozek [Mon, 2 Nov 2015 19:59:28 +0000 (20:59 +0100)]
libpamtest: Handle NULL passwords in libpamtest