Ticket #25391: crypt.patch

File crypt.patch, 2.1 KB (added by Vaush, 18 months ago)

Python3 patch - 1 of 2

  • Modules/_cryptmodule.c

    diff -r 4b6e6a77e501 Modules/_cryptmodule.c
    a b  
    55
    66#include <sys/types.h>
    77
     8#ifdef HAVE_CRYPT_H
     9#include <crypt.h>
     10#endif
     11#include <unistd.h>
     12
    813/* Module crypt */
    914
    1015/*[clinic input]
     
    3641{
    3742    /* On some platforms (AtheOS) crypt returns NULL for an invalid
    3843       salt. Return None in that case. XXX Maybe raise an exception?  */
     44#ifdef HAVE_CRYPT_R
     45    struct crypt_data data;
     46    data.initialized = 0;
     47    return Py_BuildValue("s", crypt_r(word, salt, &data));
     48#else
    3949    return Py_BuildValue("s", crypt(word, salt));
     50#endif
    4051}
    4152
    4253
  • configure.ac

    diff -r 4b6e6a77e501 configure.ac
    a b  
    20332033
    20342034# checks for header files
    20352035AC_HEADER_STDC
    2036 AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
     2036AC_CHECK_HEADERS(asm/types.h conio.h crypt.h direct.h dlfcn.h errno.h \
    20372037fcntl.h grp.h \
    20382038ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
    20392039sched.h shadow.h signal.h stropts.h termios.h \
     
    26712671AC_CHECK_LIB(sendfile, sendfile)
    26722672AC_CHECK_LIB(dl, dlopen)        # Dynamic linking for SunOS/Solaris and SYSV
    26732673AC_CHECK_LIB(dld, shl_load)     # Dynamic linking for HP-UX
     2674AC_CHECK_LIB(crypt, crypt)      # crypt() on Linux
    26742675
    26752676# only check for sem_init if thread support is requested
    26762677if test "$with_threads" = "yes" -o -z "$with_threads"; then
     
    34033404
    34043405# checks for library functions
    34053406AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
    3406  clock confstr ctermid dup3 execv faccessat fchmod fchmodat fchown fchownat \
    3407  fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
     3407 clock confstr crypt_r ctermid dup3 execv faccessat fchmod fchmodat fchown \
     3408 fchownat fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
    34083409 futimens futimes gai_strerror getentropy \
    34093410 getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
    34103411 getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \