bugzilla: 169046 Make python compile on fc5

This commit is contained in:
Mihai Ibanescu 2005-09-22 15:11:13 +00:00
parent ce25e1e756
commit 7ccfc388f6
2 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,53 @@
--- Python-2.4.1/pyconfig.h.in.canonicalize 2005-09-14 11:47:04.000000000 -0400
+++ Python-2.4.1/pyconfig.h.in 2005-09-14 11:47:02.000000000 -0400
@@ -58,6 +58,9 @@
/* Define if pthread_sigmask() does not work on your system. */
#undef HAVE_BROKEN_PTHREAD_SIGMASK
+/* Define to 1 if you have the `canonicalize_file_name' function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
/* Define to 1 if you have the `chown' function. */
#undef HAVE_CHOWN
--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-09-14 11:53:30.000000000 -0400
+++ Python-2.4.1/Python/sysmodule.c 2005-09-14 11:52:04.000000000 -0400
@@ -1184,6 +1184,11 @@
char *p = NULL;
int n = 0;
PyObject *a;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ argv0 = canonicalize_file_name(argv0);
+ if (argv0 == NULL)
+ Py_FatalError("no mem for sys.argv");
+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
#ifdef HAVE_READLINK
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
@@ -1256,9 +1261,13 @@
#endif /* Unix */
}
#endif /* All others */
+#endif /* ! HAVE_CANONICALIZE_FILE_NAME */
a = PyString_FromStringAndSize(argv0, n);
if (a == NULL)
Py_FatalError("no mem for sys.path insertion");
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ free(argv0);
+#endif /* HAVE_CANONICALIZE_FILE_NAME */
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
--- Python-2.4.1/configure.in.canonicalize 2005-09-14 11:46:00.000000000 -0400
+++ Python-2.4.1/configure.in 2005-09-14 11:47:22.000000000 -0400
@@ -2096,8 +2096,8 @@
AC_MSG_RESULT(MACHDEP_OBJS)
# checks for library functions
-AC_CHECK_FUNCS(alarm bind_textdomain_codeset chown clock confstr ctermid \
- execv fork fpathconf ftime ftruncate \
+AC_CHECK_FUNCS(alarm bind_textdomain_codeset canonicalize_file_name chown \
+ clock confstr ctermid execv fork fpathconf ftime ftruncate \
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
getpriority getpwent getsid getwd \
kill killpg lchown lstat mkfifo mknod mktime \

View File

@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
Release: 4
Release: 5
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@ -39,6 +39,7 @@ Patch8: python-2.4.1-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
Patch15: pyhton-2.4.1-canonicalize.patch
%if %{main_python}
Obsoletes: Distutils
@ -142,6 +143,7 @@ user interface for Python programming.
%endif
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
%patch14 -p1 -b .canonicalize
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@ -354,6 +356,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
* Thu Sep 22 2005 Mihai Ibanescu <misa@redhat.com> 2.4.1-5
- Fixed bug #169046 (realpath is unsafe); thanks to
Peter Jones <pjones@redhat.com> and Arjan van de Ven <arjanv@redhat.com> for
diagnosing and the patch.
* Tue Sep 20 2005 Mihai Ibanescu <misa@redhat.com> 2.4.1-4
- Fixed bug #168655 (fixes for building as python24)