A fresh synthetic root with its links resolved. The kernel bounds the * EXPANDED path, and macOS /tmp is a link to /private/tmp: under the link a * near-1 KiB path can be neither created nor probed, which hides the very * cut-off file these tests look for. */
| 16081 | * near-1 KiB path can be neither created nor probed, which hides the very |
| 16082 | * cut-off file these tests look for. */ |
| 16083 | static bool hl_make_root(char *root, size_t root_sz) { |
| 16084 | char tmpl[256]; |
| 16085 | char real[4096]; |
| 16086 | snprintf(tmpl, sizeof(tmpl), "/tmp/cbm-hooklog-XXXXXX"); |
| 16087 | if (!cbm_mkdtemp(tmpl)) { |
| 16088 | return false; |
| 16089 | } |
| 16090 | if (!cbm_canonical_path(tmpl, real, sizeof(real))) { |
| 16091 | th_rmtree(tmpl); |
| 16092 | return false; |
| 16093 | } |
| 16094 | int n = snprintf(root, root_sz, "%s", real); |
| 16095 | return n > 0 && (size_t)n < root_sz; |
| 16096 | } |
| 16097 | |
| 16098 | /* "<root>/hhh…/hhh…" of exactly `len` bytes, every component short of |
| 16099 | * NAME_MAX. False when it cannot be built. */ |
no test coverage detected