Allow telnetd.properties to configure constructed shells
Brought to you by:
wimpi
While available shells are configured through telnetd.properties, there appears to currently be no way to specify properties for the constructed shell objects. This would be advantageous when using a shell class with multiple, concurrent TelnetD server instances.
This could probably be done by allowing the <ShellClass>.createShell method to accept properties that apply to that shell, as configured in the telnetd.properties. This should probably be made optional for compatibility.
I've attached a suggested patch to do what I've described. In the properties supplied to the TelnetD object, you can specify the following:
shells=<shells>
shell.<name>.class=<classname>
shell.<name>.<propertyname1>=<propertyvalue1>
shell.<name>.<propertyname2>=<propertyvalue2>
shell.<name>.<propertyname3>=<propertyvalue3>
...
where <name> is the name of the shell. When the specified shell class is constructed, if the createShell method has a single Properties argument, it will receive a Properties object containing the following:
<propertyname1>=<propertyvalue1>
<propertyname2>=<propertyvalue2>
<propertyname3>=<propertyvalue3>
...
If the createShell method has no arguments, it will be called without the properties.
suggested patch