#include "apps.h"
-#if defined(unix) || defined(__APPLE__)
+#if defined(OPENSSL_SYS_UNIX) || defined(__APPLE__)
# include <unistd.h>
# include <stdio.h>
# include <limits.h>
# include <openssl/x509.h>
+# ifndef NAME_MAX
+# define NAME_MAX 255
+# endif
# define MAX_COLLISIONS 256
typedef struct hentry_st {
ep = app_malloc(sizeof(*ep), "collision bucket");
*ep = nilhentry;
ep->old_id = ~0;
- ep->filename = BUF_strdup(filename);
+ ep->filename = OPENSSL_strdup(filename);
if (bp->last_entry)
bp->last_entry->next = ep;
if (bp->first_entry == NULL)
unsigned int hash = 0;
int i, type, id;
unsigned char ch;
- char linktarget[NAME_MAX], *endptr;
+ char linktarget[PATH_MAX], *endptr;
ssize_t n;
for (i = 0; i < 8; i++) {
if (app_access(dirname, W_OK) < 0) {
BIO_printf(bio_err, "Skipping %s, can't write\n", dirname);
- return 0;
+ return 1;
}
buflen = strlen(dirname);
pathsep = (buflen && dirname[buflen - 1] == '/') ? "" : "/";
- buflen += NAME_MAX + 2;
+ buflen += NAME_MAX + 1 + 1;
buf = app_malloc(buflen, "filename buffer");
if (verbose)
while (*argv)
errs += do_dir(*argv++, h);
} else if ((env = getenv("SSL_CERT_DIR")) != NULL) {
- m = BUF_strdup(env);
+ m = OPENSSL_strdup(env);
for (e = strtok(m, ":"); e != NULL; e = strtok(NULL, ":"))
errs += do_dir(e, h);
OPENSSL_free(m);
return (1);
}
-#endif /* defined(unix) || defined(__APPLE__) */
+#endif /* defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) */