Giter Site home page Giter Site logo

polkit-qt-example's Introduction

polkit-qt-example

实现利用polkit+dbus进行root操作实例

源码分析:http://morfans.cn/archives/2456

依赖

Qt5

polkit-qt5

编译(需要安装cmake)

git clone https://github.com/1377195627/polkit-qt-example.git

cd polkit-qt-example

mkdir build

cd build

cmake ..

make -j8

运行

运行cpserver.sh脚本将需要的配置文件复制进系统

手动运行sudo polkit-qt-example-daemon

(在systemBus注册服务死活无法自启polkit-qt-example-daemon,sessionBus可以自启,但是不是root用户运行,原因未知)

再运行polkit-qt-example,本实例一共两个polkit请求,一个运行时就请求daemon返回Hello DBus文本,第二个是请求在/etc下写入test文件(运行完自行删除)

删除复制进系统的配置文件

运行rmserver.sh

polkit-qt-example's People

Contributors

xiayesuifeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.