changeset 351:adefba58053b HEAD

more compiler warnings fixes
author Timo Sirainen <tss@iki.fi>
date Sun, 06 Oct 2002 00:13:22 +0300
parents 2c6b6594a14b
children 693f93219218
files src/auth/auth-digest-md5.c src/auth/userinfo-pam.c src/auth/userinfo-passwd.c src/auth/userinfo-shadow.c src/login/client-authenticate.c
diffstat 5 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-digest-md5.c	Sun Oct 06 00:07:09 2002 +0300
+++ b/src/auth/auth-digest-md5.c	Sun Oct 06 00:13:22 2002 +0300
@@ -544,7 +544,7 @@
 
 	/* failed */
 	reply.result = AUTH_RESULT_FAILURE;
-	callback(&reply, error, context);
+	callback(&reply, (const unsigned char *) error, context);
 	cookie_remove(cookie->cookie);
 }
 
--- a/src/auth/userinfo-pam.c	Sun Oct 06 00:07:09 2002 +0300
+++ b/src/auth/userinfo-pam.c	Sun Oct 06 00:13:22 2002 +0300
@@ -7,8 +7,10 @@
    modified versions are marked as such.  There's absolutely no warranty.
 */
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#  define _XOPEN_SOURCE_EXTENDED
+#endif
 #define _XOPEN_SOURCE 4
-#define _XOPEN_SOURCE_EXTENDED
 #define _XPG4_2
 
 #include "common.h"
@@ -24,8 +26,11 @@
 
 #include <security/pam_appl.h>
 
-#if defined(__sun__) && !defined(LINUX_PAM)
-#  define linux_const			/* Sun's PAM doesn't use const here */
+#if !defined(_SECURITY_PAM_APPL_H) && !defined(LINUX_PAM)
+/* Sun's PAM doesn't use const. we use a bit dirty hack to check it.
+   Originally it was just __sun__ check, but HP/UX also uses Sun's PAM
+   so I thought this might work better. */
+#  define linux_const
 #else
 #  define linux_const			const
 #endif
@@ -168,7 +173,7 @@
 		return FALSE;
 	}
 
-	status = pam_get_item(pamh, PAM_USER, (pam_item_t *)&item);
+	status = pam_get_item(pamh, PAM_USER, (linux_const void **)&item);
 	if (status != PAM_SUCCESS) {
 		if (status == PAM_ABORT)
 			i_fatal("pam_get_item() requested abort");
--- a/src/auth/userinfo-passwd.c	Sun Oct 06 00:07:09 2002 +0300
+++ b/src/auth/userinfo-passwd.c	Sun Oct 06 00:13:22 2002 +0300
@@ -5,8 +5,10 @@
    Copyright (C) 2002 Timo Sirainen
 */
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#  define _XOPEN_SOURCE_EXTENDED
+#endif
 #define _XOPEN_SOURCE 4
-#define _XOPEN_SOURCE_EXTENDED
 #define _XPG4_2
 
 #include "common.h"
--- a/src/auth/userinfo-shadow.c	Sun Oct 06 00:07:09 2002 +0300
+++ b/src/auth/userinfo-shadow.c	Sun Oct 06 00:13:22 2002 +0300
@@ -5,8 +5,10 @@
    Copyright (C) 2002 Timo Sirainen
 */
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#  define _XOPEN_SOURCE_EXTENDED
+#endif
 #define _XOPEN_SOURCE 4
-#define _XOPEN_SOURCE_EXTENDED
 #define _XPG4_2
 
 #include "common.h"
--- a/src/login/client-authenticate.c	Sun Oct 06 00:07:09 2002 +0300
+++ b/src/login/client-authenticate.c	Sun Oct 06 00:13:22 2002 +0300
@@ -180,7 +180,7 @@
 int cmd_login(Client *client, const char *user, const char *pass)
 {
 	const char *error;
-	char *p;
+	unsigned char *p;
 	size_t len, user_len, pass_len;
 
 	if (!client->tls && disable_plaintext_auth) {