lördag den  6 april 2013 klockan 13:52 skrev Mats Erik Andersson detta:
> fredag den  5 april 2013 klockan 21:47 skrev Mats Erik Andersson detta:
>
> I have tested the patch below with successful builds on
> Debian Squeeze, FreeBSD 9.1, and OpenIndiana oi_151a7
> starting from
> 
>   $ ./configure CFLAGS='-Wall -Wextra' --with-libgcrypt
> 
> This covers Linux-PAM, OpenPAM, and Sun-PAM. Please audit
> the patch for verification that I have not overlooked
> some detail.

I forgot the patch text itself!
>From 03da74b29d7d59f9dda75b963fb0da4c7ed53e37 Mon Sep 17 00:00:00 2001
From: Mats Erik Andersson <[email protected]>
Date: Sat, 6 Apr 2013 13:31:19 +0200
Subject: [PATCH] pam_shishi: Compile conditionals.

---
 ChangeLog                     |    6 ++++++
 extra/pam_shishi/pam_shishi.c |   38 +++++++++++++++++---------------------
 2 filer ändrade, 23 tillägg(+), 21 borttagningar(-)

diff --git a/ChangeLog b/ChangeLog
index 69000d6..3c985ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-06  Mats Erik Andersson <[email protected]>
+
+	* extra/pam_shishi/pam_shishi.c: Do not check PIC,
+	and remove definition trickery with PAM_STATIC.
+	[!PAM_EXTERN]: Define to empty for portability.
+
 2013-04-05  Mats Erik Andersson <[email protected]>
 
 	Replacement headers from Gnulib put macros into <config.h>,
diff --git a/extra/pam_shishi/pam_shishi.c b/extra/pam_shishi/pam_shishi.c
index 6380f51..dcf6371 100644
--- a/extra/pam_shishi/pam_shishi.c
+++ b/extra/pam_shishi/pam_shishi.c
@@ -21,23 +21,18 @@
  */
 
 #if HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
 #endif
 
 #ifdef STDC_HEADERS
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <ctype.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <stdarg.h>
+# include <ctype.h>
 #endif
 
 #include <shishi.h>
 
-/* Libtool defines PIC for shared objects */
-#ifndef PIC
-#define PAM_STATIC
-#endif
-
 /* These #defines must be present according to PAM documentation. */
 #define PAM_SM_AUTH
 #define PAM_SM_ACCOUNT
@@ -45,26 +40,26 @@
 #define PAM_SM_PASSWORD
 
 #ifdef HAVE_SECURITY_PAM_APPL_H
-#include <security/pam_appl.h>
+# include <security/pam_appl.h>
 #endif
 #ifdef HAVE_SECURITY_PAM_MODULES_H
-#include <security/pam_modules.h>
+# include <security/pam_modules.h>
 #endif
 
 #if defined DEBUG_PAM && defined HAVE_SECURITY__PAM_MACROS_H
-#define DEBUG
-#include <security/_pam_macros.h>
+# define DEBUG
+# include <security/_pam_macros.h>
 #else
-#define D(x)			/* nothing */
+# define D(x)			/* nothing */
 #endif
 
+/* Rely on <security/pam_modules.h>
+ * for settings in general, as PAM_EXTERN
+ * is not universal among PAM implementations.
+ */
 #ifndef PAM_EXTERN
-#ifdef PAM_STATIC
-#define PAM_EXTERN static
-#else
-#define PAM_EXTERN extern
-#endif
-#endif
+# define PAM_EXTERN
+#endif /* !PAM_EXTERN */
 
 PAM_EXTERN int
 pam_sm_authenticate (pam_handle_t * pamh,
@@ -287,6 +282,7 @@ pam_sm_chauthtok (pam_handle_t * pamh, int flags, int argc, const char **argv)
   return retval;
 }
 
+/* Particular to Linux-PAM.  */
 #ifdef PAM_STATIC
 
 struct pam_module _pam_shishi_modstruct = {
-- 
1.7.10.4

_______________________________________________
Help-shishi mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-shishi

Reply via email to