Merge lp:~zhangew401/usensord/fix-lp-1628042 into lp:usensord

Proposed by Zhang Enwei
Status: Merged
Approved by: Pat McGowan
Approved revision: 30
Merged at revision: 30
Proposed branch: lp:~zhangew401/usensord/fix-lp-1628042
Merge into: lp:usensord
Diff against target: 54 lines (+14/-5)
2 files modified
debian/changelog (+8/-0)
haptic/haptic.go (+6/-5)
To merge this branch: bzr merge lp:~zhangew401/usensord/fix-lp-1628042
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
Pat McGowan (community) Approve
Review via email: mp+306985@code.launchpad.net

Description of the change

fix lp:1628042, add telephony-service-approver and telephony-service-indicator as privileged caller to usensord

To post a comment you must log in.
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Looks good, the code makes sense and the new package in ticket 2014 works per the test plan

review: Approve
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

looks good.
I am no expert in usensord, but adding telephony-service-* as privileged processes looks correct to me.
Thanks Enwei!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-09-09 15:28:10 +0000
3+++ debian/changelog 2016-09-28 04:44:47 +0000
4@@ -1,3 +1,11 @@
5+usensord (1.1+16.10.20160928-0ubuntu2) vivid; urgency=medium
6+
7+ * Fix lp:1628042.
8+ Add telephony-service-approver and telephony-service-indicator
9+ as privileged caller to usensord.
10+
11+ -- Zhang Enwei <enwei.zhang@canonical.com> Wed, 28 Sep 2016 12:24:27 +0800
12+
13 usensord (1.1+16.10.20160909-0ubuntu1) yakkety; urgency=medium
14
15 [ enwei ]
16
17=== modified file 'haptic/haptic.go'
18--- haptic/haptic.go 2016-09-09 15:26:00 +0000
19+++ haptic/haptic.go 2016-09-28 04:44:47 +0000
20@@ -72,6 +72,8 @@
21 HAPTIC_DEVICE = "/sys/class/timed_output/vibrator/enable"
22 PROP_DBUS_IFACE = "org.freedesktop.DBus.Properties"
23 OSK_PROCESS_NAME = "/usr/bin/maliit-server"
24+ TSA_PROCESS_NAME = "/usr/bin/telephony-service-approver"
25+ TSI_PROCESS_NAME = "/usr/bin/telephony-service-indicator"
26 UNCONFINED_PROFILE = "unconfined"
27 )
28
29@@ -167,7 +169,7 @@
30 logger.Println("aa_is_enabled failed:", error)
31 profile = UNCONFINED_PROFILE
32 }
33- isOSK := false
34+ isPrivileged := false
35 if profile == UNCONFINED_PROFILE {
36 file := "/proc/" + strconv.FormatUint(uint64(pid), 10) + "/exe"
37 _, err := os.Lstat(file)
38@@ -179,13 +181,12 @@
39 logger.Printf("fail to read %s with error:", file, erreadexe.Error())
40 } else {
41 pname := strings.TrimSpace(string(exe))
42- if pname == OSK_PROCESS_NAME {
43- isOSK = true
44+ if pname == OSK_PROCESS_NAME || pname == TSA_PROCESS_NAME || pname == TSI_PROCESS_NAME {
45+ isPrivileged = true
46 }
47 }
48 }
49- if !isOSK && pvalue == 0 {
50- logger.Println("not vibrate since not osk and pvalue is 0")
51+ if !isPrivileged && pvalue == 0 {
52 reply = dbus.NewMethodReturnMessage(msg)
53 return reply
54 }

Subscribers

People subscribed via source and target branches