[Momonga-devel.ja:00818] snort db bug (Re: acid spec error)


On Sat, Oct 26, 2002 at 12:45:31AM -0400,
"Kikutani, Makoto" <poo@xxxxxxxxxxxxxxxxx> wrote:

> かずひこさんのおかげでacid自体は動くようになったんだけど、
> このあいだsnortを1.9.0に上げたら、そいつが動いてないことが判明。
> 
> /var/log/messages に
> 
>  snort: FATAL ERROR: database: The underlying database seems to be running 
> an older version of the DB schema (current version=105, required minimum 
> version= 106). If you have an existing database with events logged by a 
> previous version of snort, this database must first be upgraded to the 
> latest schema (see the snort-users mailing list archive or DB plugin
> documention for details). If migrating old data is not desired, merely create 
> a new instance of the snort database using the appropriate DB creation script
> (e.g. create_mysql, create_postgresql, create_oracle, create_mssql)
> located in the contrib directory. See the database documentation for 
> cursory details (doc/README.database). and the URL to the most recent 
> database plugin documentation. 
> 
> なんぞと長いエラーが出てます。
> 
> まあたいていの人はsnort単体で使ってるから関係ないと思うけど
> acid使ってる人や、そうでなくともDBにログ取ってる人がいたら注意です。
> 
> 上の問題は調べてからまた解決法を書きましょう。

で、DBをconvertするのはめんどくなったので、さっくりとDBを作りなおしたんだけど、
それでもエラってsnortが起動しませぬ。

いろいろ調べると
http://marc.theaimsgroup.com/?l=snort-users&m=103730103611760&w=2
にあるようにsnortのバグと判明(たぶんpostgresqlだけ?)。

CVSからspo_database.cを持ってきてコンパイルするのはめんどいので、
そこに書いてあるwork aroundを試みるが、これもうまくゆかず。

けっきょく、/usr/share/doc/snort-1.9.0/contrib/create_postgresql の

CREATE TABLE sensor ( sid         SERIAL,
                      hostname    TEXT,
                      interface   TEXT,
                      filter      TEXT,
                      detail      INT2,
                      encoding    INT2,
                      last_cid    INT8 NOT NULL,
                      PRIMARY KEY (sid));

の、last_cid の NOT NULL をはずしてdb作るというセコイ方法で逃げました。
(良い子のみなさんはspo_database.cを替えたほうがいいでしょう)

-- 
Kikutani, Makoto