Index: package_tags/sipb-xen-console/8.1/debian/changelog
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/changelog	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/changelog	(revision 1065)
@@ -0,0 +1,157 @@
+sipb-xen-console (8.1) unstable; urgency=low
+
+  * ConsoleFS is now RouteFS-based
+
+ -- Evan Broder <broder@mit.edu>  Sun, 05 Oct 2008 05:26:52 -0400
+
+sipb-xen-console (8.0) unstable; urgency=low
+
+  * Update config files to work with Hardy
+
+ -- Evan Broder <broder@mit.edu>  Sun, 05 Oct 2008 04:45:21 -0400
+
+sipb-xen-console (7.8) unstable; urgency=low
+
+  * generate config files using mako
+
+ -- Yang Zhang <y_z@mit.edu>  Thu, 14 Aug 2008 15:10:50 -0400
+
+sipb-xen-console (7.7) unstable; urgency=low
+
+  * sipb_xen_database -> invirt.database
+  * use invirt config in sipb-xen-consolefs
+  * added decomposition of DB URI
+  * generate nss-pgsql.conf and issue.net.no_tkt from debian init script
+
+ -- Yang Zhang <y_z@mit.edu>  Sun,  3 Aug 2008 01:13:37 -0400
+
+sipb-xen-console (7.6) unstable; urgency=low
+
+  * Use invirt-getconf to generate config.
+
+ -- Greg Price <price@mit.edu>  Wed, 30 Jul 2008 22:28:33 -0400
+
+sipb-xen-console (7.5) unstable; urgency=low
+
+  * Generate config at start/reload from /etc/invirt/*.
+
+ -- Greg Price <price@mit.edu>  Mon, 21 Jul 2008 18:29:43 -0400
+
+sipb-xen-console (7.4) unstable; urgency=low
+
+  * pull in sipb-xen-base
+
+ -- Greg Price <price@mit.edu>  Mon, 21 Jul 2008 17:41:01 -0400
+
+sipb-xen-console (7.3) unstable; urgency=low
+
+  * update for current config-package-dev
+
+ -- Greg Price <price@mit.edu>  Sun, 20 Jul 2008 15:41:50 -0400
+
+sipb-xen-console (7.3) unstable; urgency=low
+
+  * Move config details out to config package.
+
+ -- Greg Price <price@mit.edu>  Sun, 20 Jul 2008 01:01:26 -0400
+
+sipb-xen-console (7.2) unstable; urgency=low
+
+  * Multiplex consoles on multiple hosts.
+  
+ -- Greg Price <price@mit.edu>  Sun, 13 Jul 2008 08:52:18 -0400
+
+sipb-xen-console (7.1) unstable; urgency=low
+
+  * Remember to actually divert the conserver config
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 01:48:05 -0400
+
+sipb-xen-console (7) unstable; urgency=low
+
+  * Use conserver instead of ssh to connect to black-mesa
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 00:52:05 -0400
+
+sipb-xen-console (6.2) unstable; urgency=low
+
+  * /etc/modules is no longer managed by this package
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Tue,  1 Apr 2008 22:25:09 -0400
+
+sipb-xen-console (6.1) unstable; urgency=low
+
+  * Don't add the "d_" to the domain name on this side - do it on the
+    black-mesa side
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Tue, 01 Apr 2008 22:20:47 -0400
+
+sipb-xen-console (6) unstable; urgency=low
+
+  * modprobe fuse before attaching consolefs
+  * Revert code to block dropping privileges to user accounts
+  * Add configuration to accept Kerberos config for users and error on
+    non-root users if Kerberos authentication fails
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Tue, 01 Apr 2008 20:03:11 -0400
+
+sipb-xen-console (5.1) unstable; urgency=low
+
+  * Package should create /consolefs so that sipb-xen-consolefs has
+    somewhere to mount to
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Sun, 30 Mar 2008 18:20:02 -0400
+
+sipb-xen-console (5) unstable; urgency=low
+
+  * modprobe fuse at boot
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Sun, 30 Mar 2008 17:57:36 -0400
+
+sipb-xen-console (4.1) unstable; urgency=low
+
+  * It should not be trivial for us to access the serial console of
+    users' machines
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 17:42:04 -0400
+
+sipb-xen-console (4) unstable; urgency=low
+
+  * Added comments to sipb-xen-consolefs
+  * Added support for symlinks in the realpath
+  * Changed sipb-xen-consolefs to use syslog instead of printf debugging
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 14:17:59 -0400
+
+sipb-xen-console (3.2) unstable; urgency=low
+
+  * Fixing a bug in sipb-xen-consolefs ('@' is not re-added to realms
+    in the .k5login
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 06:39:30 -0400
+
+sipb-xen-console (3.1) unstable; urgency=low
+
+  * Clean up the motd a bit
+  * Add dependency on sipb-xen-chrony-config to make sure the clock is
+    staying synced
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 06:33:55 -0400
+
+sipb-xen-console (3) unstable; urgency=low
+
+  * Make the motd useful instead of turning it off
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 06:14:23 -0400
+
+sipb-xen-console (2) unstable; urgency=low
+
+  * Actually functional release.
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 05:07:43 -0400
+
+sipb-xen-console (1) unstable; urgency=low
+
+  * Initial release.
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Sun, 30 Mar 2008 01:08:50 -0400
Index: package_tags/sipb-xen-console/8.1/debian/compat
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/compat	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/compat	(revision 1065)
@@ -0,0 +1,1 @@
+5
Index: package_tags/sipb-xen-console/8.1/debian/control
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/control	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/control	(revision 1065)
@@ -0,0 +1,15 @@
+Source: sipb-xen-console
+Section: servers
+Priority: extra
+Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), config-package-dev (>= 4.5~), nscd, openssh-server, debathena-ssh-server-config, initscripts
+Standards-Version: 3.7.2
+
+Package: sipb-xen-console
+Architecture: all
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Depends: sipb-xen-base, ${shlibs:Depends}, ${misc:Depends}, conserver-client, daemon, debathena-kerberos-config, fuse-utils, libnss-pgsql1, nscd, openssh-server, python, python-routefs, sipb-xen-chrony-config, sipb-xen-database-common, remctl-server
+Description: SIPB Xen serial console server
+ This package  should be installed on sipb-xen-console
+ It makes sure that necessary tools are available.
Index: package_tags/sipb-xen-console/8.1/debian/copyright
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/copyright	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/copyright	(revision 1065)
@@ -0,0 +1,3 @@
+This package was created for internal use of the SIPB Xen Project of
+the MIT Student Information Processing Board.  Ask sipb-xen@mit.edu if
+you have questions about redistribution.
Index: package_tags/sipb-xen-console/8.1/debian/rules
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/rules	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/rules	(revision 1065)
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .sipb-xen
+DEB_TRANSFORM_FILES_sipb-xen-console += \
+	/etc/init.d/bootmisc.sh.sipb-xen \
+	/etc/nsswitch.conf.sipb-xen \
+	/etc/nscd.conf.sipb-xen \
+	/etc/pam.d/sshd.sipb-xen \
+	/etc/ssh/sshd_config.debathena.sipb-xen
+
+ifneq ($(wildcard /usr/share/base-files/nsswitch.conf),)
+    DEB_CHECK_FILES_SOURCE_/etc/nsswitch.conf.sipb-xen = \
+        /usr/share/base-files/nsswitch.conf
+endif
+
+DEB_DIVERT_FILES_sipb-xen-console += \
+	/etc/conserver/conserver.cf.sipb-xen \
+	/etc/motd.sipb-xen
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
Index: package_tags/sipb-xen-console/8.1/debian/sipb-xen-console.init
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/sipb-xen-console.init	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/sipb-xen-console.init	(revision 1065)
@@ -0,0 +1,135 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides:          sipb-xen-console
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: sipb-xen Console Server homedir filesystem
+# Description:       
+### END INIT INFO
+
+# Author: SIPB Xen Project <sipb-xen@mit.edu>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="The sipb-xen console server"
+NAME=sipb-xen-console
+DAEMON=/usr/bin/sipb-xen-consolefs
+DAEMON_ARGS="/consolefs"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+gen_config()
+{
+    for i in /etc/conserver/invirt-hosts.cf \
+             /etc/remctl/acl/invirt-console \
+             /etc/issue.net.no_tkt \
+             /etc/nss-pgsql.conf \
+             ; do
+        mako-render $i.mako > $i
+    done
+}
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+	modprobe fuse
+	gen_config
+	daemon --running -n $NAME && return 1
+	daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+	# Return
+	#   0 if daemon has been stopped
+	#   1 if daemon was already stopped
+	#   2 if daemon could not be stopped
+	#   other if a failure occurred
+	daemon --stop -n $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Many daemons don't delete their pidfiles when they exit.
+	rm -f $PIDFILE
+	umount "$DAEMON_ARGS"
+	return "$RETVAL"
+}
+
+do_reload()
+{
+	gen_config
+	/etc/init.d/conserver-server reload
+}
+
+case "$1" in
+  start)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  reload|force-reload)
+	log_daemon_msg "Reloading $DESC" "$NAME"
+	do_reload
+	log_end_msg $?
+	;;
+  restart)
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+	  	# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:
Index: package_tags/sipb-xen-console/8.1/debian/sipb-xen-console.install
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/sipb-xen-console.install	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/sipb-xen-console.install	(revision 1065)
@@ -0,0 +1,1 @@
+files/* .
Index: package_tags/sipb-xen-console/8.1/debian/transform_bootmisc.sh.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/transform_bootmisc.sh.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/transform_bootmisc.sh.sipb-xen	(revision 1065)
@@ -0,0 +1,14 @@
+#!/bin/bash
+patch -p0 -o /dev/fd/4 3<&0 4>&1 1>/dev/null <<EOF
+
+# Yes, I there's no context. But the lines being replaced are less
+# likely to change than the lines around them
+
+--- Ignored
++++ /dev/fd/3
+@@ -42,3 +42,2 @@
+-	# Update motd
+-	uname -snrvm > /var/run/motd
+-	[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
++	# Do not update motd
++	cp /etc/motd /var/run/motd
Index: package_tags/sipb-xen-console/8.1/debian/transform_nscd.conf.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/transform_nscd.conf.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/transform_nscd.conf.sipb-xen	(revision 1065)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl -0p
+s/^(\s*negative-time-to-live\s*passwd\s*).*$/\13/m or die;
+s/^(\s*negative-time-to-live\s*group\s*).*$/\13/m or die;
+s/^(\s*persistent\s*passwd\s*).*$/\1no/m or die;
+s/^(\s*persistent\s*group\s*).*$/\1no/m or die;
+
Index: package_tags/sipb-xen-console/8.1/debian/transform_nsswitch.conf.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/transform_nsswitch.conf.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/transform_nsswitch.conf.sipb-xen	(revision 1065)
@@ -0,0 +1,3 @@
+#!/usr/bin/perl -0p
+s/^(passwd: .*)$/$1 pgsql/m or die;
+s/^(group: .*)$/$1 pgsql/m or die;
Index: package_tags/sipb-xen-console/8.1/debian/transform_sshd.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/transform_sshd.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/transform_sshd.sipb-xen	(revision 1065)
@@ -0,0 +1,11 @@
+#!/bin/sh
+echo "# If they're not root, but their user exists (success),"
+echo 'auth    [success=ignore ignore=ignore default=1 module_unknown=die]   pam_succeed_if.so uid > 0'
+echo "# print the \"You don\'t have tickets\" error:"
+echo 'auth    [success=die ignore=reset default=die module_unknown=die]     pam_echo.so file=/etc/issue.net.no_tkt'
+echo "# If !(they are root),"
+echo 'auth    [success=1 ignore=ignore default=ignore module_unknown=die]   pam_succeed_if.so uid eq 0'
+echo "# print the \"your account doesn't exist\" error:"
+echo 'auth    [success=die ignore=reset default=die module_unknown=die]     pam_echo.so file=/etc/issue.net.no_user'
+echo
+exec cat
Index: package_tags/sipb-xen-console/8.1/debian/transform_sshd_config.debathena.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/debian/transform_sshd_config.debathena.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/debian/transform_sshd_config.debathena.sipb-xen	(revision 1065)
@@ -0,0 +1,2 @@
+#!/usr/bin/perl -0p
+s/^#?PrintLastLog .*$/PrintLastLog no/m or die;
Index: package_tags/sipb-xen-console/8.1/files/etc/conserver/conserver.cf.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/conserver/conserver.cf.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/conserver/conserver.cf.sipb-xen	(revision 1065)
@@ -0,0 +1,13 @@
+# default config for console
+config * {
+	sslrequired yes;
+}
+default * {
+        type exec;
+}
+access * {
+        trusted 127.0.0.1;
+        limited *;
+}
+
+#include /etc/conserver/invirt-hosts.cf
Index: package_tags/sipb-xen-console/8.1/files/etc/conserver/console.cf
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/conserver/console.cf	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/conserver/console.cf	(revision 1065)
@@ -0,0 +1,5 @@
+config * {
+  master localhost;
+  port   3109;
+  sslenabled yes;
+}
Index: package_tags/sipb-xen-console/8.1/files/etc/conserver/invirt-hosts.cf.mako
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/conserver/invirt-hosts.cf.mako	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/conserver/invirt-hosts.cf.mako	(revision 1065)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+% for h in cfg.hosts:
+#include /etc/conserver/conf.d/${h.hostname}
+% endfor
Index: package_tags/sipb-xen-console/8.1/files/etc/issue.net.no_tkt.mako
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/issue.net.no_tkt.mako	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/issue.net.no_tkt.mako	(revision 1065)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+You must login to the ${cfg.console.hostname} console server using
+Kerberos tickets, but your ssh client did not pass a valid ticket to the
+console server.
Index: package_tags/sipb-xen-console/8.1/files/etc/issue.net.no_user
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/issue.net.no_user	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/issue.net.no_user	(revision 1065)
@@ -0,0 +1,2 @@
+The VM you are attempting to access does not appear to exist.
+
Index: package_tags/sipb-xen-console/8.1/files/etc/motd.sipb-xen
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/motd.sipb-xen	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/motd.sipb-xen	(revision 1065)
@@ -0,0 +1,3 @@
+
+Type Ctrl-e, then c, then . to escape from the console
+
Index: package_tags/sipb-xen-console/8.1/files/etc/nss-pgsql.conf.mako
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/nss-pgsql.conf.mako	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/nss-pgsql.conf.mako	(revision 1065)
@@ -0,0 +1,16 @@
+<% from invirt.config import structs as cfg %>
+host        = ${cfg.db.host}
+port        = ${cfg.db.port}
+database    = ${cfg.db.dbname}
+login       = ${cfg.db.user}
+
+querypasswd = SELECT name, NULL, machine_id + 1000 as uid, machine_id + 1000 as gid, '', '/consolefs/'|| name, '/usr/bin/sipb-xen-consolesh' FROM machines
+querygroup = SELECT name, NULL, machine_id + 1000 as gid FROM machines
+querymembers = SELECT name FROM machines WHERE 1000 + machine_id = %d
+queryids = SELECT 1000 + machine_id AS gid FROM machines LIMIT 0
+
+passwd_name = name
+passwd_uid = 1000 + machine_id
+
+group_name = name
+group_gid = 1000 + machine_id
Index: package_tags/sipb-xen-console/8.1/files/etc/remctl/acl/invirt-console.mako
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/remctl/acl/invirt-console.mako	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/remctl/acl/invirt-console.mako	(revision 1065)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+% for h in cfg.hosts:
+host/${h.hostname}@${cfg.authn[0].realm}
+% endfor
Index: package_tags/sipb-xen-console/8.1/files/etc/remctl/conf.d/invirt-console
===================================================================
--- package_tags/sipb-xen-console/8.1/files/etc/remctl/conf.d/invirt-console	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/etc/remctl/conf.d/invirt-console	(revision 1065)
@@ -0,0 +1,1 @@
+console update /usr/sbin/invirt-console-update /etc/remctl/acl/invirt-console
Index: package_tags/sipb-xen-console/8.1/files/usr/bin/sipb-xen-consolefs
===================================================================
--- package_tags/sipb-xen-console/8.1/files/usr/bin/sipb-xen-consolefs	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/usr/bin/sipb-xen-consolefs	(revision 1065)
@@ -0,0 +1,92 @@
+#!/usr/bin/python
+
+import routefs
+from routes import Mapper
+
+from syslog import *
+from time import time
+
+import os
+import errno
+
+from invirt.config import structs as config
+from invirt import database
+
+realpath = "/home/machines/"
+
+class ConsoleFS(routefs.RouteFS):
+	"""
+	ConsoleFS creates a series of subdirectories each mirroring the same real
+	directory, except for a single file - the .k5login - which is dynamically
+	generated for each subdirectory
+	"""
+	
+	def __init__(self, *args, **kw):
+		"""Initialize the filesystem and set it to allow_other access besides
+		the user who mounts the filesystem (i.e. root)
+		"""
+		super(ConsoleFS, self).__init__(*args, **kw)
+		self.lasttime = time()
+		self.fuse_args.add("allow_other", True)
+		
+		openlog('sipb-xen-consolefs ', LOG_PID, LOG_DAEMON)
+		
+		syslog(LOG_DEBUG, 'Init complete.')
+
+	def make_map(self):
+		m = Mapper()
+		m.connect('', controller='getMachines')
+		m.connect(':machine', controller='getMirror')
+		m.connect(':machine/.k5login', controller='getK5login')
+		m.connect(':machine/*(path)', controller='getMirror')
+		return m
+	
+	def getMachines(self, **kw):
+		"""Get the list of VMs in the database, clearing the cache if it's 
+		older than 15 seconds"""
+		if time() - self.lasttime > 15:
+			self.lasttime = time()
+			database.clear_cache()
+		return [machine.name for machine in database.Machine.query()]
+	
+	def getMirror(self, machine, path='', **kw):
+		"""Translate the path into its realpath equivalent, and return that
+		"""
+		real = realpath + path
+		if os.path.isdir(real):
+			# The list is converted to a set so that we can handle the case 
+			# where there is already a .k5login in the realpath gracefully	  
+			return routefs.Directory(set(os.listdir(real) + ['.k5login']))
+		elif os.path.islink(real):
+			return routefs.Symlink(os.readlink(real))
+		elif os.path.isfile(real):
+			return open(real).read()
+		else:
+			return -errno.EINVAL
+	
+ 	def getK5login(self, machine, **kw):
+		"""Build the ACL for a machine and turn it into a .k5login file
+		"""
+		machine = database.Machine.query().filter_by(name=machine).one()
+		users = [acl.user for acl in machine.acl]
+		return "\n".join(map(self.userToPrinc, users) + [''])
+	
+	def mirrorPath(self, path):
+		"""Translate a virtual path to its real path counterpart"""
+		return realpath + "/".join(getParts(path)[1:])
+	
+	def userToPrinc(self, user):
+		"""Convert Kerberos v4-style names to v5-style and append a default
+		realm if none is specified
+		"""
+		if '@' in user:
+			(princ, realm) = user.split('@')
+		else:
+			princ = user
+			realm = config.authn[0].realm
+		
+		return princ.replace('.', '/') + '@' + realm
+
+if __name__ == '__main__':
+	database.connect()
+	routefs.main(ConsoleFS)
Index: package_tags/sipb-xen-console/8.1/files/usr/bin/sipb-xen-consolesh
===================================================================
--- package_tags/sipb-xen-console/8.1/files/usr/bin/sipb-xen-consolesh	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/usr/bin/sipb-xen-consolesh	(revision 1065)
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec /usr/bin/console "$USER"
Index: package_tags/sipb-xen-console/8.1/files/usr/sbin/invirt-console-update
===================================================================
--- package_tags/sipb-xen-console/8.1/files/usr/sbin/invirt-console-update	(revision 1065)
+++ package_tags/sipb-xen-console/8.1/files/usr/sbin/invirt-console-update	(revision 1065)
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+import sys
+import os
+import subprocess
+
+def main(args):
+  contents = args[2]
+  hostname = os.environ['REMOTE_HOST'].lower()
+  f = file('/etc/conserver/conf.d/'+hostname, 'w')
+  f.write(contents)
+  f.close()
+  p = subprocess.Popen(['/etc/init.d/conserver-server', 'reload'],
+                       stdout=subprocess.PIPE)
+  p.wait()
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))
