[w3m-dev 02933] segmentation fault when w3m -dump https:
* file.c (readHeader): use inputAnswer() * file.c (getAuthCookie): remove term_cbreak() * file.c (checkOverWrite): use inputAnswer() * file.c (inputAnswer): added * istream.c (ssl_get_certificate): use inputAnswer() * main.c (qquitfm): change prompt * proto.h (inputAnswer): added From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
2002-01-31 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 02933] segmentation fault when w3m -dump https:
|
||||||
|
* file.c (readHeader): use inputAnswer()
|
||||||
|
* file.c (getAuthCookie): remove term_cbreak()
|
||||||
|
* file.c (checkOverWrite): use inputAnswer()
|
||||||
|
* file.c (inputAnswer): added
|
||||||
|
* istream.c (ssl_get_certificate): use inputAnswer()
|
||||||
|
* main.c (qquitfm): change prompt
|
||||||
|
* proto.h (inputAnswer): added
|
||||||
|
|
||||||
2002-01-30 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
2002-01-30 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 02931] use POST in multipart.cgi
|
* [w3m-dev 02931] use POST in multipart.cgi
|
||||||
@@ -2410,4 +2421,4 @@
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.276 2002/01/30 04:42:38 ukai Exp $
|
$Id: ChangeLog,v 1.277 2002/01/30 15:08:48 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: file.c,v 1.50 2002/01/30 04:25:02 ukai Exp $ */
|
/* $Id: file.c,v 1.51 2002/01/30 15:08:48 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "myctype.h"
|
#include "myctype.h"
|
||||||
@@ -731,16 +731,14 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
|
|||||||
? "y" : NULL;
|
? "y" : NULL;
|
||||||
if (fmInitialized && (err & COO_OVERRIDE_OK) &&
|
if (fmInitialized && (err & COO_OVERRIDE_OK) &&
|
||||||
accept_bad_cookie == ACCEPT_BAD_COOKIE_ASK) {
|
accept_bad_cookie == ACCEPT_BAD_COOKIE_ASK) {
|
||||||
Str msg =
|
Str msg = Sprintf("Accept bad cookie from %s for %s?",
|
||||||
Sprintf
|
|
||||||
("Accept bad cookie from %s for %s? (y or n) ",
|
|
||||||
pu->host,
|
pu->host,
|
||||||
domain
|
((domain && domain->ptr)
|
||||||
&& domain->ptr ? domain->ptr : "<localdomain>");
|
? domain->ptr : "<localdomain>"));
|
||||||
if (msg->length > COLS - 4)
|
if (msg->length > COLS - 10)
|
||||||
Strshrink(msg, msg->length - (COLS - 4));
|
Strshrink(msg, msg->length - (COLS - 10));
|
||||||
term_raw();
|
Strcat_charp(msg, " (y/n)");
|
||||||
ans = inputChar(msg->ptr);
|
ans = inputAnswer(msg->ptr);
|
||||||
}
|
}
|
||||||
if (ans == NULL || tolower(*ans) != 'y' ||
|
if (ans == NULL || tolower(*ans) != 'y' ||
|
||||||
(err =
|
(err =
|
||||||
@@ -1222,7 +1220,6 @@ getAuthCookie(struct http_auth *hauth, char *auth_header,
|
|||||||
IN_PASSWORD)) == NULL)
|
IN_PASSWORD)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
pwd = Str_conv_to_system(Strnew_charp(pp));
|
pwd = Str_conv_to_system(Strnew_charp(pp));
|
||||||
term_cbreak();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int proxy = !strncasecmp("Proxy-Authorization:", auth_header,
|
int proxy = !strncasecmp("Proxy-Authorization:", auth_header,
|
||||||
@@ -6393,24 +6390,36 @@ int
|
|||||||
checkOverWrite(char *path)
|
checkOverWrite(char *path)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char buf[2];
|
char *ans;
|
||||||
char *ans = NULL;
|
|
||||||
|
|
||||||
if (stat(path, &st) < 0)
|
if (stat(path, &st) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (fmInitialized) {
|
ans = inputAnswer("File exists. Overwrite? (y/n)");
|
||||||
ans = inputChar("File exists. Overwrite? (y or n)");
|
if (ans && tolower(*ans) == 'y')
|
||||||
}
|
|
||||||
else {
|
|
||||||
printf("File exists. Overwrite? (y or n)");
|
|
||||||
ans = fgets(buf, 2, stdin);
|
|
||||||
}
|
|
||||||
if (ans != NULL && (*ans == '\0' || tolower(*ans) == 'y'))
|
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
inputAnswer(char *prompt)
|
||||||
|
{
|
||||||
|
char *ans;
|
||||||
|
char buf[2];
|
||||||
|
|
||||||
|
if (fmInitialized) {
|
||||||
|
term_raw();
|
||||||
|
ans = inputChar(prompt);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf(prompt);
|
||||||
|
fflush(stdout);
|
||||||
|
fgets(buf, 2, stdin);
|
||||||
|
ans = allocStr(buf, 1);
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
uncompress_stream(URLFile *uf)
|
uncompress_stream(URLFile *uf)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: istream.c,v 1.11 2002/01/12 13:33:47 ukai Exp $ */
|
/* $Id: istream.c,v 1.12 2002/01/30 15:08:48 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include "istream.h"
|
#include "istream.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -476,11 +476,10 @@ ssl_get_certificate(InputStream stream, char *hostname)
|
|||||||
&& strcasecmp(accept_this_site->ptr, hostname) == 0)
|
&& strcasecmp(accept_this_site->ptr, hostname) == 0)
|
||||||
ans = "y";
|
ans = "y";
|
||||||
else {
|
else {
|
||||||
emsg = Strnew_charp("No SSL peer certificate: accept (y/n)?");
|
emsg = Strnew_charp("No SSL peer certificate: accept? (y/n)");
|
||||||
term_raw();
|
ans = inputAnswer(emsg->ptr);
|
||||||
ans = inputChar(emsg->ptr);
|
|
||||||
}
|
}
|
||||||
if (tolower(*ans) == 'y')
|
if (ans && tolower(*ans) == 'y')
|
||||||
amsg = Strnew_charp
|
amsg = Strnew_charp
|
||||||
("Accept SSL session without any peer certificate");
|
("Accept SSL session without any peer certificate");
|
||||||
else {
|
else {
|
||||||
@@ -510,11 +509,10 @@ ssl_get_certificate(InputStream stream, char *hostname)
|
|||||||
&& strcasecmp(accept_this_site->ptr, hostname) == 0)
|
&& strcasecmp(accept_this_site->ptr, hostname) == 0)
|
||||||
ans = "y";
|
ans = "y";
|
||||||
else {
|
else {
|
||||||
emsg = Sprintf("%s: accept (y/n)?", em);
|
emsg = Sprintf("%s: accept? (y/n)", em);
|
||||||
term_raw();
|
ans = inputAnswer(emsg->ptr);
|
||||||
ans = inputChar(emsg->ptr);
|
|
||||||
}
|
}
|
||||||
if (tolower(*ans) == 'y') {
|
if (ans && tolower(*ans) == 'y') {
|
||||||
amsg = Sprintf("Accept unsecure SSL session: "
|
amsg = Sprintf("Accept unsecure SSL session: "
|
||||||
"unverified: %s", em);
|
"unverified: %s", em);
|
||||||
}
|
}
|
||||||
@@ -537,11 +535,10 @@ ssl_get_certificate(InputStream stream, char *hostname)
|
|||||||
Str ep = Strdup(emsg);
|
Str ep = Strdup(emsg);
|
||||||
if (ep->length > COLS - 16)
|
if (ep->length > COLS - 16)
|
||||||
Strshrink(ep, ep->length - (COLS - 16));
|
Strshrink(ep, ep->length - (COLS - 16));
|
||||||
term_raw();
|
Strcat_charp(ep, ": accept? (y/n)");
|
||||||
Strcat_charp(ep, ": accept(y/n)?");
|
ans = inputAnswer(ep->ptr);
|
||||||
ans = inputChar(ep->ptr);
|
|
||||||
}
|
}
|
||||||
if (tolower(*ans) == 'y') {
|
if (ans && tolower(*ans) == 'y') {
|
||||||
amsg = Strnew_charp("Accept unsecure SSL session:");
|
amsg = Strnew_charp("Accept unsecure SSL session:");
|
||||||
Strcat(amsg, emsg);
|
Strcat(amsg, emsg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: main.c,v 1.73 2002/01/26 17:24:01 ukai Exp $ */
|
/* $Id: main.c,v 1.74 2002/01/30 15:08:48 ukai Exp $ */
|
||||||
#define MAINPROGRAM
|
#define MAINPROGRAM
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -2095,8 +2095,8 @@ qquitfm(void)
|
|||||||
char *ans;
|
char *ans;
|
||||||
if (!confirm_on_quit)
|
if (!confirm_on_quit)
|
||||||
quitfm();
|
quitfm();
|
||||||
ans = inputChar("Do you want to exit w3m? (y or n)");
|
ans = inputChar("Do you want to exit w3m? (y/n)");
|
||||||
if (ans != NULL && tolower(*ans) == 'y')
|
if (ans && tolower(*ans) == 'y')
|
||||||
quitfm();
|
quitfm();
|
||||||
displayBuffer(Currentbuf, B_NORMAL);
|
displayBuffer(Currentbuf, B_NORMAL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: proto.h,v 1.30 2002/01/29 19:08:50 ukai Exp $ */
|
/* $Id: proto.h,v 1.31 2002/01/30 15:08:48 ukai Exp $ */
|
||||||
/*
|
/*
|
||||||
* This file was automatically generated by version 1.7 of cextract.
|
* This file was automatically generated by version 1.7 of cextract.
|
||||||
* Manual editing not recommended.
|
* Manual editing not recommended.
|
||||||
@@ -184,6 +184,7 @@ extern void doFileSave(URLFile uf, char *defstr);
|
|||||||
extern int checkCopyFile(char *path1, char *path2);
|
extern int checkCopyFile(char *path1, char *path2);
|
||||||
extern int checkSaveFile(InputStream stream, char *path);
|
extern int checkSaveFile(InputStream stream, char *path);
|
||||||
extern int checkOverWrite(char *path);
|
extern int checkOverWrite(char *path);
|
||||||
|
extern char *inputAnswer(char *prompt);
|
||||||
extern int matchattr(char *p, char *attr, int len, Str *value);
|
extern int matchattr(char *p, char *attr, int len, Str *value);
|
||||||
extern char *checkHeader(Buffer *buf, char *field);
|
extern char *checkHeader(Buffer *buf, char *field);
|
||||||
extern Buffer *newBuffer(int width);
|
extern Buffer *newBuffer(int width);
|
||||||
|
|||||||
Reference in New Issue
Block a user