diff options
author | bcook <> | 2015-02-07 04:09:43 +0000 |
---|---|---|
committer | bcook <> | 2015-02-07 04:09:43 +0000 |
commit | a6d663db02ac0a71cccf58cb65c2fd12eb475516 (patch) | |
tree | 0284aa781a8a760fe0cc3218fb9e10412abc7cd5 | |
parent | 48c8f1168082cd30fdd7d7d05f9a81c1b1e2ed14 (diff) | |
download | openbsd-a6d663db02ac0a71cccf58cb65c2fd12eb475516.tar.gz openbsd-a6d663db02ac0a71cccf58cb65c2fd12eb475516.tar.bz2 openbsd-a6d663db02ac0a71cccf58cb65c2fd12eb475516.zip |
Modify BSIZE to BUFLEN to avoid redefinition on HP-UX.
HP-UX defines BSIZE in its <sys/param.h>, and there is a route where its
getting included as a side-effect. I tracked back to at least from HP-UX 9.0
ca. 1993, up to the latest, so the user namespace is polluted.
from kinichiro <kinichiro.inoguchi@gmail.com>
ok miod@, jsing@
-rw-r--r-- | src/usr.bin/openssl/apps.c | 24 | ||||
-rw-r--r-- | src/usr.bin/openssl/ca.c | 6 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index d652abc549..8cef15fbb1 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: apps.c,v 1.24 2015/01/03 03:03:39 lteo Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.25 2015/02/07 04:09:43 bcook Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -1384,7 +1384,7 @@ static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING) | |||
1384 | static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) | 1384 | static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) |
1385 | static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) | 1385 | static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) |
1386 | 1386 | ||
1387 | #define BSIZE 256 | 1387 | #define BUFLEN 256 |
1388 | 1388 | ||
1389 | BIGNUM * | 1389 | BIGNUM * |
1390 | load_serial(char *serialfile, int create, ASN1_INTEGER **retai) | 1390 | load_serial(char *serialfile, int create, ASN1_INTEGER **retai) |
@@ -1442,7 +1442,7 @@ int | |||
1442 | save_serial(char *serialfile, char *suffix, BIGNUM *serial, | 1442 | save_serial(char *serialfile, char *suffix, BIGNUM *serial, |
1443 | ASN1_INTEGER **retai) | 1443 | ASN1_INTEGER **retai) |
1444 | { | 1444 | { |
1445 | char buf[1][BSIZE]; | 1445 | char buf[1][BUFLEN]; |
1446 | BIO *out = NULL; | 1446 | BIO *out = NULL; |
1447 | int ret = 0, n; | 1447 | int ret = 0, n; |
1448 | ASN1_INTEGER *ai = NULL; | 1448 | ASN1_INTEGER *ai = NULL; |
@@ -1452,12 +1452,12 @@ save_serial(char *serialfile, char *suffix, BIGNUM *serial, | |||
1452 | j = strlen(serialfile); | 1452 | j = strlen(serialfile); |
1453 | else | 1453 | else |
1454 | j = strlen(serialfile) + strlen(suffix) + 1; | 1454 | j = strlen(serialfile) + strlen(suffix) + 1; |
1455 | if (j >= BSIZE) { | 1455 | if (j >= BUFLEN) { |
1456 | BIO_printf(bio_err, "file name too long\n"); | 1456 | BIO_printf(bio_err, "file name too long\n"); |
1457 | goto err; | 1457 | goto err; |
1458 | } | 1458 | } |
1459 | if (suffix == NULL) | 1459 | if (suffix == NULL) |
1460 | n = strlcpy(buf[0], serialfile, BSIZE); | 1460 | n = strlcpy(buf[0], serialfile, BUFLEN); |
1461 | else | 1461 | else |
1462 | n = snprintf(buf[0], sizeof buf[0], "%s.%s", | 1462 | n = snprintf(buf[0], sizeof buf[0], "%s.%s", |
1463 | serialfile, suffix); | 1463 | serialfile, suffix); |
@@ -1498,14 +1498,14 @@ err: | |||
1498 | int | 1498 | int |
1499 | rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) | 1499 | rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) |
1500 | { | 1500 | { |
1501 | char buf[5][BSIZE]; | 1501 | char buf[5][BUFLEN]; |
1502 | int i, j; | 1502 | int i, j; |
1503 | 1503 | ||
1504 | i = strlen(serialfile) + strlen(old_suffix); | 1504 | i = strlen(serialfile) + strlen(old_suffix); |
1505 | j = strlen(serialfile) + strlen(new_suffix); | 1505 | j = strlen(serialfile) + strlen(new_suffix); |
1506 | if (i > j) | 1506 | if (i > j) |
1507 | j = i; | 1507 | j = i; |
1508 | if (j + 1 >= BSIZE) { | 1508 | if (j + 1 >= BUFLEN) { |
1509 | BIO_printf(bio_err, "file name too long\n"); | 1509 | BIO_printf(bio_err, "file name too long\n"); |
1510 | goto err; | 1510 | goto err; |
1511 | } | 1511 | } |
@@ -1570,7 +1570,7 @@ load_index(char *dbfile, DB_ATTR *db_attr) | |||
1570 | TXT_DB *tmpdb = NULL; | 1570 | TXT_DB *tmpdb = NULL; |
1571 | BIO *in = BIO_new(BIO_s_file()); | 1571 | BIO *in = BIO_new(BIO_s_file()); |
1572 | CONF *dbattr_conf = NULL; | 1572 | CONF *dbattr_conf = NULL; |
1573 | char buf[1][BSIZE]; | 1573 | char buf[1][BUFLEN]; |
1574 | long errorline = -1; | 1574 | long errorline = -1; |
1575 | 1575 | ||
1576 | if (in == NULL) { | 1576 | if (in == NULL) { |
@@ -1650,7 +1650,7 @@ index_index(CA_DB *db) | |||
1650 | int | 1650 | int |
1651 | save_index(const char *dbfile, const char *suffix, CA_DB *db) | 1651 | save_index(const char *dbfile, const char *suffix, CA_DB *db) |
1652 | { | 1652 | { |
1653 | char buf[3][BSIZE]; | 1653 | char buf[3][BUFLEN]; |
1654 | BIO *out = BIO_new(BIO_s_file()); | 1654 | BIO *out = BIO_new(BIO_s_file()); |
1655 | int j; | 1655 | int j; |
1656 | 1656 | ||
@@ -1659,7 +1659,7 @@ save_index(const char *dbfile, const char *suffix, CA_DB *db) | |||
1659 | goto err; | 1659 | goto err; |
1660 | } | 1660 | } |
1661 | j = strlen(dbfile) + strlen(suffix); | 1661 | j = strlen(dbfile) + strlen(suffix); |
1662 | if (j + 6 >= BSIZE) { | 1662 | if (j + 6 >= BUFLEN) { |
1663 | BIO_printf(bio_err, "file name too long\n"); | 1663 | BIO_printf(bio_err, "file name too long\n"); |
1664 | goto err; | 1664 | goto err; |
1665 | } | 1665 | } |
@@ -1700,14 +1700,14 @@ err: | |||
1700 | int | 1700 | int |
1701 | rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) | 1701 | rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) |
1702 | { | 1702 | { |
1703 | char buf[5][BSIZE]; | 1703 | char buf[5][BUFLEN]; |
1704 | int i, j; | 1704 | int i, j; |
1705 | 1705 | ||
1706 | i = strlen(dbfile) + strlen(old_suffix); | 1706 | i = strlen(dbfile) + strlen(old_suffix); |
1707 | j = strlen(dbfile) + strlen(new_suffix); | 1707 | j = strlen(dbfile) + strlen(new_suffix); |
1708 | if (i > j) | 1708 | if (i > j) |
1709 | j = i; | 1709 | j = i; |
1710 | if (j + 6 >= BSIZE) { | 1710 | if (j + 6 >= BUFLEN) { |
1711 | BIO_printf(bio_err, "file name too long\n"); | 1711 | BIO_printf(bio_err, "file name too long\n"); |
1712 | goto err; | 1712 | goto err; |
1713 | } | 1713 | } |
diff --git a/src/usr.bin/openssl/ca.c b/src/usr.bin/openssl/ca.c index 0e2e1c6450..c5ab691600 100644 --- a/src/usr.bin/openssl/ca.c +++ b/src/usr.bin/openssl/ca.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ca.c,v 1.3 2014/09/01 20:54:37 doug Exp $ */ | 1 | /* $OpenBSD: ca.c,v 1.4 2015/02/07 04:09:43 bcook Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -291,8 +291,8 @@ ca_main(int argc, char **argv) | |||
291 | STACK_OF(CONF_VALUE) * attribs = NULL; | 291 | STACK_OF(CONF_VALUE) * attribs = NULL; |
292 | STACK_OF(X509) * cert_sk = NULL; | 292 | STACK_OF(X509) * cert_sk = NULL; |
293 | STACK_OF(OPENSSL_STRING) * sigopts = NULL; | 293 | STACK_OF(OPENSSL_STRING) * sigopts = NULL; |
294 | #define BSIZE 256 | 294 | #define BUFLEN 256 |
295 | char buf[3][BSIZE]; | 295 | char buf[3][BUFLEN]; |
296 | #ifndef OPENSSL_NO_ENGINE | 296 | #ifndef OPENSSL_NO_ENGINE |
297 | char *engine = NULL; | 297 | char *engine = NULL; |
298 | #endif | 298 | #endif |