From 1e5b49a55b7ebd03c6e57be993668f38ac20f841 Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 30 Jun 2019 11:16:41 +1000 Subject: Include the actual source code this time. --- OhSillyThreatDetector.lsl | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 OhSillyThreatDetector.lsl (limited to 'OhSillyThreatDetector.lsl') diff --git a/OhSillyThreatDetector.lsl b/OhSillyThreatDetector.lsl new file mode 100644 index 0000000..4f17ed6 --- /dev/null +++ b/OhSillyThreatDetector.lsl @@ -0,0 +1,59 @@ + +// Detect when OpenSim reports a function was used that triggered a threat level warning. +// Coz their official method doesn't work, and often their threat levels are set way too high. + +// This script will send a link message with number DEBUG_CHANNEL, message being the name of the naughty function, +// and key of the prim containing the naughty script. It's up to the naughty script to catch this link message +// and do something less naughty. + +// Since it sniffs on DEBUG_CHANNEL messages, and a script can't hear any message sent by scripts in the same prim, +// you'll need to put this script in a prim without the naughty scripts you want to check. + +default +{ + state_entry() + { +// llSay(DEBUG_CHANNEL, "G'day, I'm " + llGetKey() + " part of " + llGetLinkKey(LINK_ROOT)); + llListen(DEBUG_CHANNEL, "", NULL_KEY, ""); + } + + listen(integer channel, string name, key id, string message) + { + key root = llList2Key(llGetObjectDetails(id, [OBJECT_ROOT]), 0); + // name is the name of the prim, id is the UUID of the prim. + // Reports the name and UUID of the prim itself, not the object it's part of. + // Naturally can't detect debugs from our own prim, even if it's a different script. + // Works from another prim in the same object. + + /* Threat level errors look like this (at least in OpenSim 0.8.2) - +OSSL Runtime Error: osSetStateEvents permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission. + +There is also (OpenSim 0.9 at least) - +Max Zephyr script +OSSL Runtime Error: permission denied. All OS functions are disabled.(script: oc_settings event: changed primID:487baa88-d6e5-420c-b18c-f47f5bbd7de4 at <127.9408, 128.0009, 25.75689>) + +My script +OSSL Runtime Error: osSetSpeed permission denied. All OS functions are disabled.(script: 1AOor2 event: changed primID:c7db8d3c-ae33-44ce-a685-cf63a37f0cf5 at <123.933, 203.0375, 24.29473>) + +From the source (NOTE: first version has no function name) - +("{0} permission denied. All OS functions are disabled.") +("{0} permission denied. All OS functions are disabled.", function) +("{0} permission denied. Allowed threat level is {1} but function threat level is {2}.", function, +("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", function +("{0} permission denied. Script permissions error.", function + +OpenSim 0.9.0.1 doesn't include the "OSSL Runtime Error: " bit at the beginning anymore. +OpenSim 0.9.2 seems to not even send it to the DEBUG_CHANNEL for scripts anymore. + */ + if ((llGetLinkKey(LINK_ROOT) == root) && ("OSSL Runtime Error: " == llGetSubString(message, 0, 19))) + { + list e = llParseStringKeepNulls(llGetSubString(message, 20, -1), [" "], []); +//llOwnerSay(llList2String(e, 0)); + if (("permission" == llList2String(e, 1)) && ("denied" == llList2String(e, 2))) + { + string function = llList2String(e, 0); + llMessageLinked(LINK_SET, DEBUG_CHANNEL, function, id); + } + } + } +} -- cgit v1.1