From owner-freebsd-stable Tue Oct 31 4:43: 7 2000 Delivered-To: freebsd-stable@freebsd.org Received: from macbeth.phy.hr (macbeth.phy.hr [161.53.7.201]) by hub.freebsd.org (Postfix) with ESMTP id 2E11D37B4C5 for ; Tue, 31 Oct 2000 04:43:03 -0800 (PST) Received: (from kkumer@localhost) by macbeth.phy.hr (8.11.0/8.11.0) id e9VCh0x52558 for freebsd-stable@FreeBSD.org; Tue, 31 Oct 2000 13:43:00 +0100 (CET) (envelope-from kkumer) Date: Tue, 31 Oct 2000 13:43:00 +0100 From: Kresimir Kumericki To: freebsd-stable@FreeBSD.org Subject: How to apply security patch? Message-ID: <20001031134300.A52302@phy.hr> Reply-To: kkumer@phy.hr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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