From a1364acb4b5db7e9b280d3eaf4e792515eed5d4a Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 25 Jun 2009 09:49:59 -0400 Subject: [PATCH] Implement _pam_overwrite_n(n,x) for older systems OSes based on older versions of the PAM development libraries lack the _pam_overwrite_n(n,x) macro. This patch copies the Fedora 11 pam-devel-1.0.91-6 implementation into an SSSD private header. This affects RHEL5 and SUSE10. --- sss_client/pam_sss.c | 1 + sss_client/sss_pam_macros.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 0 deletions(-) create mode 100644 sss_client/sss_pam_macros.h diff --git a/sss_client/pam_sss.c b/sss_client/pam_sss.c index a3ae9cc..a10e0ea 100644 --- a/sss_client/pam_sss.c +++ b/sss_client/pam_sss.c @@ -14,6 +14,7 @@ #include #include #include +#include "sss_pam_macros.h" #include "sss_cli.h" diff --git a/sss_client/sss_pam_macros.h b/sss_client/sss_pam_macros.h new file mode 100644 index 0000000..c441a83 --- /dev/null +++ b/sss_client/sss_pam_macros.h @@ -0,0 +1,30 @@ +/* + * System Security Services Daemon. Client Interface for NSS and PAM. + * + * Copyright (C) Simo Sorce 2007 + * + * You can used this header file in any way you see fit provided copyright + * notices are preserved. + * + */ + +#ifndef _SSS_PAM_MACROS_H +#define _SSS_PAM_MACROS_H + +/* Older versions of the pam development headers do not include the + * _pam_overwrite_n(n,x) macro. This implementation is copied from + * the Fedora 11 _pam_macros.h. + */ +#include +#ifndef _pam_overwrite_n +#define _pam_overwrite_n(x,n) \ +do { \ + register char *__xx__; \ + register unsigned int __i__ = 0; \ + if ((__xx__=(x))) \ + for (;__i__