OsConsoleCommand

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Replace script)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''Syntax:'''
+
{{osslfunc
 +
|threat_level=Severe
 +
|permissions=false
 +
|delay=0
 +
|function_syntax=integer osConsoleCommand(string command)
 +
|ossl_example=<source lang="lsl">
 +
//
 +
// osConsoleCommand Script Exemple
 +
// Author: djphil
 +
//
  
'''osConsoleCommand'''(string command)
+
integer switch;
  
'''Returns:'''
+
default
 +
{
 +
    state_entry()
 +
    {
 +
        llSay(PUBLIC_CHANNEL, "Touch to see osConsoleCommand usage.");
 +
    }
 +
   
 +
    touch_start(integer number)
 +
    {
 +
        string command = "login disable";
  
'''Threat level:'''
+
        if (switch = !switch)
 +
        {
 +
            command = "login enable";
 +
        }
  
Severe
+
        integer result = osConsoleCommand(command);
  
'''Examples:'''
+
        if (result == TRUE)
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Command \"" + command + "\" executed with success ...");
 +
        }
  
osConsoleCommand(login disable);&nbsp; This would issue a Login Disable command on the console to prevent logins.&nbsp; Any Console command can be issues with this function.
+
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Command \"" + command + "\" executed without success ...");
 +
        }
 +
    }
 +
}
 +
</source>
 +
This would issue a Login Disable command on the console to prevent logins.
 +
|description=This function allows an LSL script to directly execute a command to opensim's console.  Even if the function is available, only administrators/gods can successfully execute it.
  
'''SECURITY !!!''':&nbsp;&nbsp; This command CAN&nbsp;be Dangerous.&nbsp; Therefore when setting up the [XEngine] section of your OpenSim.ini '''Allow_osConsoleCommand = UUID'''
+
In addition, one can further restrict this function to only certain administrators/gods. See [[Threat level]] for more information on how to do this.
  
Where UUID is the OWNERS&nbsp;or ACCEPTED&nbsp;Users UUID.&nbsp; You can use '''Allow_osConsoleCommand = UUID,UUID,UUID''' which would allow for 3 People to be identified.
+
If the script owner does have the necessary permissions to call this function, then they can do anything someone with direct access to the command console could do, such as changing the avatar passwords, deleting sims, changing the terrain, etc.
  
------------------------------------------------------------------------
+
This command represents the highest security threat of any OSSL function, giving it a threat level of ''Severe''.  
 
+
--[[User:SimCore|SimCore]] 14:30, 12 November 2010 (UTC)
+
 
+
This function allows an LSL script to directly execute a command to opensim's console. There are no security checks, so it can do anything a user with access to the command console could do, such as changing the avatar passwords, deleting sims, changing the terrain, and just about everything else. This command represents the highest security threat of any OSSL function, giving it a threat level of '''Severe'''.  
+
  
 
Do not use or allow this function unless you are absolutely sure of what you're doing!  
 
Do not use or allow this function unless you are absolutely sure of what you're doing!  
 
+
|
--[[User:ZauberExonar|ZauberExonar]] 08:02, 5 February 2010 (UTC)
+
}}

Latest revision as of 17:00, 5 December 2020

integer osConsoleCommand(string command)
This function allows an LSL script to directly execute a command to opensim's console. Even if the function is available, only administrators/gods can successfully execute it.

In addition, one can further restrict this function to only certain administrators/gods. See Threat level for more information on how to do this.

If the script owner does have the necessary permissions to call this function, then they can do anything someone with direct access to the command console could do, such as changing the avatar passwords, deleting sims, changing the terrain, etc.

This command represents the highest security threat of any OSSL function, giving it a threat level of Severe.

Do not use or allow this function unless you are absolutely sure of what you're doing!

Threat Level Severe
Permissions Use of this function is always disabled by default
Extra Delay 0 seconds
Example(s)
//
// osConsoleCommand Script Exemple
// Author: djphil
//
 
integer switch;
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osConsoleCommand usage.");
    }
 
    touch_start(integer number)
    {
        string command = "login disable";
 
        if (switch = !switch)
        {
            command = "login enable";
        }
 
        integer result = osConsoleCommand(command);
 
        if (result == TRUE)
        {
            llSay(PUBLIC_CHANNEL, "Command \"" + command + "\" executed with success ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Command \"" + command + "\" executed without success ...");
        }
    }
}

This would issue a Login Disable command on the console to prevent logins.

Personal tools
General
About This Wiki