summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unittest/db-util_gtest.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/unittest/db-util_gtest.cc b/unittest/db-util_gtest.cc
index d8d3d80..a6ecf20 100644
--- a/unittest/db-util_gtest.cc
+++ b/unittest/db-util_gtest.cc
@@ -92,6 +92,20 @@ TEST_F(DbUtil, db_util_open_with_options_n2) {
rc = db_util_open_with_options(pszFilePath, NULL, flags, zVfs);
ASSERT_NE ( DB_UTIL_OK , rc );
}
+
+TEST_F(DbUtil, db_util_open_n4) {
+ int rc;
+
+ rc = db_util_open(pszFilePath, &db, nOption);
+ ASSERT_EQ ( DB_UTIL_OK , rc );
+
+ // In case of (geteuid() != 0) && access(pszFilePath, R_OK)
+ system("chmod 000 test.db");
+ setuid(1000);
+
+ rc = db_util_open(pszFilePath, &db, nOption);
+ ASSERT_EQ ( SQLITE_PERM , rc );
+}
//=======================================================================================