On Fri, 15 Aug 2003, Gisle Vanem wrote:
> I didn't get any reaction on this patch. Isn't 32-bit MSDOS targets considered
> good enough any longer?
>
> The original message and patch is here:
> http://marc.theaimsgroup.com/?l=openssl-dev&m=105943488203763&w=2
I haven't built a DOS version of openssl with your patch yet. There was
one section of the patch which caught my eye as a possible problem.
In crypto/bio/bss_file.c, you change the way that binary or text is
chosen, and allow binary only if not going to stdout or or from stdin. I
think that the usual way to handle this (at least under DJGPP) is to use
"isatty", and not allow binary if isatty returns a nonzero result.
Otherwise you may be interfering with redirected binary data. It might
be more generalizable if you used "fileno(stdout)" rather than
specifying "1" in the "else if" line, but I don't know of a system where
the file numbers are different.
Doug
--- ./crypto/bio/bss_file.c Tue Jul 29 01:08:40 2003
+++ /new-version/crypto/bio/bss_file.c Tue Jul 29 01:11:10 2003
@@ -213,12 +213,20 @@
b->shutdown=(int)num&BIO_CLOSE;
b->ptr=(char *)ptr;
b->init=1;
-#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS)
- /* Set correct text/binary mode */
- if (num & BIO_FP_TEXT)
- _setmode(fileno((FILE *)ptr),_O_TEXT);
- else
- _setmode(fileno((FILE *)ptr),_O_BINARY);
+#if defined(OPENSSL_SYS_WINDOWS)
+ if (num & BIO_FP_TEXT)
+ _setmode(fd,_O_TEXT);
+ else
+ _setmode(fd,_O_BINARY);
+#elif defined(OPENSSL_SYS_MSDOS)
+ {
+ int fd = fileno((FILE*)ptr);
+ /* Set correct text/binary mode */
+ if (num & BIO_FP_TEXT)
+ _setmode(fd,_O_TEXT);
+ else if (fd != 0 && fd != 1) /* not stdin/stdout (dangerous!) */
+ _setmode(fd,_O_BINARY);
+ }
#elif defined(OPENSSL_SYS_OS2)
if (num & BIO_FP_TEXT)
setmode(fileno((FILE *)ptr), O_TEXT);
--
Doug Kaufman
Internet: [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]