In /testcases/kernel/syscalls/utimes, case02 expects
"EACCES" error.
According to utimes's manual,
EACCES times is NULL, the caller’s effective user ID does not match the
owner of the file, the caller does not have write access to the
file, and the caller is not privileged (Linux: does not have
either the CAP_DAC_OVERRIDE or the CAP_FOWNER capability).
However, now case02's times is not NULL so that it can only get "EPERM".
So, change case02's times to NULL to reach its expect.
This patch fixes the problem.
Signed-off-by: Liu Bo <[email protected]>
---
testcases/kernel/syscalls/utimes/utimes01.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/syscalls/utimes/utimes01.c
b/testcases/kernel/syscalls/utimes/utimes01.c
index 390b572..ae2fa2d 100644
--- a/testcases/kernel/syscalls/utimes/utimes01.c
+++ b/testcases/kernel/syscalls/utimes/utimes01.c
@@ -191,8 +191,6 @@ static struct test_case tcase[] = {
},
{ // case02
.ttype = NORMAL,
- .a_sec = 1000,
- .m_sec = 2000,
.user = "nobody",
.ret = -1,
.err = EACCES, // RHEL4U1 + 2.6.18 returns EPERM
@@ -270,9 +268,13 @@ static int do_test(struct test_case *tc)
const char *dummy = NULL;
TEST(sys_ret = utimes(dummy, tv));
}
- else
- TEST(sys_ret = utimes(fpath, tv));
- sys_errno = errno;
+ else {
+ if (tc->user == NULL)
+ TEST(sys_ret = utimes(fpath, tv));
+ else
+ TEST(sys_ret = utimes(fpath, (struct timeval *)NULL));
+ }
+ sys_errno = errno;
if (tc->ttype == FILE_NOT_EXIST)
fpath[len - 1] = c;
if (sys_ret < 0)
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list