提交 08a00d6b authored 作者: Thomas Mueller's avatar Thomas Mueller

the ChangePassword tool is now called ChangeFileEncryption

上级 0c1a0c12
......@@ -17,7 +17,13 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Databases larger than 1 GB was sometimes very slow if a lot of data was deleted previously. Fixed.
<li>The ChangePassword tool is now called ChangeFileEncryption.
</li><li>It is no longer allowed to create columns with the data type NULL.
Also, it is no longer allowed to convert a column to the data type NULL.
This was possible before but caused data loss.
</li><li>When using computed columns or default values with a different data type than the column data type,
a class cast exception could occur. Fixed.
</li><li>Databases larger than 1 GB was sometimes very slow if a lot of data was deleted previously. Fixed.
</li><li>RUNSCRIPT could throw a NullPointerException if the script name was an expression.
</li><li>Improved compatibility. New compatibility modes for Oracle and Derby.
New compatibility flag uniqueIndexNullDistinct to only allow one row with 'NULL' in a unique
......
......@@ -526,7 +526,7 @@ java -cp h2.jar org.h2.tools.Backup -?
The command line tools are:
</p>
<ul><li><b>Backup</b> creates a backup of a database.
</li><li><b>ChangePassword</b> allows changing the file password of a database.
</li><li><b>ChangeFileEncryption</b> allows changing the file encryption password or algorithm of a database.
</li><li><b>Console</b> starts the browser based H2 Console.
</li><li><b>ConvertTraceFile</b> converts a .trace.db file to a Java application and SQL script.
</li><li><b>CreateCluster</b> creates a cluster from a standalone database.
......
......@@ -49,7 +49,7 @@ org.h2.jdbcx<br />
<b>Tools</b><br />
org.h2.tools<br />
<a href="org/h2/tools/Backup.html" target="javadoc">Backup</a><br />
<a href="org/h2/tools/ChangePassword.html" target="javadoc">ChangePassword</a><br />
<a href="org/h2/tools/ChangeFileEncryption.html" target="javadoc">ChangeFileEncryption</a><br />
<a href="org/h2/tools/CompressTool.html" target="javadoc">CompressTool</a><br />
<a href="org/h2/tools/Console.html" target="javadoc">Console</a><br />
<a href="org/h2/tools/ConvertTraceFile.html" target="javadoc">ConvertTraceFile</a><br />
......
......@@ -129,6 +129,7 @@
90105=Exception calling user-defined function
90106=Cannot truncate {0}
90107=Cannot drop {0} because {1} depends on it
90108=Out of memory. Size\: {0}
90109=View {0} is invalid\: {1}
90110={0} out of range
90111=Error accessing linked table with SQL statement {0}, cause\: {1}
......
......@@ -96,8 +96,8 @@ toolbar.run=Run (Ctrl+Enter)
toolbar.sqlStatement=SQL statement
tools.backup=Backup
tools.backup.help=Creates a backup of a database.
tools.changePassword=ChangePassword
tools.changePassword.help=Allows changing the database file password.
tools.changeFileEncryption=\#ChangeFileEncryption
tools.changeFileEncryption.help=\#Allows changing the database file encryption password and algorithm.
tools.cipher=Cipher (AES or XTEA)
tools.commandLine=Command line
tools.convertTraceFile=ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Ausf&uuml;hren (Strg+Enter)
toolbar.sqlStatement=SQL Befehl
tools.backup=Backup
tools.backup.help=Erzeugt eine Sichheitskopie eine Datenbank.
tools.changePassword=ChangePassword
tools.changePassword.help=Erlaubt das Passwort einer Datenbank zu &auml;ndern.
tools.changeFileEncryption=\#\#ChangeFileEncryption \#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm. \#Erlaubt, Datei Verschl&uuml;sselungs-Passwort und -Algorithmus einer Datenbank zu &auml;ndern.
tools.cipher=Verschl&uuml;sselung (AES oder XTEA)
tools.commandLine=Kommandozeile
tools.convertTraceFile=ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Run (Ctrl+Enter)
toolbar.sqlStatement=SQL statement
tools.backup=Backup
tools.backup.help=Creates a backup of a database.
tools.changePassword=ChangePassword
tools.changePassword.help=Allows changing the database file password.
tools.changeFileEncryption=\#ChangeFileEncryption
tools.changeFileEncryption.help=\#Allows changing the database file encryption password and algorithm.
tools.cipher=Cipher (AES or XTEA)
tools.commandLine=Command line
tools.convertTraceFile=ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Ejecutar (Ctrl+Enter)
toolbar.sqlStatement=Instrucci&oacute;n SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Ex&eacute;cuter (Ctrl+Enter)
toolbar.sqlStatement=Instruction SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=V&eacute;grehajt&aacute;s (Ctrl+Enter)
toolbar.sqlStatement=SQL utas&iacute;t&aacute;s
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Jalankan (Ctrl+Enter)
toolbar.sqlStatement=Pernyataan SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Esegui (Ctrl+Invio)
toolbar.sqlStatement=Comando SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=\u5B9F\u884C (Ctrl+Enter)
toolbar.sqlStatement=SQL\u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8
tools.backup=\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7
tools.backup.help=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u30D0\u30C3\u30AF\u30A2\u30C3\u30D7\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002
tools.changePassword=\u30D1\u30B9\u30EF\u30FC\u30C9\u306E\u5909\u66F4
tools.changePassword.help=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3057\u307E\u3059\u3002
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\u6697\u53F7\u5316\u65B9\u5F0F (AES or XTEA)
tools.commandLine=\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3
tools.convertTraceFile=\u30C8\u30EC\u30FC\u30B9\u30D5\u30A1\u30A4\u30EB\u306E\u5909\u63DB
......
......@@ -96,8 +96,8 @@ toolbar.run=Uitvoeren (Ctrl+Enter)
toolbar.sqlStatement=SQL statement
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Wykonaj (Ctrl+Enter)
toolbar.sqlStatement=Zapytanie SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Executar comando (Ctrl+Enter)
toolbar.sqlStatement=Comando SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=Executar comando (Ctrl+Enter)
toolbar.sqlStatement=Comando SQL
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=&\#1042;&\#1099;&\#1087;&\#1086;&\#1083;&\#1085;&\#1080;&\#1090;&\#1
toolbar.sqlStatement=SQL-&\#1079;&\#1072;&\#1087;&\#1088;&\#1086;&\#1089;
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=&\#304;&\#351;lemi y&\#252;r&\#252;t
toolbar.sqlStatement=SQL komutu
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=&\#x0412;&\#x0438;&\#x043A;&\#x043E;&\#x043D;&\#x0430;&\#x0442;&\#x0
toolbar.sqlStatement=SQL &\#x0437;&\#x0430;&\#x043F;&\#x0438;&\#x0442;
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=\u6267\u884C (Ctrl+Enter)
toolbar.sqlStatement=SQL \u8BED\u53E5
tools.backup=\#Backup
tools.backup.help=\#Creates a backup of a database.
tools.changePassword=\#ChangePassword
tools.changePassword.help=\#Allows changing the database file password.
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\#Cipher (AES or XTEA)
tools.commandLine=\#Command line
tools.convertTraceFile=\#ConvertTraceFile
......
......@@ -96,8 +96,8 @@ toolbar.run=\u57F7\u884C (Ctrl+Enter)
toolbar.sqlStatement=SQL \u8FF0\u53E5
tools.backup=\u5099\u4EFD
tools.backup.help=\u5EFA\u7ACB\u8CC7\u6599\u5EAB\u7684\u5099\u4EFD
tools.changePassword=\u8B8A\u66F4\u5BC6\u78BC
tools.changePassword.help=\u5141\u8A31\u8B8A\u66F4\u8CC7\u6599\u5EAB\u6A94\u6848\u7684\u5BC6\u78BC
tools.changeFileEncryption=\#\#ChangeFileEncryption
tools.changeFileEncryption.help=\#\#Allows changing the database file encryption password and algorithm.
tools.cipher=\u52A0\u5BC6 (AES \u6216 XTEA)
tools.commandLine=\u547D\u4EE4\u5217
tools.convertTraceFile=\u8F49\u63DBTrace\u6A94\u6848
......
......@@ -80,7 +80,7 @@ function update() {
<a href="javascript:go('Restore')">${text.tools.restore}</a>&nbsp;&nbsp;
<a href="javascript:go('Recover')">${text.tools.recover}</a>&nbsp;&nbsp;
<a href="javascript:go('DeleteDbFiles')">${text.tools.deleteDbFiles}</a>&nbsp;&nbsp;
<a href="javascript:go('ChangePassword')">${text.tools.changePassword}</a>
<a href="javascript:go('ChangeFileEncryption')">${text.tools.changeFileEncryption}</a>
</p><p>
<a href="javascript:go('Script')">${text.tools.script}</a>&nbsp;&nbsp;
<a href="javascript:go('RunScript')">${text.tools.runScript}</a>&nbsp;&nbsp;
......@@ -136,20 +136,20 @@ function update() {
</td></tr>
</table>
</div>
<div id="toolChangePassword" style="display: none">
<h2>${text.tools.changePassword}</h2>
<p>${text.tools.changePassword.help}</p>
<div id="toolChangeFileEncryption" style="display: none">
<h2>${text.tools.changeFileEncryption}</h2>
<p>${text.tools.changeFileEncryption.help}</p>
<table class="tool">
<tr><td>
${text.tools.cipher}:&nbsp;</td><td><input id="optionChangePassword.0" name="cipher" onkeyup="update()" onchange="update()" value="XTEA" />
${text.tools.cipher}:&nbsp;</td><td><input id="optionChangeFileEncryption.0" name="cipher" onkeyup="update()" onchange="update()" value="XTEA" />
</td></tr><tr><td>
${text.tools.directory}:&nbsp;</td><td><input id="optionChangePassword.1" name="dir" onkeyup="update()" onchange="update()" value="~" size="50" />
${text.tools.directory}:&nbsp;</td><td><input id="optionChangeFileEncryption.1" name="dir" onkeyup="update()" onchange="update()" value="~" size="50" />
</td></tr><tr><td>
${text.tools.databaseName}:&nbsp;</td><td><input id="optionChangePassword.2" name="db" onkeyup="update()" onchange="update()" value="test" size="50" />
${text.tools.databaseName}:&nbsp;</td><td><input id="optionChangeFileEncryption.2" name="db" onkeyup="update()" onchange="update()" value="test" size="50" />
</td></tr><tr><td>
${text.tools.decryptionPassword}:&nbsp;</td><td><input type="password" id="optionChangePassword.3" name="decrypt" onkeyup="update()" onchange="update()" value="" />
${text.tools.decryptionPassword}:&nbsp;</td><td><input type="password" id="optionChangeFileEncryption.3" name="decrypt" onkeyup="update()" onchange="update()" value="" />
</td></tr><tr><td>
${text.tools.encryptionPassword}:&nbsp;</td><td><input type="password" id="optionChangePassword.4" name="encrypt" onkeyup="update()" onchange="update()" value="" />
${text.tools.encryptionPassword}:&nbsp;</td><td><input type="password" id="optionChangeFileEncryption.4" name="encrypt" onkeyup="update()" onchange="update()" value="" />
</td></tr>
</table>
</div>
......
......@@ -20,9 +20,10 @@ import org.h2.util.Tool;
/**
* A tools to change, remove or set a file password of a database without
* opening it. It can not be used to change a password of a user.
* opening it. The encryption algorithm can be changed as well. It can not be
* used to change a password of a user.
*/
public class ChangePassword extends Tool {
public class ChangeFileEncryption extends Tool {
private String dir;
private String cipher;
......@@ -30,7 +31,7 @@ public class ChangePassword extends Tool {
private byte[] encrypt;
private void showUsage() {
out.println("Allows changing the database file password.");
out.println("Allows changing the database file encryption password or algorithm.");
out.println("java "+getClass().getName() + "\n" +
" -cipher <type> AES or XTEA\n" +
" [-dir <dir>] The database directory (default: .)\n" +
......@@ -59,7 +60,7 @@ public class ChangePassword extends Tool {
* @throws SQLException
*/
public static void main(String[] args) throws SQLException {
new ChangePassword().run(args);
new ChangeFileEncryption().run(args);
}
public void run(String[] args) throws SQLException {
......@@ -127,11 +128,11 @@ public class ChangePassword extends Tool {
* @throws SQLException
*/
public static void execute(String dir, String db, String cipher, char[] decryptPassword, char[] encryptPassword, boolean quiet) throws SQLException {
new ChangePassword().process(dir, db, cipher, decryptPassword, encryptPassword, quiet);
new ChangeFileEncryption().process(dir, db, cipher, decryptPassword, encryptPassword, quiet);
}
private void process(String dir, String db, String cipher, char[] decryptPassword, char[] encryptPassword, boolean quiet) throws SQLException {
ChangePassword change = new ChangePassword();
ChangeFileEncryption change = new ChangeFileEncryption();
if (encryptPassword != null) {
for (int i = 0; i < encryptPassword.length; i++) {
if (encryptPassword[i] == ' ') {
......@@ -159,7 +160,7 @@ public class ChangePassword extends Tool {
FileUtils.rename(temp, fileName);
}
// if this worked, the operation will (hopefully) be successful
// TODO changePassword: this is a workaround!
// TODO changeFileEncryption: this is a workaround!
// make the operation atomic (all files or none)
for (int i = 0; i < files.size(); i++) {
String fileName = (String) files.get(i);
......
......@@ -39,10 +39,10 @@ public class TestSampleApps extends TestBase {
testApp(org.h2.samples.TriggerSample.class, null, "The sum is 20.00");
// tools
testApp(org.h2.tools.ChangePassword.class, new String[] { "-help" },
"Allows changing the database file password*");
testApp(org.h2.tools.ChangePassword.class, null,
"Allows changing the database file password*");
testApp(org.h2.tools.ChangeFileEncryption.class, new String[] { "-help" },
"Allows changing the database file encryption password or algorithm*");
testApp(org.h2.tools.ChangeFileEncryption.class, null,
"Allows changing the database file encryption password or algorithm*");
testApp(org.h2.tools.DeleteDbFiles.class, new String[] { "-help" },
"Deletes all files belonging to a database.*");
}
......
......@@ -25,7 +25,7 @@ import org.h2.store.FileLister;
import org.h2.test.TestBase;
import org.h2.test.trace.Player;
import org.h2.tools.Backup;
import org.h2.tools.ChangePassword;
import org.h2.tools.ChangeFileEncryption;
import org.h2.tools.ConvertTraceFile;
import org.h2.tools.DeleteDbFiles;
import org.h2.tools.Recover;
......@@ -53,7 +53,7 @@ public class TestTools extends TestBase {
testRemove();
testConvertTraceFile();
testManagementDb();
testChangePassword();
testChangeFileEncryption();
testServer();
testScriptRunscript();
testBackupRestore();
......@@ -382,7 +382,7 @@ public class TestTools extends TestBase {
DeleteDbFiles.main(new String[] { "-dir", baseDir, "-db", "utils", "-quiet" });
}
private void testChangePassword() throws Exception {
private void testChangeFileEncryption() throws Exception {
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:" + baseDir + "/utils;CIPHER=XTEA;STORAGE=TEXT", "sa",
"abc 123");
......@@ -390,9 +390,9 @@ public class TestTools extends TestBase {
stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))");
conn.close();
String[] args = new String[] { "-dir", baseDir, "-db", "utils", "-cipher", "XTEA", "-decrypt", "abc", "-quiet" };
ChangePassword.main(args);
ChangeFileEncryption.main(args);
args = new String[] { "-dir", baseDir, "-db", "utils", "-cipher", "AES", "-encrypt", "def", "-quiet" };
ChangePassword.main(args);
ChangeFileEncryption.main(args);
conn = DriverManager.getConnection("jdbc:h2:" + baseDir + "/utils;CIPHER=AES", "sa", "def 123");
stat = conn.createStatement();
stat.execute("SELECT * FROM TEST");
......
......@@ -523,4 +523,4 @@ monitor benefit performing conditional significant arithmetic instrumented
doclets extremes instructions printable skips sava sources cms bytecode cfml
cold compiles markup spellchecker interleaved poormans programmed swt railo
clobs resizes precisions scales stopwatch shortly puts captured decremented
him uninterpreted entering composed patched
\ No newline at end of file
him uninterpreted entering composed patched rowlock
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论