mirror of
https://github.com/apache/httpd.git
synced 2025-08-20 16:09:55 +00:00
serious bug fix:
htdigest didn't init the first parm to ap_open(), so ap_open() segfaults thinking it was passed valid storage build portability: make most src/lib/apr/test/Makefile.in compatible with OS/390 make (no -o outfile after infile specified) MD5 translation support: when APR_HAS_XLATE, low-level routines allow translation handle to be specified when CHARSET_EBCDIC, password-specific routines always translate, but client app must set handle before using git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85160 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -85,6 +85,10 @@
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
#if 'A' == 0xC1
|
||||
#define CHARSET_EBCDIC
|
||||
#endif
|
||||
|
||||
#ifdef CHARSET_EBCDIC
|
||||
#define LF '\n'
|
||||
#define CR '\r'
|
||||
@ -97,6 +101,9 @@
|
||||
|
||||
char *tn;
|
||||
ap_pool_t *cntxt;
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ap_xlate_t *to_ascii;
|
||||
#endif
|
||||
|
||||
static void getword(char *word, char *line, char stop)
|
||||
{
|
||||
@ -178,6 +185,9 @@ static void add_password(char *user, char *realm, ap_file_t *f)
|
||||
sprintf(string, "%s:%s:%s", user, realm, pw);
|
||||
|
||||
ap_MD5Init(&context);
|
||||
#ifdef CHARSET_EBCDIC
|
||||
ap_MD5SetXlate(&context, to_ascii);
|
||||
#endif
|
||||
ap_MD5Update(&context, (unsigned char *) string, strlen(string));
|
||||
ap_MD5Final(digest, &context);
|
||||
|
||||
@ -204,7 +214,8 @@ static void interrupted(void)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
ap_file_t *tfp, *f;
|
||||
ap_file_t *tfp = NULL, *f;
|
||||
ap_status_t rv;
|
||||
char user[MAX_STRING_LEN];
|
||||
char realm[MAX_STRING_LEN];
|
||||
char line[MAX_STRING_LEN];
|
||||
@ -214,10 +225,24 @@ int main(int argc, char *argv[])
|
||||
char command[MAX_STRING_LEN];
|
||||
int found;
|
||||
|
||||
ap_initialize();
|
||||
rv = ap_initialize();
|
||||
if (rv) {
|
||||
fprintf(stderr, "ap_initialize(): %s (%d)\n",
|
||||
ap_strerror(rv, line, sizeof(line)), rv);
|
||||
exit(1);
|
||||
}
|
||||
atexit(ap_terminate);
|
||||
ap_create_pool(&cntxt, NULL);
|
||||
|
||||
#ifdef CHARSET_EBCDIC
|
||||
rv = ap_xlate_open(&to_ascii, "ISO8859-1", APR_DEFAULT_CHARSET, cntxt);
|
||||
if (rv) {
|
||||
fprintf(stderr, "ap_xlate_open(): %s (%d)\n",
|
||||
ap_strerror(rv, line, sizeof(line)), rv);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
tn = NULL;
|
||||
ap_signal(SIGINT, (void (*)(int)) interrupted);
|
||||
if (argc == 5) {
|
||||
|
Reference in New Issue
Block a user