Operating System - HP-UX
1820475 Members
2813 Online
109624 Solutions
New Discussion юеВ

realpath.patch, wu-ftp Installation

 
SOLVED
Go to solution
Wissam Elassal
Advisor

realpath.patch, wu-ftp Installation

I am running on HP-UX 11v2i and I want to install the wu-ftp 2.6.2 realpath.patch. However when issueing the command "patch - /patch path", I am propmted with " Hmm... I can't seem to find a patch in there anywhere" and I am sure that the path is correct, can anybody help please,thanks in advance
8 REPLIES 8
Steven Schweda
Honored Contributor

Re: realpath.patch, wu-ftp Installation

Anyone who can help you is more likely to be
reading the HP-UX forums than this Tru64
forum.

What's in the ".patch" file?

Does "patch - /patch path" make sense?

Have you tried using GNU "patch" instead of
the "patch" which comes with HP-UX?

http://www.gnu.org/software/patch/patch.html
Wissam Elassal
Advisor

Re: realpath.patch, wu-ftp Installation

I ve also tried the cmd patch < /patchPath and it is always propmpting the same mesg. Thanks for your help
Steven Schweda
Honored Contributor

Re: realpath.patch, wu-ftp Installation

> What's in the ".patch" file?

I can't see what's in your patch file, and I
can't see which directory you're in, or
what's in that directory, or exactly what
your actual "patch" command is, or which
"patch" program you're using. And I can't
read your mind at this distance. Should I
call the psychic, or would you like to do it?

Or, you could see if the people in the HP-UX
forum are better mind readers than I am.
(But I doubt that that will help.)
Dennis Handly
Acclaimed Contributor

Re: realpath.patch, wu-ftp Installation

This error message is in patch(1). It is also in my copy of GNU patch.

patch(1) does say:
The message ``Hmm...'' indicates that there is unprocessed text in the patch file and that patch is attempting to intuit whether there is a patch in that text and, if so, what kind of patch it is.

You haven't exported UNIX95 have you??

Wissam Elassal
Advisor

Re: realpath.patch, wu-ftp Installation

ok , so here is the content of the .patch file
--- src/realpath.c.orig Mon Aug 4 11:20:19 2003
+++ src/realpath.c Mon Aug 4 11:23:22 2003
@@ -299,7 +299,7 @@
rootd = 0;

if (*wbuf) {
- if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+ if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) {
errno = ENAMETOOLONG;
goto err1;
}

the patch is in /tmp , from where i am trying to execute it.
Steven Schweda
Honored Contributor
Solution

Re: realpath.patch, wu-ftp Installation

> ok , so here is the content of the .patch
> file

That's a start.

> the patch is in /tmp , from where i am
> trying to execute it.

Great. Now, if I knew what else was in that
directory, I might have a clue to what you're
doing. (I asked all those questions for
_your_ benefit, not for mine. The fewer you
answer, the less I can do.)

Around here:

dy# type patch
patch is hashed (/usr/bin/patch)

dy# patch < ../realpath.patch
Hmm... I can't seem to find a patch in there anywhere.

dy# type gpatch
gpatch is hashed (/usr/local/bin/gpatch)

dy# ls -l /usr/local/bin/gpatch
lrwxrwxrwx 1 root sys 5 Jul 30 15:59 /usr/local/bin/gpatch -> patch

dy# gpatch < ../realpath.patch
can't find file to patch at input line 8
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|A vulnerability has been found in the current versions of wu-ftpd, follow
|the links from http://www.wu-ftpd.org/ for details.
|
|Included below is a patch for CAN-2003-0466 to be applied to wu-ftpd 2.6.2.
|
|--- src/realpath.c.orig Mon Aug 4 11:20:19 2003
|+++ src/realpath.c Mon Aug 4 11:23:22 2003
--------------------------
File to patch: src/realpath.c
patching file src/realpath.c


Apparently, you have a "unified context diff"
patch file, which requires a "patch" program
which can understand those. The "patch"
supplied with HP-UX appears not to be such a
program, but GNU "patch" is. (Why it made me
specify the "File to patch" is a mystery to
me, but many things are.) It works about the
same for the other two recommended patches,
too.

http://www.wu-ftpd.org/

> Have you tried using GNU "patch" instead of
> the "patch" which comes with HP-UX?
>
> http://www.gnu.org/software/patch/patch.html

Perhaps I _am_ psychic.
Dennis Handly
Acclaimed Contributor

Re: realpath.patch, wu-ftp Installation

>so here is the content of the .patch file

You will have to attach the file since it gets corrupted if you don't retain the format.

When I changed it to look like this, it worked:
*** src/realpath.c Thu Aug 2 14:48:58 2007
--- src/realpath.c.new Thu Aug 2 14:50:12 2007
***************
*** 1,7 ****
rootd = 0;

if (*wbuf) {
! if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
errno = ENAMETOOLONG;
goto err1;
}
--- 1,7 ----
rootd = 0;

if (*wbuf) {
! if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) {
errno = ENAMETOOLONG;
goto err1;
}

Using my GNU patch didn't like what I thought the original patch file should be:
patch: **** Only garbage was found in the patch input.
Steven Schweda
Honored Contributor

Re: realpath.patch, wu-ftp Installation

> You will have to attach the file [...]

Use the source, Luke:

http://www.wu-ftpd.org/

ftp://ftp.wu-ftpd.org/pub/wu-ftpd/patches/apply_to_2.6.2/realpath.patch

ftp://ftp.wu-ftpd.org/pub/wu-ftpd/patches/apply_to_2.6.2/

The wu-ftpd.org server was dead for a while,
but it seems to be alive again, now.