This patch makes nasl able to load saved KB files.
The code is a reimplementation of save_kb_load_kb() from
nessus-core/nessusd/save_kb.c.
Problems:
1. I think the code in save_kb.c is quite buggy:
- it does a dummy fgets() before it starts intepreting loaded data,
i.e. it discards the first line of the file,
- it is unable to load multivalue kb items outside Services/,
- it leaks memory when it encounters an unparseable line.
2. I had to set an artifical port_range "pref" to prevent a crash
in getpts().
--Pavel Kankovsky aka Peak [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."
The code is a reimplementation of save_kb_load_kb() from
nessus-core/nessusd/save_kb.c.
Problems:
1. I think the code in save_kb.c is quite buggy:
- it does a dummy fgets() before it starts intepreting loaded data,
i.e. it discards the first line of the file,
- it is unable to load multivalue kb items outside Services/,
- it leaks memory when it encounters an unparseable line.
2. I had to set an artifical port_range "pref" to prevent a crash
in getpts().
--Pavel Kankovsky aka Peak [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."