# Why cannot i patch "unix.patch" ?



## sw2wolf (Sep 29, 2011)

According to FreeBSD Security Advisory, i download unix.patch and do the following:

```
>uname -a
FreeBSD mybsd.zsoft.com 8.2-RELEASE FreeBSD 8.2-RELEASE #2: Sat Feb 26 16:53:57 CST 2011     
root@mybsd.zsoft.com:/media/G/usr/obj/media/G/usr/src/sys/MYKERNEL  i386

>sudo patch < /media/E/RnD/freebsd/unix.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: sys/kern/uipc_usrreq.c
|===================================================================
|--- sys/kern/uipc_usrreq.c	(revision 225745)
|+++ sys/kern/uipc_usrreq.c	(working copy)
--------------------------
File to patch:
```
>

what does it mean?


----------



## wblock@ (Sep 29, 2011)

"File to patch:" means it didn't find the file it wants to patch relative to the current directory.


```
+++ sys/kern/uipc_usrreq.c
```

It's looking for that file path relative to the current directory.  So:
`# cd /usr/src`
`# patch < /media/E/RnD/freebsd/unix.patch`


----------



## sw2wolf (Sep 29, 2011)

thanks!


----------



## jb_fvwm2 (Sep 29, 2011)

BTW an alternate, shorter way maybe than the instruction(link) in the advisory (which I did not read), if one has kernel sources already, may be the paragraph in UPDATING (not the ports UPDATING ) that is titled "to just build a kernel when you know it won't mess you up..." after consulting 
	
	



```
uname -a
```
 of course... after the patch has been applied.


----------

