[oe-commits] =?UTF-8?Q?Andreas=20M=C3=BCller=20?=: polkit-group-rule-datetime: initial add

git at git.openembedded.org git at git.openembedded.org
Thu Jun 20 10:23:25 UTC 2013


Module: meta-openembedded.git
Branch: master
Commit: 010f75a8d052251fee1bb2d42f926693fade962c
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=010f75a8d052251fee1bb2d42f926693fade962c

Author: Andreas Müller <schnitzeltony at googlemail.com>
Date:   Tue Jun 18 11:01:36 2013 +0200

polkit-group-rule-datetime: initial add

add user-group 'datetime' allowing members to change date/time/timezone settings

Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>

---

 .../files/50-org.freedesktop.timedate1.rules       |    8 ++++++++
 .../polkit/polkit-group-rule-datetime.bb           |   14 ++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules b/meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules
new file mode 100644
index 0000000..95b0e0f
--- /dev/null
+++ b/meta-oe/recipes-extended/polkit/files/50-org.freedesktop.timedate1.rules
@@ -0,0 +1,8 @@
+/* give group 'datetime' rights to change settings */
+/* based upon http://lists.freedesktop.org/archives/systemd-devel/2013-March/009576.html */
+
+polkit.addRule(function(action, subject) {
+  if (action.id.indexOf("org.freedesktop.timedate1.") == 0 && subject.isInGroup("datetime")) {
+    return polkit.Result.YES;
+  }
+});
diff --git a/meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb b/meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb
new file mode 100644
index 0000000..373e4f0
--- /dev/null
+++ b/meta-oe/recipes-extended/polkit/polkit-group-rule-datetime.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "Create usergroup datetime. All members off this group are allowed set date/time/timezone via system dbus"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+require polkit-group-rule.inc
+
+SRC_URI = "file://50-org.freedesktop.timedate1.rules"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/50-org.freedesktop.timedate1.rules ${D}${sysconfdir}/polkit-1/rules.d
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system datetime"



More information about the Openembedded-commits mailing list