提交 da43f784 编写于 作者: O openharmony_ci 提交者: Gitee

!155 fix capabilities in write and execute case

Merge pull request !155 from 胡吉翔/security_lite_20210420
......@@ -44,6 +44,7 @@ static int TestDacOverrideSuccess()
LOG("ErrInfo: Failed to chdir 'TOP_DIR/CAPDIR0/CAPDIR0_CAPDIR1' with CAP_DAC_OVERRIDE");
return FALSE;
}
chdir(TOP_DIR "/" CAPDIR0);
// Delete the directory 'mkdir' in the directory 'TOP_DIR/CAPDIR0'
ret = rmdir(TOP_DIR "/" CAPDIR0 "/" CAPDIR0_CAPDIR1);
if (ret != 0) {
......
......@@ -25,7 +25,7 @@
using namespace std;
using namespace testing::ext;
#if defined(LITE_FS_JFFS2) || defined(LITE_FS_VFAT)
#if defined(LITE_FS_JFFS2)
static void CreateDevDir()
{
int ret;
......@@ -616,7 +616,7 @@ HWTEST_F(DacTestSuite, DACTest0420, Function | MediumTest | Level2)
SetUidGid(UID0, GID555);
// Step 3: Invoke the interface to operate the file system
ret = chdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0);
if (ret != FALSE) {
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
}
......@@ -1381,7 +1381,7 @@ HWTEST_F(DacTestSuite, DACTest0600, Function | MediumTest | Level2)
SetUidGid(UID555, GID555);
// Step 3: Invoke the interface to operate the file system
ret = mkdir("/storage/" DACDIR0 "/" DACDIR0_DACDIR0 "/" DACDIR0_DACDIR0_DACDIR0, NORWX);
if (ret != FALSE) {
if (ret != 0) {
LOG("ErrInfo: VFS error with DAC or Capability");
exitCode = 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册