public class RestrictiveFilePermissionsTest extends BaseJDBCTestCase
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
backupDir |
(package private) static java.lang.String |
dbName |
(package private) static java.lang.String |
dbName2 |
(package private) static java.lang.String |
derbyDotLog |
(package private) static java.lang.String |
exportFileName |
(package private) static java.lang.String |
exportFileName2 |
(package private) static java.lang.String |
exportLobFileName |
(package private) static java.lang.String |
home |
static int |
NEGATIVE |
static int |
POSITIVE |
(package private) static boolean |
supportsLaxTesting |
static int |
UNKNOWN |
private static java.util.Set<java.nio.file.attribute.PosixFilePermission> |
UNWANTED_PERMISSIONS |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
RestrictiveFilePermissionsTest(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
checkAccessToOwner(java.io.File file,
boolean doContents,
int expectedOutcome)
Same as
checkAccessToOwner, but
if doContents is true, also check files directly contained in
this file qua directory (not recursively). |
static void |
checkAccessToOwner(java.io.File file,
int expectedOutcome)
Check that the file has access only for the owner.
|
void |
doTestCliServerIsRestrictive() |
void |
dotestEmbeddedIsLax() |
void |
doTestNonCliServerIsLax() |
void |
setUp() |
static junit.framework.Test |
suite() |
void |
testBackupRestoreFiles() |
void |
testConglomsAfterCompress() |
void |
testDbDirectory() |
void |
testDerbyDotLog() |
void |
testExportedFiles() |
void |
testJarFiles() |
void |
testLockFiles() |
void |
testLogDirAndLogFiles() |
void |
testSeg0AndConglomerates() |
void |
testServiceProperties() |
void |
testTmpDirectory() |
void |
testTruncateTable() |
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeastassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringstatic final java.lang.String dbName
static final java.lang.String dbName2
static final java.lang.String exportFileName
static final java.lang.String exportFileName2
static final java.lang.String exportLobFileName
static final java.lang.String backupDir
static final java.lang.String derbyDotLog
static java.lang.String home
static boolean supportsLaxTesting
public static final int NEGATIVE
public static final int POSITIVE
public static final int UNKNOWN
private static final java.util.Set<java.nio.file.attribute.PosixFilePermission> UNWANTED_PERMISSIONS
public RestrictiveFilePermissionsTest(java.lang.String name)
public static junit.framework.Test suite()
throws java.lang.Exception
java.lang.Exceptionpublic void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exceptionpublic void testDerbyDotLog()
throws java.lang.Exception
java.lang.Exceptionpublic void testDbDirectory()
throws java.lang.Exception
java.lang.Exceptionpublic void testServiceProperties()
throws java.lang.Exception
java.lang.Exceptionpublic void testTmpDirectory()
throws java.lang.Exception
java.lang.Exceptionpublic void testLockFiles()
throws java.lang.Exception
java.lang.Exceptionpublic void testSeg0AndConglomerates()
throws java.lang.Exception
java.lang.Exceptionpublic void testLogDirAndLogFiles()
throws java.lang.Exception
java.lang.Exceptionpublic void testExportedFiles()
throws java.lang.Exception
java.lang.Exceptionpublic void testConglomsAfterCompress()
throws java.lang.Exception
java.lang.Exceptionpublic void testTruncateTable()
throws java.lang.Exception
java.lang.Exceptionpublic void testBackupRestoreFiles()
throws java.lang.Exception
java.lang.Exceptionpublic void testJarFiles()
throws java.lang.Exception
java.lang.Exceptionpublic void doTestCliServerIsRestrictive()
throws java.lang.Exception
java.lang.Exceptionpublic void doTestNonCliServerIsLax()
throws java.lang.Exception
java.lang.Exceptionpublic void dotestEmbeddedIsLax()
throws java.lang.Exception
java.lang.Exceptionpublic static void checkAccessToOwner(java.io.File file,
int expectedOutcome)
throws java.lang.Exception
file - (or directory) for which we want to check permissionsexpectedOutcome - NEGATIVE or POSITIVEjava.lang.ExceptioncheckAccessToOwner(File, boolean, int)private static boolean checkAccessToOwner(java.io.File file,
boolean doContents,
int expectedOutcome)
throws java.lang.Exception
checkAccessToOwner, but
if doContents is true, also check files directly contained in
this file qua directory (not recursively).file - ((or directory) for which we want to check permissionsdoContents - if a directory, an error to call with true if notexpectedOutcome - NEGATIVE, POSITIVE or UNKNOWNjava.lang.ExceptionApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.