Skip to content

Commit

Permalink
Allow for longer entries in the system.information column
Browse files Browse the repository at this point in the history
Switch from VARCHAR(128) to TEXT to allow for longer entries in the
information column.  On server registration, this column is typically
loaded with the output of ```uname -a```.  That's frequently longer than
128 characters.  For instance on the FreeBSD servers I manage, it's
typically in excess of 180 characters:

```
ox-dell39:~:% uname -a | wc
       1      15     185
```

Since the length of the data being written to that column is not
checked, this results in a failed SQL query at which the ossec-dbd
process quits.

Tested with postgresql; equivalent change applied to mysql.schema
but not tested.
  • Loading branch information
Matthew Seaman committed Apr 14, 2016
1 parent 07c7cb0 commit 8d953b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/os_dbd/mysql.schema
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS server
last_contact INT UNSIGNED NOT NULL,
version VARCHAR(32) NOT NULL,
hostname VARCHAR(64) NOT NULL UNIQUE,
information VARCHAR(128) NOT NULL,
information TEXT NOT NULL,
PRIMARY KEY (id)
);

Expand Down
2 changes: 1 addition & 1 deletion src/os_dbd/postgresql.schema
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CREATE TABLE server
last_contact INT8 NOT NULL,
version VARCHAR(32) NOT NULL,
hostname VARCHAR(64) NOT NULL UNIQUE,
information VARCHAR(128) NOT NULL,
information TEXT NOT NULL,
PRIMARY KEY (id)
);

Expand Down

0 comments on commit 8d953b2

Please sign in to comment.