summaryrefslogtreecommitdiffstats
path: root/contrib/openpam
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-04-12 18:31:28 +0000
committerdes <des@FreeBSD.org>2002-04-12 18:31:28 +0000
commit5b1e560369f4afd65eb9fc3ffbccc9d3e688dc7e (patch)
tree88dbbaea09dd4debd7af79330f100ea07b50a5f7 /contrib/openpam
parent360a2d8d7395b0d8fbfa1af54748ae10dec0ed90 (diff)
downloadFreeBSD-src-5b1e560369f4afd65eb9fc3ffbccc9d3e688dc7e.zip
FreeBSD-src-5b1e560369f4afd65eb9fc3ffbccc9d3e688dc7e.tar.gz
Linux-PAM compatibility improvements (perforce change 9623)
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'contrib/openpam')
-rw-r--r--contrib/openpam/include/security/openpam.h46
-rw-r--r--contrib/openpam/include/security/pam_modules.h14
2 files changed, 56 insertions, 4 deletions
diff --git a/contrib/openpam/include/security/openpam.h b/contrib/openpam/include/security/openpam.h
index 214401a..e2fdf0a 100644
--- a/contrib/openpam/include/security/openpam.h
+++ b/contrib/openpam/include/security/openpam.h
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/include/security/openpam.h#15 $
+ * $P4: //depot/projects/openpam/include/security/openpam.h#16 $
*/
#ifndef _SECURITY_OPENPAM_H_INCLUDED
@@ -208,6 +208,46 @@ struct pam_module {
};
/*
+ * Source-code compatibility with Linux-PAM modules
+ */
+#if defined(PAM_SM_AUTH) || defined(PAM_SM_ACCOUNT) || \
+ defined(PAM_SM_SESSION) || defined(PAM_SM_PASSWORD)
+#define LINUX_PAM_MODULE
+#endif
+#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_AUTH)
+#define _PAM_SM_AUTHENTICATE 0
+#define _PAM_SM_SETCRED 0
+#else
+#undef PAM_SM_AUTH
+#define PAM_SM_AUTH
+#define _PAM_SM_AUTHENTICATE pam_sm_authenticate
+#define _PAM_SM_SETCRED pam_sm_setcred
+#endif
+#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_ACCOUNT)
+#define _PAM_SM_ACCT_MGMT 0
+#else
+#undef PAM_SM_ACCOUNT
+#define PAM_SM_ACCOUNT
+#define _PAM_SM_ACCT_MGMT pam_sm_acct_mgmt
+#endif
+#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_SESSION)
+#define _PAM_SM_OPEN_SESSION 0
+#define _PAM_SM_CLOSE_SESSION 0
+#else
+#undef PAM_SM_SESSION
+#define PAM_SM_SESSION
+#define _PAM_SM_OPEN_SESSION pam_sm_open_session
+#define _PAM_SM_CLOSE_SESSION pam_sm_close_session
+#endif
+#if defined(LINUX_PAM_MODULE) && !defined(PAM_SM_PASSWORD)
+#define _PAM_SM_CHAUTHTOK 0
+#else
+#undef PAM_SM_PASSWORD
+#define PAM_SM_PASSWORD
+#define _PAM_SM_CHAUTHTOK pam_sm_chauthtok
+#endif
+
+/*
* Infrastructure for static modules using GCC linker sets.
* You are not expected to understand this.
*/
@@ -227,8 +267,8 @@ struct pam_module {
#define PAM_MODULE_ENTRY(name) \
static char _pam_name[] = name PAM_SOEXT; \
static struct pam_module _pam_module = { _pam_name, { \
- pam_sm_authenticate, pam_sm_setcred, pam_sm_acct_mgmt, \
- pam_sm_open_session, pam_sm_close_session, pam_sm_chauthtok }, \
+ _PAM_SM_AUTHENTICATE, _PAM_SM_SETCRED, _PAM_SM_ACCT_MGMT, \
+ _PAM_SM_OPEN_SESSION, _PAM_SM_CLOSE_SESSION, _PAM_SM_CHAUTHTOK }, \
NULL, 0, NULL, NULL }; \
DATA_SET(_openpam_static_modules, _pam_module)
#else
diff --git a/contrib/openpam/include/security/pam_modules.h b/contrib/openpam/include/security/pam_modules.h
index 4cbb5c2..1359a1b 100644
--- a/contrib/openpam/include/security/pam_modules.h
+++ b/contrib/openpam/include/security/pam_modules.h
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/include/security/pam_modules.h#6 $
+ * $P4: //depot/projects/openpam/include/security/pam_modules.h#7 $
*/
#ifndef _PAM_MODULES_H_INCLUDED
@@ -49,41 +49,53 @@ extern "C" {
* XSSO 4.2.2, 6
*/
+#if defined(PAM_SM_ACCOUNT)
PAM_EXTERN int
pam_sm_acct_mgmt(pam_handle_t *_pamh,
int _flags,
int _argc,
const char **_argv);
+#endif
+#if defined(PAM_SM_AUTH)
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *_pamh,
int _flags,
int _argc,
const char **_argv);
+#endif
+#if defined(PAM_SM_PASSWORD)
PAM_EXTERN int
pam_sm_chauthtok(pam_handle_t *_pamh,
int _flags,
int _argc,
const char **_argv);
+#endif
+#if defined(PAM_SM_SESSION)
PAM_EXTERN int
pam_sm_close_session(pam_handle_t *_pamh,
int _flags,
int _args,
const char **_argv);
+#endif
+#if defined(PAM_SM_SESSION)
PAM_EXTERN int
pam_sm_open_session(pam_handle_t *_pamh,
int _flags,
int _argc,
const char **_argv);
+#endif
+#if defined(PAM_SM_AUTH)
PAM_EXTERN int
pam_sm_setcred(pam_handle_t *_pamh,
int _flags,
int _argc,
const char **_argv);
+#endif
/*
* Single Sign-On extensions
OpenPOWER on IntegriCloud