1 |
flameeyes 13/02/24 00:00:51 |
2 |
|
3 |
Added: pam_dotfile-0.7-gentoo.patch |
4 |
Log: |
5 |
Cleanup, use a single patch rather than a patches tarball (patches are split in GitHub), simplify checks and hide symbols that are not part of the PAM interface. |
6 |
|
7 |
(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 1CD13C8AD4301342) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-auth/pam_dotfile/files/pam_dotfile-0.7-gentoo.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-auth/pam_dotfile/files/pam_dotfile-0.7-gentoo.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-auth/pam_dotfile/files/pam_dotfile-0.7-gentoo.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: pam_dotfile-0.7-gentoo.patch |
16 |
=================================================================== |
17 |
diff --git a/configure.ac b/configure.ac |
18 |
index 4730bdf..b8d8747 100644 |
19 |
--- a/configure.ac |
20 |
+++ b/configure.ac |
21 |
@@ -44,16 +44,26 @@ CFLAGS="$CFLAGS -L/lib" |
22 |
# Checks for libraries. |
23 |
AC_CHECK_HEADER([security/pam_modules.h],, [AC_MSG_ERROR([*** Sorry, you have to install the PAM development files ***])]) |
24 |
|
25 |
-LIBS="$LIBS -ldl -lpam -lpam_misc" |
26 |
- |
27 |
-case "$host" in |
28 |
- *-*-linux*) |
29 |
- PAM_MODDIR="/lib/security" |
30 |
- ;; |
31 |
- *) |
32 |
- PAM_MODDIR="/usr/lib" |
33 |
- ;; |
34 |
-esac |
35 |
+AC_CHECK_HEADERS([security/_pam_macros.h security/pam_misc.h security/openpam.h]) |
36 |
+ |
37 |
+AC_CHECK_LIB([pam], [pam_start]) |
38 |
+AC_CHECK_LIB([pam_misc], [misc_conv]) |
39 |
+ |
40 |
+AC_ARG_WITH([pammoddir], |
41 |
+ AC_HELP_STRING([--with-pammoddir], [Install module in specified directory]), |
42 |
+ [ |
43 |
+ PAM_MODDIR=$withval |
44 |
+ ], [ |
45 |
+ case "$host" in |
46 |
+ *-*-linux*) |
47 |
+ PAM_MODDIR="/lib/security" |
48 |
+ ;; |
49 |
+ *) |
50 |
+ PAM_MODDIR="/usr/lib" |
51 |
+ ;; |
52 |
+ esac |
53 |
+ ]) |
54 |
+ |
55 |
AC_SUBST(PAM_MODDIR) |
56 |
|
57 |
# Checks for header files. |
58 |
@@ -64,7 +74,7 @@ AC_FUNC_LSTAT |
59 |
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK |
60 |
AC_FUNC_VPRINTF |
61 |
|
62 |
-AC_CHECK_HEADERS([fcntl.h limits.h syslog.h termios.h]) |
63 |
+AC_CHECK_HEADERS([fcntl.h limits.h syslog.h termios.h sys/types.h]) |
64 |
AC_HEADER_STDC |
65 |
AC_HEADER_SYS_WAIT |
66 |
|
67 |
diff --git a/src/Makefile.am b/src/Makefile.am |
68 |
index 2905b7c..e7e47d2 100644 |
69 |
--- a/src/Makefile.am |
70 |
+++ b/src/Makefile.am |
71 |
@@ -22,7 +22,7 @@ moduledir = @PAM_MODDIR@ |
72 |
module_LTLIBRARIES = pam_dotfile.la |
73 |
|
74 |
pam_dotfile_la_SOURCES = pam_dotfile.c md5.c md5util.c md5.h md5util.h log.c log.h common.c common.h |
75 |
-pam_dotfile_la_LDFLAGS = -module -avoid-version |
76 |
+pam_dotfile_la_LDFLAGS = -module -avoid-version -export-symbols-regex '^pam_' |
77 |
pam_dotfile_la_CFLAGS = $(AM_CFLAGS) |
78 |
|
79 |
sbin_PROGRAMS = pam-dotfile-helper |
80 |
diff --git a/src/common.h b/src/common.h |
81 |
index ef34cf3..6a57116 100644 |
82 |
--- a/src/common.h |
83 |
+++ b/src/common.h |
84 |
@@ -21,7 +21,10 @@ |
85 |
***/ |
86 |
|
87 |
#include <security/pam_modules.h> |
88 |
-#include <security/_pam_macros.h> |
89 |
+#include <security/pam_appl.h> |
90 |
+#ifdef HAVE_SECURITY__PAM_MACROS_H |
91 |
+# include <security/_pam_macros.h> |
92 |
+#endif |
93 |
|
94 |
typedef struct context { |
95 |
int opt_debug; |
96 |
diff --git a/src/pam-dotfile-helper.c b/src/pam-dotfile-helper.c |
97 |
index 04c73de..1c09b18 100644 |
98 |
--- a/src/pam-dotfile-helper.c |
99 |
+++ b/src/pam-dotfile-helper.c |
100 |
@@ -23,6 +23,14 @@ |
101 |
#include <signal.h> |
102 |
#include <pwd.h> |
103 |
|
104 |
+#ifdef HAVE_CONFIG_H |
105 |
+# include <config.h> |
106 |
+#endif |
107 |
+ |
108 |
+#ifdef HAVE_SYS_TYPES_H |
109 |
+# include <sys/types.h> |
110 |
+#endif |
111 |
+ |
112 |
#include "common.h" |
113 |
#include "log.h" |
114 |
|
115 |
diff --git a/src/pam_dotfile.c b/src/pam_dotfile.c |
116 |
index 405f494..183aafd 100644 |
117 |
--- a/src/pam_dotfile.c |
118 |
+++ b/src/pam_dotfile.c |
119 |
@@ -29,11 +29,19 @@ |
120 |
#include <sys/types.h> |
121 |
#include <sys/wait.h> |
122 |
#include <fcntl.h> |
123 |
+#include <stdlib.h> |
124 |
|
125 |
#define PAM_SM_AUTH |
126 |
|
127 |
#include <security/pam_modules.h> |
128 |
-#include <security/_pam_macros.h> |
129 |
+#include <security/pam_appl.h> |
130 |
+#ifdef HAVE_SECURITY__PAM_MACROS_H |
131 |
+# include <security/_pam_macros.h> |
132 |
+#endif |
133 |
+ |
134 |
+#ifndef x_strdup |
135 |
+# define x_strdup(s) ( (s) ? strdup(s):NULL ) |
136 |
+#endif |
137 |
|
138 |
#include "md5.h" |
139 |
#include "md5util.h" |
140 |
diff --git a/src/pamtest.c b/src/pamtest.c |
141 |
index 171e601..6583de1 100644 |
142 |
--- a/src/pamtest.c |
143 |
+++ b/src/pamtest.c |
144 |
@@ -19,11 +19,28 @@ |
145 |
|
146 |
#include <stdio.h> |
147 |
|
148 |
+#ifdef HAVE_CONFIG_H |
149 |
+# include <config.h> |
150 |
+#endif |
151 |
+ |
152 |
#include <security/pam_appl.h> |
153 |
-#include <security/pam_misc.h> |
154 |
+ |
155 |
+#ifdef HAVE_SECURITY_PAM_MISC_H |
156 |
+# include <security/pam_misc.h> |
157 |
+#endif |
158 |
+ |
159 |
+#ifdef HAVE_SECURITY_OPENPAM_H |
160 |
+# include <security/openpam.h> |
161 |
+#endif |
162 |
|
163 |
int main(int argc, char*argv[]) { |
164 |
+#ifdef HAVE_LIBPAM_MISC |
165 |
static struct pam_conv pc = { misc_conv, NULL }; |
166 |
+#elif defined(_OPENPAM) |
167 |
+ static struct pam_conv pc = { openpam_nullconv, NULL }; |
168 |
+#else |
169 |
+ static struct pam_conv pc = { NULL }; |
170 |
+#endif |
171 |
pam_handle_t *ph = NULL; |
172 |
int r, ret; |
173 |
char *username, *procname, *service; |