From 1081a9ebc3c91770a857e0266fa083550c8a6873 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Wed, 15 Apr 2009 11:24:45 +0100 Subject: [PATCH] limit incoming connections to localhost --- Snippets/untitled 8.tmSnippet | 22 ++++++++++++++++++++++ Support/classes/TextMate.sc | 22 +++++++++++----------- Support/sc3ctrl/SC3Controller.sc | 18 +++++++++--------- info.plist | 1 + 4 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 Snippets/untitled 8.tmSnippet diff --git a/Snippets/untitled 8.tmSnippet b/Snippets/untitled 8.tmSnippet new file mode 100644 index 0000000..cf1e237 --- /dev/null +++ b/Snippets/untitled 8.tmSnippet @@ -0,0 +1,22 @@ + + + + + content + ${1:Classname} : ${2:Object} { + *new { $3 + ^super.new.init$4; + } + + init { $5 + $6 + } +} + name + untitled + tabTrigger + class + uuid + 7581E1DB-6946-44BB-B836-6F5CE5E99B55 + + diff --git a/Support/classes/TextMate.sc b/Support/classes/TextMate.sc index 2d9be7a..d434827 100755 --- a/Support/classes/TextMate.sc +++ b/Support/classes/TextMate.sc @@ -67,7 +67,7 @@ SC3Controller { classvar nodes; *initClass { - nodes = List[]; + nodes = List[]; Platform.case(\osx) { StartUp.add { @@ -84,7 +84,7 @@ SC3Controller { }; if(nodes.isEmpty) { - node = OSCresponderNode(nil, '/sc3ctrl/cmd') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/cmd') { |t, r, msg| { thisThread.clock = SystemClock; msg[1].asString.interpretPrint; @@ -92,15 +92,15 @@ SC3Controller { }.defer }.add; nodes.add(node); - - node = OSCresponderNode(nil, '/sc3ctrl/help') { |t, r, msg| + + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/help') { |t, r, msg| { msg[1].asString.openHelpFile; }.defer }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/class') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/class') { |t, r, msg| // TM version only var fname, cmd; var klass = msg[1].asString; @@ -130,7 +130,7 @@ SC3Controller { }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/implementations') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/implementations') { |t, r, msg| if(TextMate.openReferencesInTextMate.state) { { this.methodTemplates(msg[1], true) }.defer } { // open in SC.app @@ -139,7 +139,7 @@ SC3Controller { }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/references') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/references') { |t, r, msg| if(TextMate.openReferencesInTextMate.state) { { this.methodReferences(msg[1], true) }.defer } { // open in SC.app @@ -148,12 +148,12 @@ SC3Controller { }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/stop') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/stop') { |t, r, msg| thisProcess.stop; nil; }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/clear') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/clear') { |t, r, msg| { Document.listener.string = ""; ""; postToFront.(); @@ -161,12 +161,12 @@ SC3Controller { }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/postfront') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/postfront') { |t, r, msg| { postToFront.() }.defer; }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/recompile') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/recompile') { |t, r, msg| { thisProcess.recompile; postToFront.(); diff --git a/Support/sc3ctrl/SC3Controller.sc b/Support/sc3ctrl/SC3Controller.sc index e435bb0..58e9ddb 100644 --- a/Support/sc3ctrl/SC3Controller.sc +++ b/Support/sc3ctrl/SC3Controller.sc @@ -21,38 +21,38 @@ SC3Controller { }; if(nodes.isEmpty) { - node = OSCresponderNode(nil, '/sc3ctrl/cmd') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/cmd') { |t, r, msg| msg[1].asString.interpretPrint; { postToFront.() }.defer; }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/help') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/help') { |t, r, msg| { msg[1].asString.openHelpFile }.defer }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/class') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/class') { |t, r, msg| { msg[1].asString.interpret.openCodeFile }.defer }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/implementations') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/implementations') { |t, r, msg| { SC3Controller.methodTemplates(msg[1]) }.defer }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/references') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/references') { |t, r, msg| { SC3Controller.methodReferences(msg[1]) }.defer }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/stop') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/stop') { |t, r, msg| thisProcess.stop; }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/clear') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/clear') { |t, r, msg| { Document.listener.string = ""; ""; postToFront.(); @@ -60,12 +60,12 @@ SC3Controller { }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/postfront') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/postfront') { |t, r, msg| { postToFront.() }.defer; }.add; nodes.add(node); - node = OSCresponderNode(nil, '/sc3ctrl/recompile') { |t, r, msg| + node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/recompile') { |t, r, msg| { thisProcess.recompile; postToFront.(); diff --git a/info.plist b/info.plist index 114942f..beebdec 100644 --- a/info.plist +++ b/info.plist @@ -25,6 +25,7 @@ 59AA6C90-F786-434B-B10E-DA608EFBC824 89218E54-78ED-4C0B-92C9-8FEC7E3B2664 8FA2A21C-E1C9-41AE-AEAB-7FF573747A7C + 7581E1DB-6946-44BB-B836-6F5CE5E99B55 2635D12B-F4B6-45B6-8BA4-B50215737165 FD6AB222-41B0-4851-AE06-D91F5422D7E1 BA4AE872-4314-4D57-B2C6-6A66CCC5F55E