diff --git a/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp b/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp index c87ba98f40df04fc938e445bac69781b59002f28..e631d0ec1052b19e092c95a518c531bb11b99570 100755 --- a/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp +++ b/security_lite/permission_posix/capability/src/ActsCapabilityTest.cpp @@ -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) { diff --git a/security_lite/permission_posix/dac/src/ActsSystemDevDacTest.cpp b/security_lite/permission_posix/dac/src/ActsSystemDevDacTest.cpp index 12c4d0fbee4fdf49c9759bf0b9e6ac8c854e2eb6..1d652be08f407b14ee69b2900dba1b5568a5b15b 100755 --- a/security_lite/permission_posix/dac/src/ActsSystemDevDacTest.cpp +++ b/security_lite/permission_posix/dac/src/ActsSystemDevDacTest.cpp @@ -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; } @@ -2051,4 +2051,4 @@ HWTEST_F(DacTestSuite, DACTest0750, Function | MediumTest | Level2) EXPECT_EQ(WEXITSTATUS(status), 0) << "ErrInfo: The exitCode is wrong, please query logs, child_pid = " << pid; } } -#endif \ No newline at end of file +#endif