Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 4c1223e

Browse files
author
Dario Asprone
committed
Fixed python 3.6.1 crypt issue on Fedora 28
1 parent 6fc1e20 commit 4c1223e

File tree

2 files changed

+289
-0
lines changed

2 files changed

+289
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
diff -r 4b6e6a77e501 Modules/_cryptmodule.c
2+
--- a/Modules/_cryptmodule.c Sat Oct 22 03:21:55 2016 +0000
3+
+++ b/Modules/_cryptmodule.c Sat Oct 22 09:40:16 2016 +0200
4+
@@ -5,6 +5,11 @@
5+
6+
#include <sys/types.h>
7+
8+
+#ifdef HAVE_CRYPT_H
9+
+#include <crypt.h>
10+
+#endif
11+
+#include <unistd.h>
12+
+
13+
/* Module crypt */
14+
15+
/*[clinic input]
16+
@@ -36,7 +41,13 @@
17+
{
18+
/* On some platforms (AtheOS) crypt returns NULL for an invalid
19+
salt. Return None in that case. XXX Maybe raise an exception? */
20+
+#ifdef HAVE_CRYPT_R
21+
+ struct crypt_data data;
22+
+ data.initialized = 0;
23+
+ return Py_BuildValue("s", crypt_r(word, salt, &data));
24+
+#else
25+
return Py_BuildValue("s", crypt(word, salt));
26+
+#endif
27+
}
28+
29+
30+
diff -r 4b6e6a77e501 configure.ac
31+
--- a/configure.ac Sat Oct 22 03:21:55 2016 +0000
32+
+++ b/configure.ac Sat Oct 22 09:40:16 2016 +0200
33+
@@ -2033,7 +2033,7 @@
34+
35+
# checks for header files
36+
AC_HEADER_STDC
37+
-AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
38+
+AC_CHECK_HEADERS(asm/types.h conio.h crypt.h direct.h dlfcn.h errno.h \
39+
fcntl.h grp.h \
40+
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
41+
sched.h shadow.h signal.h stropts.h termios.h \
42+
@@ -2671,6 +2671,7 @@
43+
AC_CHECK_LIB(sendfile, sendfile)
44+
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
45+
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
46+
+AC_CHECK_LIB(crypt, crypt) # crypt() on Linux
47+
48+
# only check for sem_init if thread support is requested
49+
if test "$with_threads" = "yes" -o -z "$with_threads"; then
50+
@@ -3403,8 +3404,8 @@
51+
52+
# checks for library functions
53+
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
54+
- clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \
55+
- fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
56+
+ clock confstr crypt_r ctermid dup3 execv faccessat fchmod fchmodat fchown \
57+
+ fchownat fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
58+
futimens futimes gai_strerror getentropy \
59+
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
60+
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
diff --git a/aclocal.m4 b/aclocal.m4
2+
index 9a9cc55..df7895b 100644
3+
--- a/aclocal.m4
4+
+++ b/aclocal.m4
5+
@@ -1,6 +1,6 @@
6+
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
7+
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
8+
9+
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
10+
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
11+
12+
# This file is free software; the Free Software Foundation
13+
# gives unlimited permission to copy and/or distribute it,
14+
@@ -12,9 +12,9 @@
15+
# PARTICULAR PURPOSE.
16+
17+
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
18+
-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
19+
-dnl serial 11 (pkg-config-0.29)
20+
-dnl
21+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
22+
+# serial 11 (pkg-config-0.29.1)
23+
+
24+
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
25+
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
26+
dnl
27+
@@ -55,7 +55,7 @@ dnl
28+
dnl See the "Since" comment for each macro you use to see what version
29+
dnl of the macros you require.
30+
m4_defun([PKG_PREREQ],
31+
-[m4_define([PKG_MACROS_VERSION], [0.29])
32+
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
33+
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
34+
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
35+
])dnl PKG_PREREQ
36+
@@ -288,3 +288,71 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
37+
AS_VAR_IF([$1], [""], [$5], [$4])dnl
38+
])dnl PKG_CHECK_VAR
39+
40+
+dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
41+
+dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
42+
+dnl [DESCRIPTION], [DEFAULT])
43+
+dnl ------------------------------------------
44+
+dnl
45+
+dnl Prepare a "--with-" configure option using the lowercase
46+
+dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
47+
+dnl PKG_CHECK_MODULES in a single macro.
48+
+AC_DEFUN([PKG_WITH_MODULES],
49+
+[
50+
+m4_pushdef([with_arg], m4_tolower([$1]))
51+
+
52+
+m4_pushdef([description],
53+
+ [m4_default([$5], [build with ]with_arg[ support])])
54+
+
55+
+m4_pushdef([def_arg], [m4_default([$6], [auto])])
56+
+m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
57+
+m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
58+
+
59+
+m4_case(def_arg,
60+
+ [yes],[m4_pushdef([with_without], [--without-]with_arg)],
61+
+ [m4_pushdef([with_without],[--with-]with_arg)])
62+
+
63+
+AC_ARG_WITH(with_arg,
64+
+ AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
65+
+ [AS_TR_SH([with_]with_arg)=def_arg])
66+
+
67+
+AS_CASE([$AS_TR_SH([with_]with_arg)],
68+
+ [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
69+
+ [auto],[PKG_CHECK_MODULES([$1],[$2],
70+
+ [m4_n([def_action_if_found]) $3],
71+
+ [m4_n([def_action_if_not_found]) $4])])
72+
+
73+
+m4_popdef([with_arg])
74+
+m4_popdef([description])
75+
+m4_popdef([def_arg])
76+
+
77+
+])dnl PKG_WITH_MODULES
78+
+
79+
+dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
80+
+dnl [DESCRIPTION], [DEFAULT])
81+
+dnl -----------------------------------------------
82+
+dnl
83+
+dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
84+
+dnl check._[VARIABLE-PREFIX] is exported as make variable.
85+
+AC_DEFUN([PKG_HAVE_WITH_MODULES],
86+
+[
87+
+PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
88+
+
89+
+AM_CONDITIONAL([HAVE_][$1],
90+
+ [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
91+
+])dnl PKG_HAVE_WITH_MODULES
92+
+
93+
+dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
94+
+dnl [DESCRIPTION], [DEFAULT])
95+
+dnl ------------------------------------------------------
96+
+dnl
97+
+dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
98+
+dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
99+
+dnl and preprocessor variable.
100+
+AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
101+
+[
102+
+PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
103+
+
104+
+AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
105+
+ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
106+
+])dnl PKG_HAVE_DEFINE_WITH_MODULES
107+
+
108+
diff --git a/configure b/configure
109+
index 8fb95fd..ab4d12d 100755
110+
--- a/configure
111+
+++ b/configure
112+
@@ -7766,7 +7766,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
113+
114+
fi
115+
116+
-for ac_header in asm/types.h conio.h direct.h dlfcn.h errno.h \
117+
+for ac_header in asm/types.h conio.h crypt.h direct.h dlfcn.h errno.h \
118+
fcntl.h grp.h \
119+
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
120+
sched.h shadow.h signal.h stropts.h termios.h \
121+
@@ -9576,6 +9576,51 @@ _ACEOF
122+
123+
fi
124+
# Dynamic linking for HP-UX
125+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
126+
+$as_echo_n "checking for crypt in -lcrypt... " >&6; }
127+
+if ${ac_cv_lib_crypt_crypt+:} false; then :
128+
+ $as_echo_n "(cached) " >&6
129+
+else
130+
+ ac_check_lib_save_LIBS=$LIBS
131+
+LIBS="-lcrypt $LIBS"
132+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
133+
+/* end confdefs.h. */
134+
+
135+
+/* Override any GCC internal prototype to avoid an error.
136+
+ Use char because int might match the return type of a GCC
137+
+ builtin and then its argument prototype would still apply. */
138+
+#ifdef __cplusplus
139+
+extern "C"
140+
+#endif
141+
+char crypt ();
142+
+int
143+
+main ()
144+
+{
145+
+return crypt ();
146+
+ ;
147+
+ return 0;
148+
+}
149+
+_ACEOF
150+
+if ac_fn_c_try_link "$LINENO"; then :
151+
+ ac_cv_lib_crypt_crypt=yes
152+
+else
153+
+ ac_cv_lib_crypt_crypt=no
154+
+fi
155+
+rm -f core conftest.err conftest.$ac_objext \
156+
+ conftest$ac_exeext conftest.$ac_ext
157+
+LIBS=$ac_check_lib_save_LIBS
158+
+fi
159+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5
160+
+$as_echo "$ac_cv_lib_crypt_crypt" >&6; }
161+
+if test "x$ac_cv_lib_crypt_crypt" = xyes; then :
162+
+ cat >>confdefs.h <<_ACEOF
163+
+#define HAVE_LIBCRYPT 1
164+
+_ACEOF
165+
+
166+
+ LIBS="-lcrypt $LIBS"
167+
+
168+
+fi
169+
+ # crypt() on Linux
170+
171+
# only check for sem_init if thread support is requested
172+
if test "$with_threads" = "yes" -o -z "$with_threads"; then
173+
@@ -11235,8 +11280,8 @@ fi
174+
175+
# checks for library functions
176+
for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
177+
- clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \
178+
- fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
179+
+ clock confstr crypt_r ctermid dup3 execv faccessat fchmod fchmodat fchown \
180+
+ fchownat fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
181+
futimens futimes gai_strerror getentropy \
182+
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
183+
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
184+
@@ -13163,6 +13208,18 @@ cat >>confdefs.h <<_ACEOF
185+
_ACEOF
186+
187+
188+
+fi
189+
+
190+
+# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
191+
+ac_fn_c_check_member "$LINENO" "siginfo_t" "si_band" "ac_cv_member_siginfo_t_si_band" "#include <signal.h>
192+
+"
193+
+if test "x$ac_cv_member_siginfo_t_si_band" = xyes; then :
194+
+
195+
+cat >>confdefs.h <<_ACEOF
196+
+#define HAVE_SIGINFO_T_SI_BAND 1
197+
+_ACEOF
198+
+
199+
+
200+
fi
201+
202+
203+
diff --git a/pyconfig.h.in b/pyconfig.h.in
204+
index c758915..760b157 100644
205+
--- a/pyconfig.h.in
206+
+++ b/pyconfig.h.in
207+
@@ -140,6 +140,12 @@
208+
/* Define to 1 if you have the `copysign' function. */
209+
#undef HAVE_COPYSIGN
210+
211+
+/* Define to 1 if you have the <crypt.h> header file. */
212+
+#undef HAVE_CRYPT_H
213+
+
214+
+/* Define to 1 if you have the `crypt_r' function. */
215+
+#undef HAVE_CRYPT_R
216+
+
217+
/* Define to 1 if you have the `ctermid' function. */
218+
#undef HAVE_CTERMID
219+
220+
@@ -523,6 +529,9 @@
221+
/* Define to 1 if you have the `lgamma' function. */
222+
#undef HAVE_LGAMMA
223+
224+
+/* Define to 1 if you have the `crypt' library (-lcrypt). */
225+
+#undef HAVE_LIBCRYPT
226+
+
227+
/* Define to 1 if you have the `dl' library (-ldl). */
228+
#undef HAVE_LIBDL
229+

0 commit comments

Comments
 (0)