summaryrefslogtreecommitdiff
path: root/modules/pam_lastlog
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-06-09 17:29:18 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-06-09 17:29:18 +0000
commit0a7fe016a03184815b03fe92d50c58e67c8c05fc (patch)
treeb9c25dd0fbbb71e08b2826e046b763facdcff8df /modules/pam_lastlog
parentfa433b9e2fa1a00e13df36a8b709ffda9e3e715b (diff)
Relevant BUGIDs: none
Purpose of commit: cleanup Commit summary: --------------- Fix all occurrence of dereferencing type-punned pointer will break strict-aliasing rules warnings
Diffstat (limited to 'modules/pam_lastlog')
-rw-r--r--modules/pam_lastlog/pam_lastlog.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/modules/pam_lastlog/pam_lastlog.c b/modules/pam_lastlog/pam_lastlog.c
index e9eeac4e..e9c89786 100644
--- a/modules/pam_lastlog/pam_lastlog.c
+++ b/modules/pam_lastlog/pam_lastlog.c
@@ -145,11 +145,13 @@ static int converse(pam_handle_t *pamh, int ctrl, int nargs
, struct pam_response **response)
{
int retval;
- struct pam_conv *conv;
+ const void *void_conv;
+ const struct pam_conv *conv;
D(("begin to converse"));
- retval = pam_get_item( pamh, PAM_CONV, (const void **) &conv ) ;
+ retval = pam_get_item( pamh, PAM_CONV, &void_conv ) ;
+ conv = (const struct pam_conv *)void_conv;
if ( retval == PAM_SUCCESS && conv) {
retval = conv->conv(nargs, ( const struct pam_message ** ) message
@@ -325,8 +327,9 @@ static int last_login_date(pam_handle_t *pamh, int announce, uid_t uid)
/* write latest value */
{
time_t ll_time;
- const char *remote_host=NULL
- , *terminal_line=DEFAULT_TERM;
+ const void *remote_host=NULL
+ , *void_terminal_line=DEFAULT_TERM;
+ const char *terminal_line;
/* set this login date */
D(("set the most recent login time"));
@@ -335,7 +338,7 @@ static int last_login_date(pam_handle_t *pamh, int announce, uid_t uid)
last_login.ll_time = ll_time;
/* set the remote host */
- (void) pam_get_item(pamh, PAM_RHOST, (const void **)&remote_host);
+ (void) pam_get_item(pamh, PAM_RHOST, &remote_host);
if (remote_host == NULL) {
remote_host = DEFAULT_HOST;
}
@@ -347,7 +350,8 @@ static int last_login_date(pam_handle_t *pamh, int announce, uid_t uid)
remote_host = NULL;
/* set the terminal line */
- (void) pam_get_item(pamh, PAM_TTY, (const void **)&terminal_line);
+ (void) pam_get_item(pamh, PAM_TTY, &void_terminal_line);
+ terminal_line = void_terminal_line;
D(("terminal = %s", terminal_line));
if (terminal_line == NULL) {
terminal_line = DEFAULT_TERM;
@@ -404,7 +408,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc
, const char **argv)
{
int retval, ctrl;
- const char *user;
+ const void *user;
const struct passwd *pwd;
uid_t uid;
@@ -417,8 +421,8 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc
/* which user? */
- retval = pam_get_item(pamh, PAM_USER, (const void **)&user);
- if (retval != PAM_SUCCESS || user == NULL || *user == '\0') {
+ retval = pam_get_item(pamh, PAM_USER, &user);
+ if (retval != PAM_SUCCESS || user == NULL || *(const char *)user == '\0') {
_log_err(LOG_NOTICE, "user unknown");
return PAM_USER_UNKNOWN;
}