Patchwork [Pull,v3,3/4] connman: Use useradd to add the xuser for DBus

login
register
mail settings
Submitter Saul Wold
Date Nov. 2, 2011, 12:21 a.m.
Message ID <d8848c7c7d57e08c6234c34b5deabfe525df3b61.1320191934.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/14181/
State New, archived
Headers show

Comments

Saul Wold - Nov. 2, 2011, 12:21 a.m.
Connmand needs to start as the xuser as defined in the dbus
configuration and needs to share this with rootless X. Since
it's possible for connmand to run on a sytem without rootless
X we still need to create the user here.

Useradd will fail gracefully if the user already exists.

Fixes: [YOCTO #1699]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-connectivity/connman/connman.inc     |    7 ++++++-
 meta/recipes-connectivity/connman/connman_0.75.bb |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index ae1b725..480b59c 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -18,7 +18,12 @@  DEPENDS  = "libgdbus dbus glib-2.0 iptables"
 INITSCRIPT_NAME = "connman"
 INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
 
-inherit autotools pkgconfig update-rc.d
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home \
+                       --shell /bin/false --groups video,tty,audio \
+                       --user-group xuser"
+
+inherit autotools pkgconfig update-rc.d useradd
 
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d/
diff --git a/meta/recipes-connectivity/connman/connman_0.75.bb b/meta/recipes-connectivity/connman/connman_0.75.bb
index 8a02753..78f2199 100644
--- a/meta/recipes-connectivity/connman/connman_0.75.bb
+++ b/meta/recipes-connectivity/connman/connman_0.75.bb
@@ -1,5 +1,5 @@ 
 require connman.inc
-PR = "r2"
+PR = "r3"
 
 EXTRA_OECONF += "\
   ac_cv_path_WPASUPPLICANT=/usr/sbin/wpa_supplicant \