diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2014-05-27 23:55:17 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-06-03 10:01:15 +0200 |
commit | 683e1f67d08be7165ea456d4594c4c8a4eddc9b3 (patch) | |
tree | 97841eec89ba1708d55c874b64d660c3390a3614 /src/sss_client | |
parent | 78eae10aa035bc0e0996189b9d11c8db4904a98d (diff) | |
download | sssd-683e1f67d08be7165ea456d4594c4c8a4eddc9b3.tar.gz sssd-683e1f67d08be7165ea456d4594c4c8a4eddc9b3.tar.xz sssd-683e1f67d08be7165ea456d4594c4c8a4eddc9b3.zip |
PAM: Define compatible macros for some functions.
Functions pam_vsyslog and pam_modutil_getlogin are not available in openpam.
This patch conditionally define macros for these function if they are not
available. Compatible macros use standard functions vsyslog, getlogin
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/sss_client')
-rw-r--r-- | src/sss_client/pam_sss.c | 4 | ||||
-rw-r--r-- | src/sss_client/sss_pam_compat.h | 45 |
2 files changed, 47 insertions, 2 deletions
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c index a24292974..d4baa19b6 100644 --- a/src/sss_client/pam_sss.c +++ b/src/sss_client/pam_sss.c @@ -35,8 +35,8 @@ #include <security/pam_modules.h> #include <security/pam_appl.h> -#include <security/pam_ext.h> -#include <security/pam_modutil.h> + +#include "sss_pam_compat.h" #include "sss_pam_macros.h" #include "sss_cli.h" diff --git a/src/sss_client/sss_pam_compat.h b/src/sss_client/sss_pam_compat.h new file mode 100644 index 000000000..d131ceacb --- /dev/null +++ b/src/sss_client/sss_pam_compat.h @@ -0,0 +1,45 @@ +/* + SSSD + + Compat declarations for PAM. + + Authors: + Lukas Slebodnik <lslebodn@redhat.com> + + Copyright (C) Red Hat, Inc 2014 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _SSS_PAM_COMPAT_H +#define _SSS_PAM_COMPAT_H + +#ifdef HAVE_SECURITY_PAM_MODUTIL_H +# include <security/pam_modutil.h> +#endif /* HAVE_SECURITY_PAM_MODUTIL_H */ + +#ifdef HAVE_SECURITY_PAM_EXT_H +# include <security/pam_ext.h> +#endif /* HAVE_SECURITY_PAM_EXT_H */ + +#ifndef HAVE_PAM_VSYSLOG +#define pam_vsyslog(pamh, priority, fmt, vargs) \ + vsyslog((priority), (fmt), (vargs)) +#endif /* HAVE_PAM_VSYSLOG */ + +#ifndef PAM_BAD_ITEM +# define PAM_BAD_ITEM PAM_USER_UNKNOWN +#endif /* PAM_BAD_ITEM */ + +#endif /* _SSS_PAM_COMPAT_H */ |