From 214d464c7ffd66d361fffa285ae273de720d47d1 Mon Sep 17 00:00:00 2001 From: Jamie Doornbos Date: Fri, 30 May 2008 18:06:07 +0000 Subject: [PATCH] Fixed the token and added a TODO since ProcessBuilder on unix cannot handle empty strings git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5147 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/bureau/server/BureauRegistry.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/bureau/server/BureauRegistry.java b/src/java/com/threerings/bureau/server/BureauRegistry.java index b47901877..6c17b2c91 100644 --- a/src/java/com/threerings/bureau/server/BureauRegistry.java +++ b/src/java/com/threerings/bureau/server/BureauRegistry.java @@ -157,9 +157,10 @@ public class BureauRegistry bureau.bureauId = agent.bureauId; // schedule the bureau to be kicked off + String token = generateToken(); bureau.builder = new ProcessBuilder( generator.createCommand( - _serverNameAndPort, agent.bureauId, "")); + _serverNameAndPort, agent.bureauId, token)); bureau.builder.redirectErrorStream(true); @@ -415,6 +416,16 @@ public class BureauRegistry return new FoundAgent(bureau, agent, bureau.agentStates.get(agent)); } + /** + * Create a hard-to-guess token that the bureau can use to authenticate itself when it tries + * to log in. + */ + protected String generateToken () + { + // TODO: implement + return "hard-to-guess-token"; + } + /** * Invoker unit to launch a bureau's process, then assign the result on the main thread. */