Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2000 13:43:00 +0100
From:      Kresimir Kumericki <kkumer@phy.hr>
To:        freebsd-stable@FreeBSD.org
Subject:   How to apply security patch?
Message-ID:  <20001031134300.A52302@phy.hr>

next in thread | raw e-mail | index | archive | help

   It seems that I don't understand patching. For example, I tried the
recent patch for tcpdump. I downloaded the tcpdump-4.x.patch and
saved it to /root/patches. Then I followed instructions in security
advisory:

   # cd /usr/src/contrib/tcpdump
   # patch -p < ~/patches/tcpdump-4.x.patch
   patch: option requires an argument -- p
   patch: Try `patch --help' for more information.

I read 'man path' and find out that -p takes [strip-count] as an
argument, but it also claims it to be optional:
"setting -p or -p0 gives the entire  pathname  unmodified".
This seems to be in conflict with the above error message.
Anyway, looking at the patch file, I see that files there are
specified as "Index: addrtoname.c" so I guessed that strip-count=0
is in order:

   # patch -p0 < ~/patches/tcpdump-4.x.patch
   patching file `addrtoname.c'
   Reversed (or previously applied) patch detected!  Assume -R? [n]

 I read the manpage again and assume that security officer has not
made a mistake of swapping old and new files so I press [n]:

   Apply anyway? [n] y
   Hunk #1 FAILED at 559.
   Hunk #2 FAILED at 585.
   2 out of 2 hunks FAILED -- saving rejects to addrtoname.c.rej
   patching file `ethertype.h'
   Hunk #1 FAILED at 19.
   1 out of 1 hunk FAILED -- saving rejects to ethertype.h.rej
   patching file `interface.h'
   Hunk #1 FAILED at 19.
   1 out of 1 hunk FAILED -- saving rejects to interface.h.rej
   patching file `ppp.h'
   Hunk #1 FAILED at 15.
   1 out of 1 hunk FAILED -- saving rejects to ppp.h.rej
   patching file `print-atalk.c'
   Reversed (or previously applied) patch detected!  Assume -R? [n] 

If, on the other hand, I press [y]:

   Hunk #1 succeeded at 559 (offset 34 lines).
   Hunk #2 succeeded at 570 (offset 19 lines).
   patching file `ethertype.h'
   Hunk #1 FAILED at 19.
   1 out of 1 hunk FAILED -- saving rejects to ethertype.h.rej
   patching file `interface.h'
   Hunk #1 FAILED at 19.
   1 out of 1 hunk FAILED -- saving rejects to interface.h.rej
   patching file `ppp.h'
   Hunk #1 FAILED at 15.
   1 out of 1 hunk FAILED -- saving rejects to ppp.h.rej
   patching file `print-atalk.c'
   Reversed (or previously applied) patch detected!  Assume -R? [n]

What am I doing wrong? I remember trying some other patch some time
ago with exactly the same results.

-- 
Kresimir Kumericki    kkumer@phy.hr    http://www.phy.hr/~kkumer/
"Fizika svemira" - http://eskola.hfd.hr/fizika_svemira/svemir.html


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001031134300.A52302>