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
=== modified file 'debian/changelog'
--- debian/changelog 2016-09-09 15:28:10 +0000
+++ debian/changelog 2016-09-28 04:44:47 +0000
@@ -1,3 +1,11 @@
1usensord (1.1+16.10.20160928-0ubuntu2) vivid; urgency=medium
2
3 * Fix lp:1628042.
4 Add telephony-service-approver and telephony-service-indicator
5 as privileged caller to usensord.
6
7 -- Zhang Enwei <enwei.zhang@canonical.com> Wed, 28 Sep 2016 12:24:27 +0800
8
1usensord (1.1+16.10.20160909-0ubuntu1) yakkety; urgency=medium9usensord (1.1+16.10.20160909-0ubuntu1) yakkety; urgency=medium
210
3 [ enwei ]11 [ enwei ]
412
=== modified file 'haptic/haptic.go'
--- haptic/haptic.go 2016-09-09 15:26:00 +0000
+++ haptic/haptic.go 2016-09-28 04:44:47 +0000
@@ -72,6 +72,8 @@
72 HAPTIC_DEVICE = "/sys/class/timed_output/vibrator/enable"72 HAPTIC_DEVICE = "/sys/class/timed_output/vibrator/enable"
73 PROP_DBUS_IFACE = "org.freedesktop.DBus.Properties"73 PROP_DBUS_IFACE = "org.freedesktop.DBus.Properties"
74 OSK_PROCESS_NAME = "/usr/bin/maliit-server"74 OSK_PROCESS_NAME = "/usr/bin/maliit-server"
75 TSA_PROCESS_NAME = "/usr/bin/telephony-service-approver"
76 TSI_PROCESS_NAME = "/usr/bin/telephony-service-indicator"
75 UNCONFINED_PROFILE = "unconfined"77 UNCONFINED_PROFILE = "unconfined"
76)78)
7779
@@ -167,7 +169,7 @@
167 logger.Println("aa_is_enabled failed:", error)169 logger.Println("aa_is_enabled failed:", error)
168 profile = UNCONFINED_PROFILE170 profile = UNCONFINED_PROFILE
169 }171 }
170 isOSK := false172 isPrivileged := false
171 if profile == UNCONFINED_PROFILE {173 if profile == UNCONFINED_PROFILE {
172 file := "/proc/" + strconv.FormatUint(uint64(pid), 10) + "/exe"174 file := "/proc/" + strconv.FormatUint(uint64(pid), 10) + "/exe"
173 _, err := os.Lstat(file)175 _, err := os.Lstat(file)
@@ -179,13 +181,12 @@
179 logger.Printf("fail to read %s with error:", file, erreadexe.Error())181 logger.Printf("fail to read %s with error:", file, erreadexe.Error())
180 } else {182 } else {
181 pname := strings.TrimSpace(string(exe))183 pname := strings.TrimSpace(string(exe))
182 if pname == OSK_PROCESS_NAME {184 if pname == OSK_PROCESS_NAME || pname == TSA_PROCESS_NAME || pname == TSI_PROCESS_NAME {
183 isOSK = true185 isPrivileged = true
184 }186 }
185 }187 }
186 }188 }
187 if !isOSK && pvalue == 0 {189 if !isPrivileged && pvalue == 0 {
188 logger.Println("not vibrate since not osk and pvalue is 0")
189 reply = dbus.NewMethodReturnMessage(msg)190 reply = dbus.NewMethodReturnMessage(msg)
190 return reply191 return reply
191 }192 }

Subscribers

People subscribed via source and target branches