syscalls/fgetxattr02.c: Fix errno EPERM on older kernels
PATCH 1/1 syscalls/fgetxattr02.c: Fix errno EPERM on older kernels
According to commit 3d2ae5e in LTP, fgetxattr()/getxattr() will set errno to 'EPERM' when fd/file is not a regular file and directory before kernel 3.0.0. This errno is changed to ENODATA by commit 55b23bd in kernel, so we accept EPERM in older kernels.
Signed-off-by Xiao Yang <[email protected]>
--- testcases/kernel/syscalls/fgetxattr/fgetxattr02.c | 8 ++++++++ 1 file changed, 8 insertions(+)
testcases/kernel/syscalls/fgetxattr/fgetxattr02.c +8 -0
@@ -185,6 +185,14 @@ static void verify_fgetxattr(unsigned int i) tc[i].fname + OFFSET); } +/* +* Before kernel 3.0.0, fgetxattr(2) will set errno with 'EPERM' +* when the file is not a regular file and directory, refer to +* commitid 55b23bd +*/ +if (tc[i].exp_err ==ENODATA &&tst_kvercmp (3 ,0 ,0 ) <0 ) + tc[i].exp_err =EPERM ; +if (tc[i].exp_err ==TST_ERR ) {tst_res (TPASS |TTERRNO ,"fgetxattr(2) on %s passed" , tc[i].fname +OFFSET );
Signature · 1 line
1.8.3.1
PATCH 1/1 syscalls/fgetxattr02.c: Fix errno EPERM on older kernels
Hi!
Applied, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]