问题描述
全部.我在尝试Android CTS(4.4 R3)时遇到问题.
Daer all.I'm facing problem during trying Android CTS(4.4 R3).
整个错误日志如下:
01-22 17:19:44.844 D/ (22802): isPermittedCapBitSet(): getxattr("/system/bin/run-as") call failed: return -1 (error: No data available (61))
01-22 17:19:44.844 I/TestRunner(22802): failed: testRunAsHasCorrectCapabilities(android.permission.cts.FileSystemPermissionTest)
01-22 17:19:44.844 I/TestRunner(22802): ----- begin exception -----
01-22 17:19:44.844 I/TestRunner(22802):
01-22 17:19:44.844 I/TestRunner(22802): junit.framework.AssertionFailedError
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.Assert.fail(Assert.java:48)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.Assert.assertTrue(Assert.java:20)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.Assert.assertTrue(Assert.java:27)
01-22 17:19:44.844 I/TestRunner(22802): at android.permission.cts.FileSystemPermissionTest.testRunAsHasCorrectCapabilities(FileSystemPermissionTest.java:828)
01-22 17:19:44.844 I/TestRunner(22802): at java.lang.reflect.Method.invokeNative(Native Method)
01-22 17:19:44.844 I/TestRunner(22802): at java.lang.reflect.Method.invoke(Method.java:515)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.TestCase.runTest(TestCase.java:168)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.TestCase.runBare(TestCase.java:134)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.TestResult$1.protect(TestResult.java:115)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.TestResult.runProtected(TestResult.java:133)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.TestResult.run(TestResult.java:118)
01-22 17:19:44.844 I/TestRunner(22802): at junit.framework.TestCase.run(TestCase.java:124)
01-22 17:19:44.844 I/TestRunner(22802): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
01-22 17:19:44.844 I/TestRunner(22802): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
01-22 17:19:44.844 I/TestRunner(22802): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
01-22 17:19:44.844 I/TestRunner(22802): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
01-22 17:19:44.844 I/TestRunner(22802): ----- end exceptbinder: release 22792:22801 transaction 150222 in, still active
我跟踪了导致这些错误的函数
I traced what function cause these errors
/cts/tests/tests/permission/jni/android_permission_cts_FileUtils.cpp
/cts/tests/tests/permission/jni/android_permission_cts_FileUtils.cpp
95 static jboolean isPermittedCapBitSet(JNIEnv* env, jstring path, size_t capId)
96 {
97 const char* pathStr = env->GetStringUTFChars(path, NULL);
98 jboolean ret = false;
99
100 struct vfs_cap_data capData;
101 memset(&capData, 0, sizeof(capData));
102
103 ssize_t result = getxattr(pathStr, XATTR_NAME_CAPS, &capData,
104 sizeof(capData));
105 if (result > 0) {
106 ret = (capData.data[CAP_TO_INDEX(capId)].permitted &
107 CAP_TO_MASK(capId)) != 0;
108 ALOGD("isPermittedCapBitSet(): getxattr(\"%s\") call succeeded, "
109 "cap bit %u %s",
110 pathStr, capId, ret ? "set" : "unset");
111 } else {
112 ALOGD("isPermittedCapBitSet(): getxattr(\"%s\") call failed: "
113 "return %d (error: %s (%d))\n",
114 pathStr, result, strerror(errno), errno);
115 }
116
117 env->ReleaseStringUTFChars(path, pathStr);
118 return ret;
119 }
120
getxattr()导致的错误.
The error made by getxattr().
我不知道该怎么办.我已经检查了/system/bin/run-as.它存在并且具有连接权限和所有权
I don't know what should I do.I already checked /system/bin/run-as. It exists and has connect permission and ownership
root@123:/ # ls -al /system/bin/run-as
-rwxr-x--- root shell 9500 2015-01-21 14:54 run-as
请让我教我应该检查什么?谢谢
Please let me teach what should I check ? Thanks
推荐答案
我认为您可能需要在启用扩展的ATTRibutes(xattr)的情况下重新编译内核.对于ext3文件系统,.config
中的配置值为:
I think you may need to recompile your kernel with eXtended ATTRibutes (xattr) enabled. For the ext3 filesystem, the config value in .config
is:
CONFIG_EXT3_FS_XATTR
但是,在您的linux源代码树中,键入
But, in your linux source tree, type
make menuconfig
并使用该界面为您正在使用的文件系统启用扩展属性.然后在那之后重新编译您的内核.
and use that interface to enable extended attributes for the file system(s) you are using. Then recompile your kernel after that.
这篇关于“无可用数据(61)"是什么意思?在getxattr系统调用期间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!