nagvis icon indicating copy to clipboard operation
nagvis copied to clipboard

Map cache filename with many ignore_hosts exceeds NAME_MAX

Open miragu opened this issue 8 years ago • 1 comments

Hello, When using automaps with a certain amount of FQDN hostnames in ignore_hosts I noticed that the cache creation would fail (can't remember the specific error but something regarding fopen, filename too long). In effect, it easily exceeds NAME_MAX (255 under POSIX; not to be confused with PATH_MAX which is usually 4096). My fix was to simply remove ignore_hosts from the cache filename. Not sure if it causes other problems. I noticed you already remove source_file and have a FIXME to configure these exceptions. Anyhow, here's a trivial patch that fixed my problem. nagvis-cache-filename-fix.txt

miragu avatar Apr 26 '16 16:04 miragu

Yes. This naming scheme is a bad idea. It should be rewritten to use some hashing algorithm for generating a unique id based on the parameters. The parameters should be kept somewhere to make debugging easier. e.g. in a separate file next to the cache file.

LarsMichelsen avatar Apr 28 '16 18:04 LarsMichelsen