简体   繁体   English

运行具有授予权限的NPAPI插件(fireath)

[英]Run a NPAPI plugin with granted privileges (firebreath)

My NPAPI plugin needs root privileges to run. 我的NPAPI插件需要root特权才能运行。 I'm wondering if there is any portable way to do it with firebreath. 我想知道是否有任何便携式方法可以通过喷火来实现。

If not, I took a look at how Firesheep does it , but it requires a binary file and a launcher (which is the plugin). 如果没有,我看一下Firesheep的工作方式 ,但是它需要一个二进制文件和一个启动器(即插件)。 How to tell cmake to build the binary and the plugin separately ? 如何告诉cmake分别构建二进制文件和插件?

You would need to launch another process and have that do the work; 您将需要启动另一个流程,然后进行工作。 as a plugin you don't own your own process, and you can't change the rights that a process runs with anyway, you have to relaunch it. 作为插件,您不拥有自己的进程,并且无论如何都无法更改进程运行的权限,因此必须重新启动它。

There is no "portable" way to do this; 没有“便携式”方法可以做到这一点; you'll have to write platform specific code for each platform. 您必须为每个平台编写平台特定的代码。 You can add another cmake project just by creating a new directory with a CMakeLists.txt file, etc, and using add_directory to include it. 您可以通过使用CMakeLists.txt文件等创建一个新目录,然后使用add_directory包含该目录来添加另一个cmake项目。 There are plenty of tutorials available for doing this, and of course the CMake Documentation is helpful. 很多 教程 可以 做到这一点,当然, CMake文档是有帮助的。

When you add a new project with cmake it'll just show up as an additional project alongside the others that FireBreath already has, so it can be built together with the rest of what you're doing. 当您使用cmake添加新项目时,该项目将与FireBreath已有的其他项目一起显示为其他项目,因此可以将其与您正在做的其余事情一起构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM