I have this simple plugin interface for my custom application.
plugininterface.h:
#ifndef PLUGININTERFACE_H
#define PLUGININTERFACE_H
#include <QString>
class PluginInterface
{
public:
virtual QString Author() const = 0;
virtual QString Description() const = 0;
virtual bool Load() const = 0;
virtual bool Unload() const = 0;
};
Q_DECLARE_INTERFACE( PluginInterface, "MyPluginInterface" )
#endif // PLUGININTERFACE_H
Now this allows users to make plugins for my program. However I'm worried about possible malicious code that could be put into a plugin. I think it would be really good if there was a way to ensure, that whatever happens inside the plugin, it should:
- not be allowed to access the internet.
- only operate within the directory of the program it was designed for.
- have no access to other programs. (no memory reading/writing operations)
If there is no out of the box solution from QT, then I guess one solution could be to black- or whitelist namespace and libaries. If that is even possible. Hopefully there is something a QT/C++ novice like me can do.