[open-ils-commits] r19246 - branches/rel_2_0/Open-ILS/src/sql/Pg (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 21 10:51:47 EST 2011


Author: dbs
Date: 2011-01-21 10:51:45 -0500 (Fri, 21 Jan 2011)
New Revision: 19246

Modified:
   branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
Part 3 of a more secure default set up

With this commit, the hardcoded default barcode is replaced by an
MD5 hash of a random string of numbers, preventing the barcode from
being used as a known login name in the OPAC interface (which would
remove one of the factors required in a brute forcing of the account
credentials).

You probably don't want to change the barcode for the admin user,
but if you feel the need you can use the usual patron editor in
the staff client.

Thanks to Thomas Berezansky for suggesting this additional change.


Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2011-01-21 15:50:55 UTC (rev 19245)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2011-01-21 15:51:45 UTC (rev 19246)
@@ -2155,8 +2155,8 @@
 INSERT INTO actor.usr ( profile, card, usrname, passwd, first_given_name, family_name, dob, master_account, super_user, ident_type, ident_value, home_ou ) VALUES ( 1, 1, md5(random()::text), md5(random()::text), 'Administrator', 'System Account', '1979-01-22', TRUE, TRUE, 1, 'identification', 1 );
 
 -- Admin user barcode
-INSERT INTO actor.card (usr, barcode) VALUES (1,'101010101010101');
-UPDATE actor.usr SET card = (SELECT id FROM actor.card WHERE barcode = '101010101010101') WHERE id = 1;
+INSERT INTO actor.card (usr, barcode) VALUES (1,md5(random()::text));
+UPDATE actor.usr SET card = (SELECT currval('actor.card_id_seq')) WHERE id = 1;
 
 -- Admin user permissions
 INSERT INTO permission.usr_perm_map (usr,perm,depth) VALUES (1,-1,0);



More information about the open-ils-commits mailing list