summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-09-05 08:23:10 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-09-05 08:23:10 +0000
commita5a544c2d2ce3c14c07a209a0e7b45e091391587 (patch)
treee7939c32ef6a478a315285319bcb56912c395de8 /modules
parentd28209cfb0604a404c694283cf6ec8d17beeac5f (diff)
Relevant BUGIDs: none
Purpose of commit: cleanup Commit summary: --------------- Replace conv function call with pam_info()
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_motd/pam_motd.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/modules/pam_motd/pam_motd.c b/modules/pam_motd/pam_motd.c
index 5cea38bf..88a334d8 100644
--- a/modules/pam_motd/pam_motd.c
+++ b/modules/pam_motd/pam_motd.c
@@ -22,6 +22,7 @@
#include <pwd.h>
#include <security/_pam_macros.h>
+#include <security/pam_ext.h>
/*
* here, we make a definition for the externally accessible function
* in this file (this definition is required for static a module
@@ -75,17 +76,13 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
motd_path = default_motd;
while ((fd = open(motd_path, O_RDONLY, 0)) >= 0) {
- const void *void_conv = NULL;
- struct pam_message message;
- struct pam_message *pmessage = &message;
- struct pam_response *resp = NULL;
struct stat st;
/* fill in message buffer with contents of motd */
if ((fstat(fd, &st) < 0) || !st.st_size || st.st_size > 0x10000)
break;
- if (!(message.msg = mtmp = malloc(st.st_size+1)))
+ if (!(mtmp = malloc(st.st_size+1)))
break;
if (_pammodutil_read(fd, mtmp, st.st_size) != st.st_size)
@@ -96,17 +93,9 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
else
mtmp[st.st_size] = '\0';
- message.msg_style = PAM_TEXT_INFO;
- /* Use conversation function to give user contents of motd */
- if (pam_get_item(pamh, PAM_CONV, &void_conv) == PAM_SUCCESS
- && void_conv) {
- const struct pam_conv *conversation = void_conv;
- conversation->conv(1, (const struct pam_message **)&pmessage,
- &resp, conversation->appdata_ptr);
- if (resp)
- _pam_drop_reply(resp, 1);
- }
+ pam_info (pamh, "%s", mtmp);
+ _pam_drop (mtmp);
break;
}