# How to patch local_unbound?



## shinx (Sep 19, 2019)

Hi folks, I have a question on how do I patch local_unbound in FreeBSD.

I have tried with `pkg upgrade local_unbound`, but it returns "pkg: local_unbound is not installed, therefore upgrade is impossible".

All I wanted is to patch the local_unbound for this bug BUG#232555, and only 1 line change is required as shown here.

Since I have several servers running FreeBSD, hence I was looking for a way to patch them something like `pkg upgrade local_unbound` without needing to SSH into each of the server and make that one line change.

Thanks in advance.


----------



## sand_man (Sep 19, 2019)

It's part of base so should be patched by freebsd-update I believe.


----------



## Phishfry (Sep 19, 2019)

I just checked on FreeBSD 11.3-RELEASE p3 and it does not contain the fix. So `freebsd-update` won't help if your using that.
Interesting because this was committed on Nov 1, 2018 to HEAD branch. With the MFC set at 3 days it should have Merged to Stable on Nov 4, 2018.
That might have been cutting it close for FreeBSD 12.0-RELEASE, which was released in December 2018.
I was expecting to see FreeBSD 11.3-RELEASE patched as it was culled from FreeBSD 11-STABLE well after the MFC date for the fix.


----------



## shinx (Sep 19, 2019)

Phishfry said:


> I just checked on FreeBSD 11.3-RELEASE p3 and it does not contain the fix. So `freebsd-update` won't help if your using that.
> Interesting because this was committed on Nov 1, 2018 to HEAD branch. With the MFC set at 3 days it should have Merged to Stable on Nov 4, 2018.
> That might have been cutting it close for FreeBSD 12.0-RELEASE, which was released in December 2018.
> I was expecting to see FreeBSD 11.3-RELEASE patched as it was culled from FreeBSD 11-STABLE well after the MFC date for the fix.



You're right, it is not patched in 11.3-RELEASE.

On the other hand, I could not find it in 12.0-RELEASE, the 


			https://svn.freebsd.org/base/releng/12.0/etc/rc.d/local_unbound
		

 is not there.


----------



## ondra_knezour (Sep 19, 2019)

shinx said:


> On the other hand, I could not find it in 12.0-RELEASE, the
> 
> 
> https://svn.freebsd.org/base/releng/12.0/etc/rc.d/local_unbound
> ...



Wrong directory. PR is mentioned with this commit https://svnweb.freebsd.org/base?view=revision&revision=340219


----------



## D-FENS (Sep 19, 2019)

Unbound is a part of the base system, so updating: via freebsd-update, or building the base from sources.
If you can't get the update with 11.3-RELEASE, the way to go would be to upgrade major version.


----------



## SirDice (Sep 19, 2019)

Has the bug been fixed in the port version? If it's fixed there you could fairly easily switch to dns/unbound temporarily and switch back to local-unbound(8) when it's fixed in the base.


----------



## ondra_knezour (Sep 19, 2019)

And finally, if you consider this change absolute necessary for you, it is only one character change in the rc script, so you can change this

```
if [ ! -f ${local_unbound_anchor} ] ; then
```
 to this

```
if [ ! -s ${local_unbound_anchor} ] ; then
```
 in /etc/rc.d/local_unbound file temporarily.


----------

