From: rtrimana Date: Mon, 16 Oct 2017 19:02:51 +0000 (-0700) Subject: Minor adjustments for Tomoyo for the fourth benchmark X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=commitdiff_plain;h=3c845e58955c3ba9f53e1a6ce0b454feff56c22d;ds=sidebyside Minor adjustments for Tomoyo for the fourth benchmark --- diff --git a/benchmarks/Java/HomeSecurityController/HomeSecurityController.java b/benchmarks/Java/HomeSecurityController/HomeSecurityController.java index 6615f83..3b7cf53 100644 --- a/benchmarks/Java/HomeSecurityController/HomeSecurityController.java +++ b/benchmarks/Java/HomeSecurityController/HomeSecurityController.java @@ -252,8 +252,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt System.out.println("DEBUG: Initialized smartthings sensor! ID: " + sensorId + " Room ID: " + rm.getRoomID()); senDetectStatus.put(sensorId, false); System.out.println("DEBUG: Initialized sensor detection to false!"); + System.out.println("DEBUG: Now sensor ID is being set!"); // Initialize IoTCloud sen.setId(sensorId++); + System.out.println("DEBUG: Set sensor ID to: " + sensorId + "!"); sen.registerCallback(this); System.out.println("DEBUG: Registered sensor callback!"); } catch (Exception e) { diff --git a/iotjava/iotruntime/master/IoTMaster.java b/iotjava/iotruntime/master/IoTMaster.java index f3bae94..6643eee 100644 --- a/iotjava/iotruntime/master/IoTMaster.java +++ b/iotjava/iotruntime/master/IoTMaster.java @@ -779,9 +779,9 @@ public final class IoTMaster { // Setting up router policies for HTTP/HTTPs if (STR_ACTIVATE_SANDBOXING.equals("Yes")) { if (strControllerName != null) { - processJailConfig.configureProcessJailInetAddressPolicies(strControllerName, strAddress); + processJailConfig.configureProcessJailInetAddressPolicies(strControllerName, STR_ROUTER_ADD, strAddress); } else { - processJailConfig.configureProcessJailInetAddressPolicies(strHostAddress, strAddress); + processJailConfig.configureProcessJailInetAddressPolicies(strHostAddress, STR_ROUTER_ADD, strAddress); } } routerConfig.configureRouterHTTPPolicies(STR_ROUTER_ADD, strHostAddress, strAddress); diff --git a/iotjava/iotruntime/master/ProcessJailConfig.java b/iotjava/iotruntime/master/ProcessJailConfig.java index 4781fbd..757313a 100644 --- a/iotjava/iotruntime/master/ProcessJailConfig.java +++ b/iotjava/iotruntime/master/ProcessJailConfig.java @@ -344,10 +344,14 @@ public final class ProcessJailConfig { * @param strAddress String device IP address * @return void */ - public void configureProcessJailInetAddressPolicies(String strConfigHost, String strAddress) { + public void configureProcessJailInetAddressPolicies(String strConfigHost, String strRouterAddress, String strAddress) { PrintWriter pwConfig = getPrintWriter(strConfigHost); //System.out.println("\n\nDEBUG: Writing the config host address setup!!!\n\n"); + pwConfig.println("file read /etc/resolv.conf"); + pwConfig.println("file read /etc/hosts"); + pwConfig.println("file read /etc/host.conf"); + pwConfig.println("network inet dgram send " + strRouterAddress + " " + String.valueOf(53)); // TCP/UDP access through router pwConfig.println("network inet stream connect ::ffff:" + strAddress + " " + String.valueOf(80)); // HTTP access for this address } diff --git a/localconfig/tomoyo/Java.tomoyo.pol b/localconfig/tomoyo/Java.tomoyo.pol index b916747..c58214c 100644 --- a/localconfig/tomoyo/Java.tomoyo.pol +++ b/localconfig/tomoyo/Java.tomoyo.pol @@ -44,6 +44,7 @@ network inet stream connect ::ffff: file read /home/iotuser/iot2/iotjava/iotruntime/master/\*.class file read /home/iotuser/iot2/iotjava/iotruntime/messages/\*.class file read /home/iotuser/iot2/iotjava/iotruntime/zigbee/\*.class +file read /home/iotuser/iot2/iotjava/iotcloud/\*.class file read /home/iotuser/iot2/iotjava/iotruntime/resources/\*.csv file read /home/iotuser/iot2/iotjava/iotruntime/music/\*.mp3 file read /dev/random @@ -52,6 +53,7 @@ file create /home/iotuser/iot2/iotjava/iotruntime/.jar 0666 file read/write /home/iotuser/iot2/iotjava/iotruntime/.jar file read /home/iotuser/iot2/iotjava/iotrmi/Java/\*.class file ioctl socket:[family=10:type=1:protocol=6] 0x541B +file ioctl socket:[family=2:type=2:protocol=17] 0x541B file read /home/iotuser/iot2/iotjava/iotruntime/\*.class file read /usr/share/locale/en_GB/LC_MESSAGES/libc.mo file create /tmp/imageio\*.tmp 0600