From 45fb1d952c3b262278a3b22e9c7d60cca19a5407 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 3 Jan 2024 17:17:35 -0500 Subject: Work around DragonFly BSD kernel bug DragonFly's x86_64 assembly implementation of copyinstr() checks the wrong pointer when deciding whether to return EFAULT or ENAMETOOLONG, causing it to always return EFAULT for overlong paths. Work around it by treating EFAULT the same as ENAMETOOLONG on DragonFly. Link: https://twitter.com/tavianator/status/1742991411203485713 --- tests/xtouch.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/xtouch.c b/tests/xtouch.c index 260a3a3..ed8bbee 100644 --- a/tests/xtouch.c +++ b/tests/xtouch.c @@ -70,13 +70,19 @@ static int open_parent(const struct args *args, const char **path) { switch (errno) { case ENAMETOOLONG: +#if __DragonFly__ + // https://twitter.com/tavianator/status/1742991411203485713 + case EFAULT: +#endif break; + case ENOENT: if (args->flags & CREATE_PARENTS) { break; } else { goto err; } + default: goto err; } -- cgit v1.2.3