summaryrefslogtreecommitdiff
path: root/libpam/pam_private.h
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2001-01-22 06:07:28 +0000
committerAndrew G. Morgan <morgan@kernel.org>2001-01-22 06:07:28 +0000
commit9fb9393ede4ee9d43ff841557f95ed2af7d1a15f (patch)
tree34a3323fac5906ceb5aa54b5d482090bdaba47c0 /libpam/pam_private.h
parente6d5049a8d484fb7a764a125d830b23f59a0c685 (diff)
Relevant BUGIDs: 129027, 128576
Purpose of commit: new feature + documentation Commit summary: --------------- Cleaned up the handling of AUTHTOK items and pam_[gs]et_data() functions. Added more clear documentation about the pam_[gs]et_item() functions to the pam_appl and pam_modules programmer guides.
Diffstat (limited to 'libpam/pam_private.h')
-rw-r--r--libpam/pam_private.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/libpam/pam_private.h b/libpam/pam_private.h
index 7b36fb02..2aa90bd4 100644
--- a/libpam/pam_private.h
+++ b/libpam/pam_private.h
@@ -126,6 +126,7 @@ struct _pam_former_state {
struct pam_handle {
char *authtok;
+ unsigned caller_is;
struct pam_conv *pam_conversation;
char *oldauthtok;
char *prompt; /* for use by pam_get_user() */
@@ -268,9 +269,22 @@ if ((pamh) == NULL) { \
#include <security/_pam_macros.h>
+/* used to work out where control currently resides (in an application
+ or in a module) */
+
+#define _PAM_CALLED_FROM_MODULE 1
+#define _PAM_CALLED_FROM_APP 2
+
+#define __PAM_FROM_MODULE(pamh) ((pamh)->caller_is == _PAM_CALLED_FROM_MODULE)
+#define __PAM_FROM_APP(pamh) ((pamh)->caller_is == _PAM_CALLED_FROM_APP)
+#define __PAM_TO_MODULE(pamh) \
+ do { (pamh)->caller_is = _PAM_CALLED_FROM_MODULE; } while (0)
+#define __PAM_TO_APP(pamh) \
+ do { (pamh)->caller_is = _PAM_CALLED_FROM_APP; } while (0)
+
/*
* Copyright (C) 1995 by Red Hat Software, Marc Ewing
- * Copyright (c) 1996-8, Andrew G. Morgan <morgan@linux.kernel.org>
+ * Copyright (c) 1996-8,2001 by Andrew G. Morgan <morgan@kernel.org>
*
* All rights reserved
*