 |
CCP4 Molecular Graphics Documentation |
 |
| Remote Control |
Introduction
CCP4MG is able to receive input from other programs. This is done using sockets.
The other program may be on the same machine that CCP4MG is running on or a different one.
Security Considerations
CCP4MG executes the instructions which are sent to it via the socket communication. The instructions are
in the form of Python code. This poses a security problem,
if the program executed arbitrary code then a malicious program could send commands to do really bad things
to the machine running CCP4MG.
CCP4MG attempts to address this problem in a variety of ways:
- No socket is opened by default, the user has to go to "Edit->Preferences->Plugins preferences->Socket security options" to open up access.
- The default configuration is only to allow access from the local machine. The user must turn on another option to allow general access.
- Only complete instructions are looked at. A command must be enclosed within <begin> and <end>.
- Only PyQt signal emit commands are allowed. The signals are emitted from the Python object which receives the
socket commands. e.g. self.csocket.send("self.emit(QtCore.SIGNAL("setRotation"),(2,0,0))"). The receiving object
will emit a signal, this signal must be connected already by CCP4MG. Only
commands which begin "self.emit(" and end ")" are executed, all others are ignored.
Program Options
A socket for remote control may be turned on by opening up the preferences pane: Edit->Preferences->Plugins preferences->Socket security options.
There are two options:
- "Open socket for remote control". Selecting this (and clicking "Apply") will open up a socket which will allow other programs to send commands.
- "Only accept connections from local machine". If this is selected, only connections from the same machine will be allowed. Unchecking it will
allow connections from any computer.