# Snort with snortsam patch?



## guidors (Dec 10, 2011)

Hi,

I have set up FreeBSD 8.2 with the security ports Snort and Base. I would like to compile usage of Snortsam into Snort to block bugging traffic but selecting that option with *make config* renders the port broken:


```
snort-2.9.1.2 is marked as broken: snortsam patches not available for 2.9.1 yet.
```

On this site I found a Freebsd FreeBSD ports bug fix freebsd-ports-bugs Archive, but I wonder how to apply this patch and if it is really valid.

I patch it like this:

```
# pwd
/usr/ports/security/snort
# patch <patch_snort.txt

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: Makefile
|===================================================================
|RCS file: /home/pcvs/ports/security/snort/Makefile,v
|retrieving revision 1.141
|diff -u -r1.141 Makefile
|--- Makefile 25 Oct 2011 20:11:35 -0000      1.141
|+++ Makefile      21 Nov 2011 21:58:04 -0000
--------------------------
Patching file Makefile using Plan A...
Hunk #1 failed at 7.
Hunk #2 failed at 176.
Hunk #3 failed at 228.
3 out of 3 hunks failed--saving rejects to Makefile.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: distinfo
|===================================================================
|RCS file: /home/pcvs/ports/security/snort/distinfo,v
|retrieving revision 1.74
|diff -u -r1.74 distinfo
|--- distinfo  21 Nov 2011 18:27:00 -0000      1.74
|+++ distinfo       21 Nov 2011 21:58:04 -0000
--------------------------
Patching file distinfo using Plan A...
Hunk #1 succeeded at 1 with fuzz 1.
done
```
But it is not working. What am I doing wrong? And is this the way to go to apply this fix?

Thanks for helping out.

Guido


----------



## guidors (Jan 6, 2012)

Just to conclude this thread, I solved this issue after I found out that indentations of the patch are missing. On the site where I retrieved the code of the patch leading spaces were missing. However, these indentations are necessary in order for patch to work correctly.


----------

