Commit fbd03b09 authored by Richard Levitte's avatar Richard Levitte
Browse files

VMS open() doesn't take O_BINARY, but takes a context description



Tell open() O_BINARY on VMS doesn't make sense, as it's possible to
use more precise file attributes.  However, if we're still going to
fdopen() it in binary mode, we must set the fd in binary context.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 1cd5cc36
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2817,6 +2817,16 @@ BIO *bio_open_owner(const char *filename, int format, int private)
#endif
    }

#ifdef OPENSSL_SYS_VMS
    /* VMS doesn't have O_BINARY, it just doesn't make sense.  But,
     * it still needs to know that we're going binary, or fdopen()
     * will fail with "invalid argument"...  so we tell VMS what the
     * context is.
     */
    if (!textmode)
        fd = open(filename, mode, 0600, "ctx=bin");
    else
#endif
        fd = open(filename, mode, 0600);
    if (fd < 0)
        goto err;