summaryrefslogtreecommitdiffstats
path: root/sesman/verify_user_pam.c
diff options
context:
space:
mode:
Diffstat (limited to 'sesman/verify_user_pam.c')
-rw-r--r--sesman/verify_user_pam.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sesman/verify_user_pam.c b/sesman/verify_user_pam.c
index a2b3f93a..73e0b63f 100644
--- a/sesman/verify_user_pam.c
+++ b/sesman/verify_user_pam.c
@@ -54,19 +54,19 @@ verify_pam_conv(int num_msg, const struct pam_message **msg,
struct pam_response *reply;
struct t_user_pass *user_pass;
- reply = g_malloc(sizeof(struct pam_response) * num_msg, 1);
+ reply = g_new0(struct pam_response, num_msg);
for (i = 0; i < num_msg; i++)
{
switch (msg[i]->msg_style)
{
case PAM_PROMPT_ECHO_ON: /* username */
- user_pass = appdata_ptr;
+ user_pass = (struct t_user_pass *) appdata_ptr;
reply[i].resp = g_strdup(user_pass->user);
reply[i].resp_retcode = PAM_SUCCESS;
break;
case PAM_PROMPT_ECHO_OFF: /* password */
- user_pass = appdata_ptr;
+ user_pass = (struct t_user_pass *) appdata_ptr;
reply[i].resp = g_strdup(user_pass->pass);
reply[i].resp_retcode = PAM_SUCCESS;
break;
@@ -102,14 +102,14 @@ get_service_name(char *service_name)
Stores the detailed error code in the errorcode variable*/
long DEFAULT_CC
-auth_userpass(char *user, char *pass, int *errorcode)
+auth_userpass(const char *user, const char *pass, int *errorcode)
{
int error;
struct t_auth_info *auth_info;
char service_name[256];
get_service_name(service_name);
- auth_info = g_malloc(sizeof(struct t_auth_info), 1);
+ auth_info = g_new0(struct t_auth_info, 1);
g_strncpy(auth_info->user_pass.user, user, 255);
g_strncpy(auth_info->user_pass.pass, pass, 255);
auth_info->pamc.conv = &verify_pam_conv;