diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-05-06 21:40:22 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-05-06 21:40:22 +0000 |
commit | 1de2966d79a7f2da8eb72163504ceb758deeab82 (patch) | |
tree | 3e579427a085931cd024fa11b542cd3f4963ba0a /compat | |
parent | dd37becef636fe0f47e934f5a4e76c79dbf0188f (diff) |
implement a minimum_uid option for the PAM module to ignore users that have a lower numeric user id
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1082 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'compat')
-rw-r--r-- | compat/pam_compat.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compat/pam_compat.h b/compat/pam_compat.h index 5967638..c453061 100644 --- a/compat/pam_compat.h +++ b/compat/pam_compat.h @@ -1,7 +1,7 @@ /* pam_compat.h - provide a replacement definitions for some pam functions - Copyright (C) 2009 Arthur de Jong + Copyright (C) 2009, 2010 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,9 +33,20 @@ #else /* not HAVE_PAM_PAM_MODULES_H */ #include <pam/pam_modules.h> #endif /* not HAVE_PAM_PAM_MODULES_H */ +#ifdef HAVE_SECURITY_PAM_MODUTIL_H +#include <security/pam_modutil.h> +#endif /* HAVE_SECURITY_PAM_MODUTIL_H */ +/* define our own replacement pam_get_authtok() if it wasn't found */ #ifndef HAVE_PAM_GET_AUTHTOK int pam_get_authtok(pam_handle_t *pamh,int item,const char **authtok,const char *prompt); #endif /* HAVE_PAM_GET_AUTHTOK */ +/* fall back to using getpwnam() if pam_modutil_getpwnam() isn't defined */ +#ifndef HAVE_PAM_MODUTIL_GETGWNAM +#include <sys/types.h> +#include <pwd.h> +#define pam_modutil_getpwnam(pamh,user) getpwnam(user) +#endif /* not HAVE_PAM_MODUTIL_GETGWNAM */ + #endif /* _COMPAT_LDAP_COMPAT_H */ |