[PATCH] Update pam_wrapper to version 1.0.5

Andreas Schneider asn at samba.org
Fri Feb 23 08:39:39 UTC 2018


On Friday, 23 February 2018 02:08:30 CET Timur I. Bakeyev wrote:
> Hi, Andreas!
> 
> That patch worked for me, but to get things work on FreeBSD fully we need
> to add one more small patch:
> 
> --- a/third_party/pam_wrapper/libpamtest.h.orig 2017-11-26
> 03:55:52.608871000 +0100
> +++ b/third_party/pam_wrapper/libpamtest.h      2017-11-26
> 03:56:07.925369000 +0100
> @@ -21,6 +21,7 @@
> 
>  #include <stdint.h>
>  #include <security/pam_appl.h>
> +#include "config.h"

config.h should normally never be included in the .h file. So this should go 
to the .c file and also needs to be done upstream!


	Andreas

> 
>  /**
>   * @defgroup pamtest The pamtest API
> ---
> 
> 
> That is necessary to obtain ` HAVE_UINTPTR_T ` to get proper definition of
> the `discard_const_p`:
> 
> #ifndef discard_const_p
> #if defined(__intptr_t_defined) || defined(HAVE_UINTPTR_T)
> # define discard_const_p(type, ptr) ((type *)((uintptr_t)(ptr)))
> #else
> # define discard_const_p(type, ptr) ((type *)(ptr))
> #endif
> #endif
> 
> Otherwise we end up with the numerous type cast errors:
> 
> ../third_party/pam_wrapper/python/pypamtest.c:117:14: error: cast from
> 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
>                 PyMem_Free(discard_const_p(char, list[i]));
>                            ^
> ../third_party/pam_wrapper/python/pypamtest.c:30:46: note: expanded from
> macro 'discard_const_p'
> # define discard_const_p(type, ptr) ((type *)(ptr))
>                                              ^
> ....
> ../third_party/pam_wrapper/python/pypamtest.c:1040:49: error: cast from
> 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
>         PyExc_PamTestError =
> PyErr_NewExceptionWithDoc(discard_const_p(char, "pypamtest.PamTestError"),
>                                                        ^
> ../third_party/pam_wrapper/python/pypamtest.c:30:46: note: expanded from
> macro 'discard_const_p'
> # define discard_const_p(type, ptr) ((type *)(ptr))
>                                              ^
> ../third_party/pam_wrapper/python/pypamtest.c:1055:30: error: cast from
> 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
>         ret = PyModule_AddObject(m, discard_const_p(char, "PamTestError"),
>                                     ^
> ../third_party/pam_wrapper/python/pypamtest.c:30:46: note: expanded from
> macro 'discard_const_p'
> # define discard_const_p(type, ptr) ((type *)(ptr))
>                                              ^
> 18 errors generated.
> 
> With regards,
> Timur Bakeyev.
> 
> 
> 
> On 22 February 2018 at 17:07, Andreas Schneider via samba-technical <
> 
> samba-technical at lists.samba.org> wrote:
> > Hi,
> > 
> > the attached patch updates pam_wrapper to version 1.0.5. From the upstream
> > 
> > changelog:
> >   * Added support to build python2 and python3 module at the same time
> >   * Improved pam test directory creating
> >   * Fixed python 2.6 compatibilty
> >   * Fixed some build issues on FreeBSD
> > 
> > Some patches have already been applied to the Samba source tree.
> > 
> > 
> > Review is welcome, if OK please push if possible.
> > 
> > 
> > Thanks,
> > 
> >         Andreas
> > 
> > --
> > Andreas Schneider                   GPG-ID: CC014E3D
> > Samba Team                             asn at samba.org
> > www.samba.org







More information about the samba-technical mailing list