Add a script to regenerate the VNC client's certificate store
authorEvan Broder <broder@mit.edu>
Sun, 26 Oct 2008 21:15:01 +0000 (17:15 -0400)
committerEvan Broder <broder@mit.edu>
Sun, 26 Oct 2008 21:15:01 +0000 (17:15 -0400)
svn path=/trunk/packages/invirt-vnc-client/; revision=1336

Makefile
debian/changelog
debian/invirt-update-vnc-cert.sh [new file with mode: 0755]
debian/invirt-vnc-client.dirs
debian/invirt-vnc-client.install [new file with mode: 0644]
debian/invirt-vnc-client.postinst [new file with mode: 0644]
trust.store [deleted file]

index 30654a7..259ee2c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -33,15 +33,13 @@ SOURCES = VncViewer.java RfbProto.java AuthPanel.java VncCanvas.java \
          InStream.java MemInStream.java ZlibInStream.java \
          VNCProxyConnectSocketWrapper.java SocketWrapper.java InvirtTrustManager.java
 
-EXTRAJAR = trust.store
-
 all: $(CLASSES) $(ARCHIVE)
 
 $(CLASSES): $(SOURCES)
        $(JC) $(JCFLAGS) -O $(SOURCES)
 
 $(ARCHIVE): $(CLASSES) $(MANIFEST)
-       $(JAR) cfm $(ARCHIVE) $(MANIFEST) $(CLASSES) $(EXTRAJAR)
+       $(JAR) cfm $(ARCHIVE) $(MANIFEST) $(CLASSES)
 
 install: $(CLASSES) $(ARCHIVE)
        $(CP) $(CLASSES) $(ARCHIVE) $(PAGES) $(INSTALL_DIR)
index c799420..8b0bd05 100644 (file)
@@ -2,8 +2,9 @@ invirt-vnc-client (0.0.1) unstable; urgency=low
 
   * sipb-xen-vnc-client -> invirt-vnc-client
   * SIPBTrustManager -> InvirtTrustManager
+  * Add a script to regenerate the client's certificate store
 
- -- Evan Broder <broder@mit.edu>  Sun, 26 Oct 2008 16:05:14 -0400
+ -- Evan Broder <broder@mit.edu>  Sun, 26 Oct 2008 17:14:15 -0400
 
 sipb-xen-vnc-client (1.03) unstable; urgency=low
 
diff --git a/debian/invirt-update-vnc-cert.sh b/debian/invirt-update-vnc-cert.sh
new file mode 100755 (executable)
index 0000000..fa73f27
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [ "$(ls /etc/invirt/vnc-cert.d)" == "" ]; then
+    echo "E: No certs in /etc/invirt/vnc-cert.d/" >&2
+    echo "   Put certificates for all Invirt VNC proxy servers in" >&2
+    echo "   /etc/invirt/vnc-cert.d, then run this script again" >&2
+    exit 1
+fi
+
+TMP_DIR="$(mktemp -d)"
+for i in $(ls /etc/invirt/vnc-cert.d/*.crt); do
+    keytool -noprompt -alias "${i%.crt}" -file "/etc/invirt/vnc-cert.d/$i" \
+        -keystore "$TMP_DIR/trust.store" -storepass "foobar"
+done
+
+jar uf /usr/share/invirt-vnc-client/VncViewer.jar -C "$TMP_DIR" trust.store
+
+rm -rf "$TMP_DIR"
index 65f18e7..e80759d 100644 (file)
@@ -1 +1,2 @@
+etc/invirt/vnc-cert.d
 usr/share/invirt-vnc-client
diff --git a/debian/invirt-vnc-client.install b/debian/invirt-vnc-client.install
new file mode 100644 (file)
index 0000000..0f6411b
--- /dev/null
@@ -0,0 +1 @@
+debian/invirt-update-vnc-cert.sh usr/sbin/invirt-update-vnc-cert
diff --git a/debian/invirt-vnc-client.postinst b/debian/invirt-vnc-client.postinst
new file mode 100644 (file)
index 0000000..6fede0c
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# postinst script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+        invirt-update-vnc-cert || true
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/trust.store b/trust.store
deleted file mode 100644 (file)
index 83e9257..0000000
Binary files a/trust.store and /dev/null differ