This is not an executable so we have to specifically set its permissions
accordingly.
Bug: 25668833
Change-Id: I502f69bad75b4da4fdc29eb3ebaa42a19ae04d27
Pulling symlinks was broken for directories, and it doesn't seem like
there's a good way to make it not broken, given that the protocol doesn't
have readlink (and we don't want to create symlinks on Windows, anyway).
The behavior for files doesn't seem to be especially useful, either.
Bug: http://b/25601283
Change-Id: Ie1d27e93dd09cbc0c178623b390041d1cb11f726
This CL creates a Transport object to provide a generic interface for
various transports. Specifically this is designed to be able to add UDP
support to fastboot in an upcoming CL without changing the main program
logic.
Also includes some minor code style fixes and replaces malloc/free
in the USB implementation files with smart pointers and std::string.
Bug: http://b/22029765
Change-Id: I68641af0da7d13db4647f5e20a18d04d67f0b327
The toolbox -t option is really the standard -H option. Add -H so
I can switch dumpstate over.
We should also flush after each run so we don't arbitrarily truncate
at the stdio buffer size. (I'm pretty sure no one uses toolbox top
interactively, but it annoyed me while testing -H.)
Change-Id: Ib87cb541d1b21c48468614b2ef60b0cc62694c95
Resolve three areas missing taglen checking. Add some additional
limit-checking paranoia. Problem started when p was allowed to
go beyond the size of the incoming buffer in some blind
p = cp + 1 fragments, placed the check for that after them all
before harm could be done, rather than in each location.
Bug: 25620123
Change-Id: Ib5687fd30ef0cd3ba3bc0df310b436ad675ccabc
Cleanup TODO and instead of (poorly) converting the device name from
wchar_t to char, just retrieve and store it as wchar_t, simplifying the
code.
This probably isn't necessary since device names are probably always
ASCII, but this cleans things up.
Change-Id: Ib780dcdc1e0e06b97b61e25d29a23874b35d7800
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
See the new types added here :
https://chromium-review.googlesource.com/304660
Add support for these.
Signed-off-by: Benson Leung <bleung@google.com>
Change-Id: I12c51e0611692a763a7f1cda57c77ad83d7aa7ea
Now that we have a more standardized API (also available in Chromium),
switch to it. Another benefit is real error handling instead of just
killing the process on invalid Unicode.
Make UTF8ToWide()/WideToUTF8() set errno to EILSEQ on bad input. This is
the same error code that wcsrtombs(3) uses.
Update the unittest to check for EILSEQ.
Change-Id: Ie92acf74d37adaea116cf610c1bf8cd433741e16
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Although ever present, an increased regression introduced with
commit b6bee33182 (liblog: logd:
support logd.timestamp = monotonic).
A signal handler can interrupt in locked context, if log is written
in the signal handler, we are in deadlock. Block signals while we
are locked. Separate out timestamp lock from is loggable lock to
reduce contention situations. Provide a best-guess response if
lock would fail in timestamp path.
Bug: 25563384
Change-Id: I6dccd6b99ebace1c473c03a785a35c63ed5c6a8a
This makes native test directories 750 root:shell. This matches the
value for files within those directories, and results in a more usable
access paradigm when (say) unprivileged test tools need to discover
these test binaries.
Bug: 25668833
Change-Id: I9bd2081b2c211b4383b5873238aaf64597756714
libupdate_engine_client returns the channel as "stable-channel",
"dev-channel" or "beta-channel". This CL updates the parsing logic to
match this format.
Bug: 25669566
Test: unit tests
Test: manual: The reported channel matches what update_engine_client
--show_channel reports.
Change-Id: Ic6e52df892ae0b438f58fc05b178d5844d6674d0
On exit, these destructors get invoked while other threads might
still be using them, potentially causing a crash, and definitely
causing tsan to report a race condition.
Bug: http://b/23384853
Change-Id: I94de55d22f97f4edd1d7cc1f34e8c1f8dfd56a5a
This reverts commit cc8cd59456.
With the dependency on libcutils (for gettid for non-bionic) removed,
this no longer breaks the build.
Change-Id: I645bd6876e2502ddc1535b69af1e645c0df9d178
Access to /proc files are limited to processes with group
permissions for AID_READPROC, so add that group to the list
of supplemental groups that the user_collector joins.
Bug: 25598241
Change-Id: I26c77b052229346a3ac7150f38e03294f3641f96
28416d6d33 broke adb shell on Windows
because it was calling unix_read() with a buffer size of 1 byte which
wasn't supported by unix_read()/_console_read().
This change makes _console_read() support such a small buffer by
maintaining an internal input buffer.
This lets us simplify the existing code that was already maintaining a
cached INPUT_RECORD.
Also eliminate some duplicate code in the big switch statement.
Change-Id: I8f0aed4fb9f6f2f5b9a6b68ce60d2e368fec81c7
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
Previously, `adb pull /data/local/tmp` would spew all of the contents of
/data/local/tmp into the current directory. This patch makes push/pull
keep directories intact.
Bug: http://b/25394682
Change-Id: I2304ae9e61745a2b9536f58a6012640bf8ff422a
This commit fixes two cases:
`adb pull /data/local/tmp nonexistent/path` would succeed.
`adb pull /data/local/tmp nonexistent/` would fail.
Change-Id: I60c39eb2816946686241af42cfa2ad5cdc63fb0e