Updates database layout to allow SHA1 password during registration.
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Mon, 5 May 2008 16:50:49 +0000 (18:50 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Mon, 5 May 2008 16:52:20 +0000 (18:52 +0200)
Disables empty passwords in database (consequence of bug fixed in 4f132669b52532c15eebbdee0a17659b5d6ab178).

Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
upgrade/0.9.17/00_password.sql [new file with mode: 0644]
upgrade/0.9.17/update.sh [new file with mode: 0755]

diff --git a/upgrade/0.9.17/00_password.sql b/upgrade/0.9.17/00_password.sql
new file mode 100644 (file)
index 0000000..5057806
--- /dev/null
@@ -0,0 +1,8 @@
+-- Switches to SHA1 password storage for register_pending.
+ALTER TABLE register_pending CHANGE COLUMN password password VARCHAR(40) NOT NULL;
+
+-- Disables MD5(""), SHA1("") and LEFT(SHA1(""), 32) as password.
+UPDATE register_pending SET password = "" WHERE password IN ("d41d8cd98f00b204e9800998ecf8427e", "da39a3ee5e6b4b0d3255bfef95601890afd80709", "da39a3ee5e6b4b0d3255bfef95601890");
+UPDATE auth_user_md5 SET password = "" WHERE password IN ("d41d8cd98f00b204e9800998ecf8427e", "da39a3ee5e6b4b0d3255bfef95601890afd80709", "da39a3ee5e6b4b0d3255bfef95601890");
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/0.9.17/update.sh b/upgrade/0.9.17/update.sh
new file mode 100755 (executable)
index 0000000..f351939
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+mailman_stop
+mailman_templates
+mailman_start
+
+
+###########################################################
+for sql in *.sql
+do
+    echo -n $sql
+    $MYSQL x4dat < $sql &>/dev/null || echo -n " ERROR"
+    echo .
+done
+
+###########################################################
+