diff options
-rw-r--r-- | iperlsys.h | 3 | ||||
-rw-r--r-- | pp.c | 2 | ||||
-rw-r--r-- | win32/Makefile | 2 | ||||
-rw-r--r-- | win32/makefile.mk | 2 | ||||
-rw-r--r-- | win32/perlhost.h | 4 | ||||
-rw-r--r-- | win32/win32.c | 6 | ||||
-rw-r--r-- | win32/win32iop.h | 2 |
7 files changed, 17 insertions, 4 deletions
diff --git a/iperlsys.h b/iperlsys.h index 0c93fd8fad..91389a2b7b 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -634,6 +634,7 @@ class IPerlProc { public: virtual void Abort(void) = 0; + virtual char * Crypt(const char* clear, const char* salt) = 0; virtual void Exit(int status) = 0; virtual void _Exit(int status) = 0; virtual int Execl(const char *cmdname, const char *arg0, @@ -671,6 +672,7 @@ public: }; #define PerlProc_abort() PL_piProc->Abort() +#define PerlProc_crypt(c,s) PL_piProc->Crypt((c), (s)) #define PerlProc_exit(s) PL_piProc->Exit((s)) #define PerlProc__exit(s) PL_piProc->_Exit((s)) #define PerlProc_execl(c, w, x, y, z) \ @@ -713,6 +715,7 @@ public: #else /* PERL_OBJECT */ #define PerlProc_abort() abort() +#define PerlProc_crypt(c,s) crypt((c), (s)) #define PerlProc_exit(s) exit((s)) #define PerlProc__exit(s) _exit((s)) #define PerlProc_execl(c,w,x,y,z) \ @@ -2105,7 +2105,7 @@ PP(pp_crypt) #ifdef FCRYPT sv_setpv(TARG, fcrypt(tmps, SvPV(right, PL_na))); #else - sv_setpv(TARG, crypt(tmps, SvPV(right, PL_na))); + sv_setpv(TARG, PerlProc_crypt(tmps, SvPV(right, PL_na))); #endif #else DIE( diff --git a/win32/Makefile b/win32/Makefile index 811e32ffe1..e33cb9183a 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -68,7 +68,7 @@ INST_VER = \5.005 # # if you have the source for des_fcrypt(), uncomment this and make sure the # file exists (see README.win32). File should be located in the same -# directory as this file. Not (yet) supported with PERL_OBJECT. +# directory as this file. # #CRYPT_SRC = des_fcrypt.c diff --git a/win32/makefile.mk b/win32/makefile.mk index 57813aa0b3..249c0aad98 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -76,7 +76,7 @@ CCTYPE *= BORLAND # # if you have the source for des_fcrypt(), uncomment this and make sure the # file exists (see README.win32). File should be located in the same -# directory as this file. Not (yet) supported with PERL_OBJECT. +# directory as this file. # #CRYPT_SRC *= des_fcrypt.c diff --git a/win32/perlhost.h b/win32/perlhost.h index e2d8ca70cd..842d9c3275 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -468,6 +468,10 @@ public: { win32_abort(); }; + virtual char * Crypt(const char* clear, const char* salt) + { + return win32_crypt(clear, salt); + }; virtual void Exit(int status) { exit(status); diff --git a/win32/win32.c b/win32/win32.c index 970fc3f365..03a9bd8aa9 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1162,14 +1162,20 @@ win32_alarm(unsigned int sec) return 0; } +#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT) #ifdef HAVE_DES_FCRYPT extern char * des_fcrypt(char *cbuf, const char *txt, const char *salt); +#endif DllExport char * win32_crypt(const char *txt, const char *salt) { +#ifdef HAVE_DES_FCRYPT dTHR; return des_fcrypt(crypt_buffer, txt, salt); +#else + die("The crypt() function is unimplemented due to excessive paranoia."); +#endif } #endif diff --git a/win32/win32iop.h b/win32/win32iop.h index cf2bd75db5..12fe63e38f 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -127,7 +127,7 @@ DllExport int win32_wait(int *status); DllExport int win32_waitpid(int pid, int *status, int flags); DllExport int win32_kill(int pid, int sig); -#ifdef HAVE_DES_FCRYPT +#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT) DllExport char * win32_crypt(const char *txt, const char *salt); #endif |