1 |
commit: 7724be2064e7f967ff1678165c514a698d8c526c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 4 18:02:04 2016 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 4 18:11:15 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7724be20 |
7 |
|
8 |
net-wireless/blueman: include polkit rules for network setup, #584300 |
9 |
|
10 |
Add a set of polkit rules that allow active users belonging to |
11 |
the plugdev group to perform network setup actions via blueman. This |
12 |
resembles the rules used by NetworkManager. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/show_bug.cgi?id=584300 |
15 |
|
16 |
net-wireless/blueman/blueman-9999.ebuild | 6 ++++++ |
17 |
net-wireless/blueman/files/01-org.blueman.rules | 11 +++++++++++ |
18 |
2 files changed, 17 insertions(+) |
19 |
|
20 |
diff --git a/net-wireless/blueman/blueman-9999.ebuild b/net-wireless/blueman/blueman-9999.ebuild |
21 |
index 011f2ef..69c82c7 100644 |
22 |
--- a/net-wireless/blueman/blueman-9999.ebuild |
23 |
+++ b/net-wireless/blueman/blueman-9999.ebuild |
24 |
@@ -97,6 +97,12 @@ src_configure() { |
25 |
src_install() { |
26 |
default |
27 |
|
28 |
+ if use policykit; then |
29 |
+ # Allow users in plugdev group to modify connections |
30 |
+ insinto /usr/share/polkit-1/rules.d |
31 |
+ doins "${FILESDIR}/01-org.blueman.rules" |
32 |
+ fi |
33 |
+ |
34 |
python_fix_shebang "${D}" |
35 |
rm "${D}"/$(python_get_sitedir)/*.la || die |
36 |
} |
37 |
|
38 |
diff --git a/net-wireless/blueman/files/01-org.blueman.rules b/net-wireless/blueman/files/01-org.blueman.rules |
39 |
new file mode 100644 |
40 |
index 0000000..2f1a2bd |
41 |
--- /dev/null |
42 |
+++ b/net-wireless/blueman/files/01-org.blueman.rules |
43 |
@@ -0,0 +1,11 @@ |
44 |
+// Let users in plugdev group modify network connections using blueman |
45 |
+polkit.addRule(function(action, subject) { |
46 |
+ if ((action.id == "org.blueman.network.setup" || |
47 |
+ action.id == "org.blueman.dhcp.client" || |
48 |
+ action.id == "org.blueman.rfkill.setstate" || |
49 |
+ action.id == "org.blueman.pppd.pppconnect") && |
50 |
+ subject.isInGroup("plugdev") && subject.active) { |
51 |
+ |
52 |
+ return polkit.Result.YES; |
53 |
+ } |
54 |
+}); |