Re: Minor fixes in wget 1.6's main.c

2001-04-04 Thread R.I.P. Deaddog


Ask Philipp Thomas... he has already done that.



On Tue, 3 Apr 2001, [iso-8859-1] Nicolás Lichtmaier wrote:

   The problem is that when using gettext you must set LC_CTYPE (since
   recent versions of libc). The C library is really lacking in this
   respect, one should be able to force a locale for just one function
   call ( locprintf("C",... ) ? ).
 
  Yeah, but it's simply inheriting the flaws of the Unix localization
  model.  There is a hack to set the locale to "C" temporarily and
  revert back to whatever it was set to, but it's slow and ugly.
 
   In this case, the is*() functions should be replaced with custom
   versions, because the libc versions are supposed to be localized.
 
  That's what 1.7 does.

  Yup... I guess I'll port that to 1.6. It's easy to do.






Re: small security issue

2001-04-04 Thread Russ Allbery

Philipp Thomas [EMAIL PROTECTED] writes:

 I've been told by a collegue that wuftpd has function for modifying the
 info that ps shows. If there's interest, I could have a look at the
 wuftpd sources and see if I can come up with a patch for wget.

This doesn't work at all on some systems and on others is pretty trivial
to bypass (as in using different flags to ps still shows the command
line).  I'd think it's pretty questionable whether it's worth going to the
effort for this application, when you can't really rely on it anyway.

-- 
Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/



Re: Minor fixes in wget 1.6's main.c

2001-04-04 Thread Philipp Thomas

* Nicols Lichtmaier ([EMAIL PROTECTED]) [20010404 09:07]:

  That's what 1.7 does.
 
  Yup... I guess I'll port that to 1.6. It's easy to do.

Here's my patch against the WGET_1.6 branch as of today:

src/ChangeLog:

2001-04-04  Philipp Thomas  [EMAIL PROTECTED]

* safe-ctype.h: New file. Locale independent ctype.h
replacement taken from libiberty.
safe-ctype.c: New file. Tables for above.
Makefile.in: Add safe-ctype$o to OBJS.
Add dependencies for safe-ctype$o.
cmpt.c: Remove include of ctype.h. Use ISSPACE instead
of isspace.
ftp-basic.c: Don't include ctype.h.
ftp-ls.c: Likewise.
ftp.c: Likewise.
headers.c: Likewise.
host.c: Likewise.
html-parse.c: Likewise.
html-url.c: Likewise.
http.c: Likewise.
init.c: Likewise.
main.c: Likewise. Set LC_CTYPE along with LC_MESSAGES.
netrc.c: Likewise.
recur.c: Likewise.
retr.c: Likewise.
snprintf.c: Replace ctype.h with safe-ctype.h. Use
ISDIGIT instead of isdigit.
sysdep.h: Remove defines of ctype macros as they aren't
needed for safe-ctype-h.
url.c: Don't include ctype.h.
utils.c: Likewise.
wget.h: Include safe-ctype.h.

Index: src/Makefile.in
===
RCS file: /pack/anoncvs/wget/src/Makefile.in,v
retrieving revision 1.2
diff -u -r1.2 Makefile.in
--- src/Makefile.in 2000/11/04 22:49:45 1.2
+++ src/Makefile.in 2001/04/04 13:09:14
@@ -59,7 +59,7 @@
 OBJ = $(ALLOCA) cmpt$o connect$o fnmatch$o ftp$o ftp-basic$o  \
   ftp-ls$o $(OPIE_OBJ) getopt$o headers$o host$o html$o   \
   http$o init$o log$o main$o $(MD5_OBJ) netrc$o rbuf$o\
-  recur$o retr$o snprintf$o url$o utils$o version$o
+  recur$o retr$o snprintf$o url$o utils$o version$o safe-ctype$o
 
 .SUFFIXES:
 .SUFFIXES: .c .o ._c ._o
@@ -154,5 +154,6 @@
 rbuf$o: config.h wget.h sysdep.h options.h rbuf.h connect.h
 recur$o: config.h wget.h sysdep.h options.h url.h recur.h utils.h retr.h rbuf.h ftp.h 
fnmatch.h host.h
 retr$o: config.h wget.h sysdep.h options.h utils.h retr.h rbuf.h url.h recur.h ftp.h 
host.h connect.h
+safe-ctype$o: safe-ctype.h
 url$o: config.h wget.h sysdep.h options.h utils.h url.h host.h html.h
 utils$o: config.h wget.h sysdep.h options.h utils.h fnmatch.h
Index: src/cmpt.c
===
RCS file: /pack/anoncvs/wget/src/cmpt.c,v
retrieving revision 1.2
diff -u -r1.2 cmpt.c
--- src/cmpt.c  2000/04/12 13:23:34 1.2
+++ src/cmpt.c  2001/04/04 13:09:14
@@ -26,7 +26,6 @@
 #else
 # include strings.h
 #endif /* HAVE_STRING_H */
-#include ctype.h
 
 #include sys/types.h
 #ifdef HAVE_UNISTD_H
@@ -657,9 +656,9 @@
 {
   /* A white space in the format string matches 0 more or white
 space in the input string.  */
-  if (isspace (*fmt))
+  if (ISSPACE (*fmt))
{
- while (isspace (*rp))
+ while (ISSPACE (*rp))
++rp;
  ++fmt;
  continue;
@@ -851,7 +850,7 @@
case 'n':
case 't':
  /* Match any white space.  */
- while (isspace (*rp))
+ while (ISSPACE (*rp))
++rp;
  break;
case 'p':
Index: src/ftp-basic.c
===
RCS file: /pack/anoncvs/wget/src/ftp-basic.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 ftp-basic.c
--- src/ftp-basic.c 2000/12/17 18:14:29 1.3.2.1
+++ src/ftp-basic.c 2001/04/04 13:09:14
@@ -26,7 +26,6 @@
 #else
 # include strings.h
 #endif
-#include ctype.h
 #ifdef HAVE_UNISTD_H
 # include unistd.h
 #endif
Index: src/ftp-ls.c
===
RCS file: /pack/anoncvs/wget/src/ftp-ls.c,v
retrieving revision 1.2
diff -u -r1.2 ftp-ls.c
--- src/ftp-ls.c2000/11/10 18:01:35 1.2
+++ src/ftp-ls.c2001/04/04 13:09:14
@@ -30,7 +30,6 @@
 # include unistd.h
 #endif
 #include sys/types.h
-#include ctype.h
 #include errno.h
 
 #include "wget.h"
Index: src/ftp.c
===
RCS file: /pack/anoncvs/wget/src/ftp.c,v
retrieving revision 1.16.2.5
diff -u -r1.16.2.5 ftp.c
--- src/ftp.c   2000/12/31 03:55:20 1.16.2.5
+++ src/ftp.c   2001/04/04 13:09:14
@@ -26,7 +26,6 @@
 #else
 # include strings.h
 #endif
-#include ctype.h
 #ifdef HAVE_UNISTD_H
 # include unistd.h
 #endif
Index: src/headers.c
===
RCS file: /pack/anoncvs/wget/src/headers.c,v
retrieving revision 1.2
diff -u -r1.2 headers.c
--- src/headers.c   2000/04/12 13:23:34 1.2
+++ src/headers.c   2001/04/04 13:09:14
@@ -26,7 +26,6 @@
 #else
 # include strings.h
 #endif
-#include ctype.h
 
 #include "wget.h"
 #include "con

Re: Minor fixes in wget 1.6's main.c

2001-04-04 Thread Nicolás Lichtmaier

   That's what 1.7 does.
   Yup... I guess I'll port that to 1.6. It's easy to do.
 Here's my patch against the WGET_1.6 branch as of today:

 Thanks, I'll use this.




Re: Features I would like to (see) implement(ed)

2001-04-04 Thread Hrvoje Niksic

Please use wget-patches for submitting patches, not for general
discussion about Wget features.

"Christian Fraenkel" [EMAIL PROTECTED] writes:

 I thought a lot about wget lately and came up with some ideas(you
 could also call it a personal roadmap). I would like to try
 implement these ideas, too. I just wanted to ask for your oppinions
 about these ideas.
 
 longtime goal: make wget a real daemon.

Maybe I'm missing something.

Wget is designed to be a useful command-line tool.  I would love it to
become more useful for the users, but this doesn't really sound like
an improvement.  What's the point of Wget being a daemon?



maybe wget bug

2001-04-04 Thread David Christopher Asher

Hello,

I am using wget to invoke a CGI script call, while passing it several
variables.  For example:

wget -O myfile.txt
"http://user:[EMAIL PROTECTED]/myscript.cgi?COLOR=blueSHAPE=circle"

where myscript.cgi say, makes an image based on the parameters "COLOR" and
"SHAPE".  The problem I am having is when I need to pass a key/value pair
where the value contains the "" character.  Such as:

wget -O myfile.txt "http://user:[EMAIL PROTECTED]/myscript.cgi?COLOR=blue
 redSHAPE=circle"

I have tried encoding the "" as %26, but that does not seem to work (spaces
as %20 works fine).  The error log for the web server shows that the URL
requested does not say %26, but rather "".  It does not appear to me that
wget is sending the %26 as %26, but perhaps "fixing" it to "".

I am using GNU wget v1.5.3 with Red Hat 7.0

Thanks!

--
David Christopher Asher