Merge branch 'master' into debian
authorSam Hartman <hartmans@debian.org>
Wed, 25 Mar 2015 18:25:48 +0000 (14:25 -0400)
committerSam Hartman <hartmans@debian.org>
Wed, 25 Mar 2015 18:25:48 +0000 (14:25 -0400)
Version 1.5.1

configure.ac
schema.sql
trust_router.spec

index f7c9011..baeeb9c 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ(2.63)
-AC_INIT([trust_router],[1.5],
+AC_INIT([trust_router],[1.5.1],
 [bugs@project-moonshot.org])
 AC_CONFIG_MACRO_DIR(m4)
 AC_CONFIG_AUX_DIR(build-aux)
index 1e0a5f9..752fe2c 100644 (file)
@@ -1,7 +1,8 @@
-create table if not exists psk_keys (keyid text primary key, key blob, client_dh_pub raw(20), key_expiration timestamp);
+create table if not exists psk_keys_tab(keyid text primary key, key blob, client_dh_pub raw(20), key_expiration timestamp);
 create table if not exists authorizations( client_dh_pub raw(20), coi string, acceptor_realm string, hostname string, apc string);
 create index if not exists authorizations_dhpub on authorizations( client_dh_pub);
-CREATE VIEW if not exists authorizations_keys as select keyid, authorizations.* from psk_keys join authorizations on psk_keys.client_dh_pub = authorizations.client_dh_pub and datetime(key_expiration) > datetime('now');
+create view if not exists psk_keys as select * from psk_keys_tab where  datetime(key_expiration) > datetime('now');
+CREATE VIEW if not exists authorizations_keys as select keyid, authorizations.* from psk_keys join authorizations on psk_keys.client_dh_pub = authorizations.client_dh_pub;
  
 
 .quit
index 66a98e0..69650bd 100644 (file)
@@ -1,7 +1,7 @@
 %global optflags %{optflags} -Wno-parentheses
 Name:           trust_router
-Version:        1.5
-Release:        3%{?dist}
+Version:        1.5.1
+Release:        1%{?dist}
 Summary:        Moonshot Trust Router
 
 Group:          System Environment/Libraries
@@ -92,11 +92,15 @@ exit 0
 
 %post
 # Data directory
-test -d /var/lib/trust_router ||mkdir /var/lib/trust_router
-chown trustrouter:trustrouter /var/lib/trust_router
-sqlite3 </usr/share/trust_router/schema.sql /var/lib/trust_router/keys
-chown trustrouter:trustrouter /var/lib/trust_router/keys
-chmod 660 /var/lib/trust_router/keys
+tr_home=/var/lib/trust_router
+tr_schema=${tr_home}/.schema_1.5.1
+test -d ${tr_home} ||mkdir ${tr_home}
+chown trustrouter:trustrouter ${tr_home}
+test -e $tr_schema || rm -f $tr_home/keys
+sqlite3 </usr/share/trust_router/schema.sql ${tr_home}/keys
+touch $tr_schema
+chown trustrouter:trustrouter ${tr_home}/keys
+chmod 660 ${tr_home}/keys
 
 # Log Directory
 test -d /var/log/trust_router ||mkdir /var/log/trust_router