From e9a0324cb3b5f10b94fdd9fdf260fadc075d7e82 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 6 Nov 2016 20:01:49 -0800 Subject: [PATCH] Fix compile warnings for non-default authentication methods Include string.h for strcmp(). Don't define _XOPEN_SOURCE, it conflicts with libc headers and hides putpwent(). Make input strings constant. Fix functions to match their declarations. --- sesman/verify_user.c | 6 +++--- sesman/verify_user_bsd.c | 2 +- sesman/verify_user_kerberos.c | 12 ++++++------ sesman/verify_user_pam_userpass.c | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sesman/verify_user.c b/sesman/verify_user.c index 72830236..adfef908 100644 --- a/sesman/verify_user.c +++ b/sesman/verify_user.c @@ -26,8 +26,8 @@ #include "sesman.h" -#define _XOPEN_SOURCE #include +#include #include #include #include @@ -40,7 +40,7 @@ extern struct config_sesman *g_cfg; /* in sesman.c */ static int DEFAULT_CC -auth_crypt_pwd(char *pwd, char *pln, char *crp); +auth_crypt_pwd(const char *pwd, const char *pln, char *crp); static int DEFAULT_CC auth_account_disabled(struct spwd *stp); @@ -256,7 +256,7 @@ auth_change_pwd(const char *user, const char *newpwd) */ static int DEFAULT_CC -auth_crypt_pwd(char *pwd, char *pln, char *crp) +auth_crypt_pwd(const char *pwd, const char *pln, char *crp) { char salt[13] = "$1$"; int saltcnt = 0; diff --git a/sesman/verify_user_bsd.c b/sesman/verify_user_bsd.c index 1d84c242..ff5e87a9 100644 --- a/sesman/verify_user_bsd.c +++ b/sesman/verify_user_bsd.c @@ -101,7 +101,7 @@ auth_stop_session(long in_val) */ static int DEFAULT_CC -auth_crypt_pwd(char* pwd, char* pln, char* crp) +auth_crypt_pwd(const char *pwd, const char *pln, char *crp) { return 0; } diff --git a/sesman/verify_user_kerberos.c b/sesman/verify_user_kerberos.c index 0d35b115..62d020a5 100644 --- a/sesman/verify_user_kerberos.c +++ b/sesman/verify_user_kerberos.c @@ -67,8 +67,8 @@ struct k5_data struct user_info { - char *name; - char *pass; + const char *name; + const char *pass; }; /******************************************************************************/ @@ -221,7 +221,7 @@ kinit_prompter(krb5_context ctx, void *data, const char *name, static int k5_kinit(struct k_opts *opts, struct k5_data *k5, struct user_info *u_info) { - char *doing; + const char *doing; int notix = 1; krb5_keytab keytab = 0; krb5_creds my_creds; @@ -425,7 +425,7 @@ auth_userpass(const char *user, const char *pass, int *errorcode) /******************************************************************************/ /* returns error */ int DEFAULT_CC -auth_start_session(void) +auth_start_session(long in_val, int in_display) { return 0; } @@ -440,14 +440,14 @@ auth_stop_session(long in_val) /******************************************************************************/ int DEFAULT_CC -auth_end(void) +auth_end(long in_val) { return 0; } /******************************************************************************/ int DEFAULT_CC -auth_set_env(void) +auth_set_env(long in_val) { return 0; } diff --git a/sesman/verify_user_pam_userpass.c b/sesman/verify_user_pam_userpass.c index abc61e21..19bc7105 100644 --- a/sesman/verify_user_pam_userpass.c +++ b/sesman/verify_user_pam_userpass.c @@ -85,7 +85,7 @@ auth_userpass(const char *user, const char *pass, int *errorcode) /******************************************************************************/ /* returns error */ int DEFAULT_CC -auth_start_session(void) +auth_start_session(long in_val, int in_display) { return 0; } @@ -100,14 +100,14 @@ auth_stop_session(long in_val) /******************************************************************************/ int DEFAULT_CC -auth_end(void) +auth_end(long in_val) { return 0; } /******************************************************************************/ int DEFAULT_CC -auth_set_env(void) +auth_set_env(long in_val) { return 0; }