diff options
author | Omar Polo <op@omarpolo.com> | 2024-08-23 10:22:31 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-08-23 10:22:31 +0000 |
commit | 2f57c36f2f31fd95c6048a0efcfdd1da79d6e30c (patch) | |
tree | 3d3f0e8cc9f693ef461fc229f04cbcd0b07bd5be /regress | |
parent | 2922e3f14f02dfd00440e5b528fb7c38dab81050 (diff) |
work around comically tiny HOST_NAME_MAX on glibc system
glibc is clearly violating POSIX since they set HOST_NAME_MAX to 64, and
they've known so for years. Unfortunately this means that, despite
using the right interfaces, we have to work around bugs in their libc.
ugh.
Luckily, gmid doesn't need to do DNS, it just needs a define large
enough to store a hostname, but not unlimited, to catch possible
misconfigurations. We don't risk to round-trip this into an interface
that expects smaller strings.
Reported and fix tested by Anna “CyberTailor”,
see <https://codeberg.org/op/gmid/issues/3>.
Diffstat (limited to 'regress')
-rwxr-xr-x | regress/regress | 1 | ||||
-rw-r--r-- | regress/tests.sh | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/regress/regress b/regress/regress index c3bbed8..1d14644 100755 --- a/regress/regress +++ b/regress/regress @@ -40,6 +40,7 @@ run_test test_gemexp # Run regression tests for the gmid binary. run_test test_static_files +run_test test_alias_long_hostname run_test test_directory_redirect run_test test_serve_big_files run_test test_dont_execute_scripts diff --git a/regress/tests.sh b/regress/tests.sh index 0e07d19..4d89c2d 100644 --- a/regress/tests.sh +++ b/regress/tests.sh @@ -90,6 +90,15 @@ test_static_files() { check_reply "20 text/gemini" "# hello world" || return 1 } +test_alias_long_hostname() { + setup_simple_test '' ' +alias "laYkH0yyd7xDFO152Ubtm9Efxg8Gvt7wssNd8pPTVIIXVYbYrZERl38LrVY30WbrMrZxLFfhnmsfe1X2FUNAGMVYAxPspjl4" +' + + fetch / + check_reply "20 text/gemini" "# hello world" || return 1 +} + test_directory_redirect() { setup_simple_test |