diff options
author | anton <> | 2022-05-24 05:14:30 +0000 |
---|---|---|
committer | anton <> | 2022-05-24 05:14:30 +0000 |
commit | 3cca13651bceeb2e612d1322615a6baac2e1a8bf (patch) | |
tree | a67994b20d825d356ae047240dc9f277b3f57569 /src/regress/lib/libc/sys | |
parent | b5a93ad35d68150ca701f8aa7702c2117d870aaa (diff) | |
download | openbsd-3cca13651bceeb2e612d1322615a6baac2e1a8bf.tar.gz openbsd-3cca13651bceeb2e612d1322615a6baac2e1a8bf.tar.bz2 openbsd-3cca13651bceeb2e612d1322615a6baac2e1a8bf.zip |
Recent changes to truncate(2) swapped the ordering of some validations
causing EACCESS as opposed of ESDIR to be returned while trying to
truncate a directory as a user lacking write permissions to the same
directory. As this behavior is reasonable, change the truncate directory
from /etc/ to /tmp which makes the test pass both as root and non-root.
Diffstat (limited to 'src/regress/lib/libc/sys')
-rw-r--r-- | src/regress/lib/libc/sys/t_truncate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libc/sys/t_truncate.c b/src/regress/lib/libc/sys/t_truncate.c index f952efc35e..f42494f8db 100644 --- a/src/regress/lib/libc/sys/t_truncate.c +++ b/src/regress/lib/libc/sys/t_truncate.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t_truncate.c,v 1.3 2021/12/13 16:56:48 deraadt Exp $ */ | 1 | /* $OpenBSD: t_truncate.c,v 1.4 2022/05/24 05:14:30 anton Exp $ */ |
2 | /* $NetBSD: t_truncate.c,v 1.3 2017/01/13 20:03:51 christos Exp $ */ | 2 | /* $NetBSD: t_truncate.c,v 1.3 2017/01/13 20:03:51 christos Exp $ */ |
3 | 3 | ||
4 | /*- | 4 | /*- |
@@ -157,7 +157,7 @@ ATF_TC_BODY(truncate_err, tc) | |||
157 | ATF_REQUIRE_ERRNO(EFAULT, truncate((void *)-1, 999) == -1); | 157 | ATF_REQUIRE_ERRNO(EFAULT, truncate((void *)-1, 999) == -1); |
158 | 158 | ||
159 | errno = 0; | 159 | errno = 0; |
160 | ATF_REQUIRE_ERRNO(EISDIR, truncate("/etc", 999) == -1); | 160 | ATF_REQUIRE_ERRNO(EISDIR, truncate("/tmp", 999) == -1); |
161 | 161 | ||
162 | errno = 0; | 162 | errno = 0; |
163 | ATF_REQUIRE_ERRNO(ENOENT, truncate("/a/b/c/d/e/f/g", 999) == -1); | 163 | ATF_REQUIRE_ERRNO(ENOENT, truncate("/a/b/c/d/e/f/g", 999) == -1); |