Patchwork [5/6] pmount: allow users in disk group to perform pmount/pumount

login
register
mail settings
Submitter Hongxu Jia
Date July 12, 2013, 9:29 a.m.
Message ID <fdaa714fb7981b448aaa21855b6aad2bb5160526.1373599041.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/53559/
State New
Headers show

Comments

Hongxu Jia - July 12, 2013, 9:29 a.m.
* changed ownership group for /usr/bin/pmount and /usr/bin/pumount to 'disk';
* deny execution rights to other users except 'root' and those belonging
  to 'disk' group;
* set setuid bit to both apps;

So, basically, in order for a normal user to be able to pmount/pumount
the device, it must be a member of 'disk' group.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/pmount/pmount_0.9.23.bb | 5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/meta/recipes-extended/pmount/pmount_0.9.23.bb b/meta/recipes-extended/pmount/pmount_0.9.23.bb
index 0d357b9..54504c7 100644
--- a/meta/recipes-extended/pmount/pmount_0.9.23.bb
+++ b/meta/recipes-extended/pmount/pmount_0.9.23.bb
@@ -27,3 +27,8 @@  inherit autotools
 
 SRC_URI[md5sum] = "db19f5bf3151b1b41705ec7bafa439d3"
 SRC_URI[sha256sum] = "db38fc290b710e8e9e9d442da2fb627d41e13b3ee80326c15cc2595ba00ea036"
+
+do_install_append() {
+    chown root.disk ${D}/${bindir}/pmount ${D}/${bindir}/pumount
+    chmod o-x,u+s ${D}/${bindir}/pmount ${D}/${bindir}/pumount
+}