New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map cache filename with many ignore_hosts exceeds NAME_MAX #49

Open
miragu opened this Issue Apr 26, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@miragu

miragu commented Apr 26, 2016

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

@LarsMichelsen

This comment has been minimized.

Show comment
Hide comment
@LarsMichelsen

LarsMichelsen Apr 28, 2016

Contributor

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.

Contributor

LarsMichelsen commented Apr 28, 2016

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 LarsMichelsen added the bug label May 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment