SUTAgent should detect rooting method

RESOLVED WONTFIX

Status

Testing
SUTAgent
RESOLVED WONTFIX
3 years ago
3 years ago

People

(Reporter: bc, Unassigned)

Tracking

Trunk
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
devicemanagerADB.py and adb.py both perform checks to see if adbd is running as root, adb.py checks if su supports su -c commandline or if su support su 0 command arguments. Bug 1148395 is about adding support for su 0 to devicemanagerADB.

See:
https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py#655

https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/adb.py#550

SUTAgentAndroid should detect the rooted state of the device and if adbd is already running as root, it should not attempt to use su. It should also detect which version of su is installed and use the proper invocation instead of hard coding the use of su -c commandline as in getSuArgs in https://dxr.mozilla.org/mozilla-central/source/build/mobile/sutagent/android/DoCommand.java#3390.
(Reporter)

Comment 1

3 years ago
Created attachment 8587384 [details] [diff] [review]
bug-1148421-dmSUT-su.patch

It appears that unless we use su of some form, the commands issued by the sutagent will be executed with the user id of the sutagent regardless of whether adbd runs as root.

I tested a patch which attempts to detect if su -c or su 0 sh -c would work, but none of my devices actually support su 0 exclusively any more and without a sutagent that supports su 0, it actually only matters in the fallback for backwards compatibility in shell().

without patch:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e4c2de544dfc&exclusion_profile=false

with patch:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=940f1c0ed5e9&exclusion_profile=false

I included sample mochitest, robocop, jsreftest and reftest jobs in this to make sure the patch didn't interfere with them.

The original motivation for this bug, bug 1148423, has been resolved by re-rooting a couple of the Autophone devices. Without testing on a debug or engineering build, I'm not that motivated to actually check this in.
(Reporter)

Comment 2

3 years ago
I'm going to wontfix for now.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.