Commit graph

18539 commits

Author SHA1 Message Date
Josh Gao
8591f719d0 Merge "adb: properly handle path separators on Windows." 2015-11-12 21:25:00 +00:00
Steve Fung
d36829a734 Merge "crash_reporter: Join AID_READPROC group" 2015-11-12 20:22:10 +00:00
Josh Gao
7df6b5fc79 libbase: remove exit-time destructors.
Removed for the same reason as the adb exit-time destructors.

Bug: http://b/23384853
Change-Id: Ic124ecb9df132b850a3855e207baffec926dde29
2015-11-12 11:54:47 -08:00
Josh Gao
b7b1edf974 adb: remove exit-time destructors.
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
2015-11-12 11:20:19 -08:00
Bertrand Simonnet
ee50a72d31 Merge "metricsd: Fix logging initialization." 2015-11-12 17:21:39 +00:00
Elliott Hughes
8ce943b3f6 Merge "Cope with angler's whitespace-padded partition size reporting." 2015-11-12 15:38:58 +00:00
Elliott Hughes
a2db2618ec Cope with angler's whitespace-padded partition size reporting.
Before:

  $ fastboot -w
  wiping userdata...
  Couldn't parse partition size '0x        0x66257ee00'.
  wiping cache...
  Couldn't parse partition size '0x        0x6400000'.
  erasing 'userdata'...

Bug: http://b/25653580
Change-Id: I301b8410689c1e52681796c240a149d270360edf
2015-11-12 07:28:39 -08:00
Daniel Rosenberg
7aa38bc54c Update fastboot help command with long options
Change-Id: I8fb6b5139f81893b324202d4c68f29393213ee6f
2015-11-11 20:27:56 -08:00
Daniel Rosenberg
0d08856416 Changed set_active to be a flag
set_active must be able to accept flag like arguments

Change-Id: I6dd162453835d2d64fd8d877f2a7b98e8dd8a907
2015-11-11 20:27:50 -08:00
Daniel Rosenberg
a797479bd5 Fix fastboot variable name
Change-Id: I0c2753e2b79d715f227ee314c071ce68d91779b3
2015-11-11 20:27:43 -08:00
Elliott Hughes
dcb8b288ca Merge "Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""" 2015-11-12 02:30:08 +00:00
Elliott Hughes
c1fd492ac5 Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""
This reverts commit cc8cd59456.

With the dependency on libcutils (for gettid for non-bionic) removed,
this no longer breaks the build.

Change-Id: I645bd6876e2502ddc1535b69af1e645c0df9d178
2015-11-11 18:23:00 -08:00
Steve Fung
a76ba85783 crash_reporter: Join AID_READPROC group
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
2015-11-11 17:50:37 -08:00
Elliott Hughes
524716889b Merge "adb: win32: fix adb shell" 2015-11-12 01:13:54 +00:00
Spencer Low
32762f4afd adb: win32: fix adb shell
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>
2015-11-11 16:59:06 -08:00
Josh Gao
bf666599b3 Merge changes from topic 'adb_dir'
* changes:
  adb: don't explode directories when pushing/pulling.
  adb: improve error handling, comments.
2015-11-11 23:22:48 +00:00
Josh Gao
389cab802a Merge "adb: add 100 column limit to .clang-format." 2015-11-11 22:22:59 +00:00
Josh Gao
32b24cfb5f adb: add 100 column limit to .clang-format.
Change-Id: I7d96a6d505d2ddd92ffe7ad12ffc777c03c63caf
2015-11-11 14:16:07 -08:00
Josh Gao
1a0253092d adb: properly handle path separators on Windows.
Bug: http://b/25573669
Change-Id: Ic82981e1dfe40d5e3b3ffa06e18e62ecf80d81fc
2015-11-11 14:01:46 -08:00
Josh Gao
07db1196e7 adb: don't explode directories when pushing/pulling.
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
2015-11-11 14:01:45 -08:00
Josh Gao
12a2ae9a0c adb: improve error handling, comments.
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
2015-11-11 14:00:11 -08:00
Jorge Lucangeli Obes
ae0f53cf69 Merge "Fix typo, caps in error messages." 2015-11-11 21:55:30 +00:00
Jorge Lucangeli Obes
f39c56456d Fix typo, caps in error messages.
Bug: None
Change-Id: I673189f84812637c240321b72cf77b26b170b6ad
2015-11-11 11:34:14 -08:00
Calin Juravle
7605a56fbc Merge "Create a folder to store method traces activated with -Xmethod-trace" 2015-11-11 18:07:13 +00:00
Elliott Hughes
fdebc26ad5 Merge "Revert "adb/base: fix adb push of Unicode filenames on Win32"" 2015-11-11 18:01:34 +00:00
Elliott Hughes
cc8cd59456 Revert "adb/base: fix adb push of Unicode filenames on Win32"
This reverts commit ac9514a452.

The new gettid dependency caused other breakage.

Change-Id: I74a75e40c30a45beb275f9dd38eb5c7beac15fbd
2015-11-11 18:01:12 +00:00
Elliott Hughes
332166a31a Merge "adb/base: fix adb push of Unicode filenames on Win32" 2015-11-11 17:10:01 +00:00
Spencer Low
ac9514a452 adb/base: fix adb push of Unicode filenames on Win32
ae5a6c06cd made adb push use
android::base::ReadFileToString() for small files, but that API did not
support UTF-8 filenames on Windows, until this fix which does the
following:

- Add android::base::{WideToUTF8,UTF8ToWide}() which are only available
  on Windows. The signatures are based on Chromium's APIs of the same
  name.

- Add the namespace android::base::utf8 which has versions of APIs that
  take UTF-8 strings. To use this, make sure your code is in a namespace
  and then do "using namespace android::base::utf8;". On Windows, this will
  make calls to open() call android::base::utf8::open(), and on other
  platforms, it will just call the regular ::open().

- Make ReadFileToString() and WriteStringToFile() use utf8::open() and
  utf8::unlink().

- Adapt unittests from Chromium.

- fastboot needs to link with libcutils because it links with libbase
  which depends on libcutils for gettid() for logging.

Change-Id: I1aeac40ff358331d7a1ff457ce894bfb17863904
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-10 15:48:54 -08:00
Christopher Wiley
2f33e0cb17 Merge "libutils: Add UNEXPECTED_NULL status_t" 2015-11-10 22:20:54 +00:00
Calin Juravle
9b3e5d59fe Create a folder to store method traces activated with -Xmethod-trace
Bug: 25612377
Change-Id: I370b858594ccc88c12099b23a0d1aac22acd4969
2015-11-10 21:26:40 +00:00
Bertrand SIMONNET
0a1119f0ce metricsd: Fix logging initialization.
metricsd should only log to a single location (stderr or syslog):
* standard error if --logtostderr is set or metricsd runs in the
  foreground.
* syslog if --logtosyslog is set or metricsd is daemonized.

Bug: 25472752
Change-Id: Idb918714e1b6975d79682f22495a7ca708d4d97d
2015-11-10 11:50:41 -08:00
Elliott Hughes
3c540aec24 Merge "Add -e to the adb shell documentation." 2015-11-10 19:25:14 +00:00
Christopher Wiley
c3441e69c0 libutils: Add UNEXPECTED_NULL status_t
We use this specifically in situations where we expect to read
an object from a Parcel, but fail because the object is null.

Bug: 25617251

Change-Id: Id0b6118b19a932998b5028e30dc15d70e4d7f9c3
2015-11-10 11:12:43 -08:00
Elliott Hughes
0e42c2a4ad Add -e to the adb shell documentation.
Change-Id: I7be5d198ef174e969bbb670e629369894c7b0994
2015-11-10 10:54:44 -08:00
Elliott Hughes
d75b6b9257 Merge "libpixelflinger: MIPS64r6 bug fix" 2015-11-10 15:48:46 +00:00
Ljubomir Papuga
4edb4584a6 libpixelflinger: MIPS64r6 bug fix
This commit fixes MIPS64r6 bootanimation crash.

Change-Id: If7ca817ee2beaf92bb8052602cc759bb4a609419
2015-11-10 14:24:11 +01:00
Josh Gao
0bb1ce06ea Merge "adb: don't try to pull character or block devices." 2015-11-10 02:22:47 +00:00
Josh Gao
8d00a39eff adb: don't try to pull character or block devices.
Change-Id: I1a9e2c0097fe9c4017a9b338e812366c8e1154f0
2015-11-09 18:12:10 -08:00
Josh Gao
5a08fd35c9 Merge "adb: demote skipping a file from an error to a warning." 2015-11-10 02:02:41 +00:00
Josh Gao
21abf5a7c1 adb: demote skipping a file from an error to a warning.
Change-Id: If6c88e8855369bd7feb570ac5310fc7f44994083
2015-11-09 17:47:56 -08:00
Elliott Hughes
79964cdf86 Merge "Fix adb shell escape handling." 2015-11-10 01:06:58 +00:00
Tom Cherry
48f2e1ed31 Merge "Fix isValid() condition for libsync tests" 2015-11-09 22:27:56 +00:00
Elliott Hughes
28416d6d33 Fix adb shell escape handling.
Start of input is, by definition, the start of a line. Give the states
names to make the error clearer. We should also swallow the escape
character until/unless it's proven not to have been part of an escape
sequence. Finally, implement an ssh(1)-like -e option so the user can
choose -- or, more importantly, disable -- escape character handling.

Change-Id: I28a91db47e15f3e7de96303c0b9a98d302b9c92e
2015-11-09 13:57:47 -08:00
Nick Kralevich
2d8f1d4c47 Merge "Enable hidepid=2 on /proc" 2015-11-09 20:05:22 +00:00
Elliott Hughes
892f0e9300 Merge "adb/base: minor compiler portability improvements" 2015-11-09 18:22:42 +00:00
Spencer Low
363af568b8 adb/base: minor compiler portability improvements
I've been using these changes to compile with Visual Studio.

- GetFileBasename(): __FILE__ uses \ with Visual Studio.

- adb_trace.cpp: Apparently VS needs an ampersand before the function name.

- "expr1 ? : expr2" is a GCC extension.

- <algorithm> contains std::min().

- seekdir can't always be #define'd because some headers have members
  named seekdir.

- adb_utils.cpp: Not really a compiler issue, just a random fix:
  0x7F/DEL is not printable.

Change-Id: I0dfb634f1ba4ccbc0d1b9f71b00e838fbebb3b41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-11-09 10:22:13 -08:00
Rom Lemarchand
24e3b8d091 Merge "init: skip "name" DT entry" 2015-11-09 17:35:09 +00:00
Nick Kralevich
c39ba5ae32 Enable hidepid=2 on /proc
Add the following mount options to the /proc filesystem:

  hidepid=2,gid=3009

This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).

Please see
  https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.

hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.

Add AID_READPROC to processes which need to access /proc entries for
other UIDs.

Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
2015-11-09 09:08:46 -08:00
Rom Lemarchand
1dcf325844 init: skip "name" DT entry
DTs have a standard "name" entry which is not to be
turned into an android property, so skip it.

Change-Id: I79f6638b4123358c8d80510c1666cf5d4561160e
2015-11-08 17:51:50 -08:00
Elliott Hughes
54b5e85373 Merge "AOSP master doesn't have "cmd"." 2015-11-07 17:05:12 +00:00