Commit graph

12760 commits

Author SHA1 Message Date
Elliott Hughes
d4196ef887 Merge "Add a command to call libnetutils' do_dhcp." 2015-04-22 02:50:13 +00:00
Elliott Hughes
dc3b459ff9 Add missing null checks after allocations.
Bug: http://b/20317729
Change-Id: I62bb761d48ee59a1f4ddd0cdd0632432305ca2ca
2015-04-21 19:43:22 -07:00
Elliott Hughes
9ab372eb22 Add a command to call libnetutils' do_dhcp.
Useful for wifi bringup.

Change-Id: Ib1d1b1d15cb9ce57119457a780e169b8f98987c2
2015-04-21 19:31:43 -07:00
Elliott Hughes
0fb33b3c05 Merge "Plumb more of the error reporting through." 2015-04-22 01:20:36 +00:00
Elliott Hughes
1555147bc4 Plumb more of the error reporting through.
This doesn't fix the bug, but it does flatten the bug to the well-known
and long-standing "adb shell" doesn't return exit statuses, so when we
fix that, this one will fix itself.

Bug: http://b/20423886
Change-Id: I48351e46f05dd3f2f6e57f0df1d851333458d0ef
2015-04-21 17:58:55 -07:00
Elliott Hughes
9a0cea92c8 Merge "Add a couple more adb shell regression tests." 2015-04-21 23:35:06 +00:00
Elliott Hughes
8e6edc0d89 Add a couple more adb shell regression tests.
Bug: http://b/15479704
Change-Id: Id3e7f0df101ad61db509df313c13210a8bd8b124
2015-04-21 16:25:54 -07:00
Michael Wright
a75b3de2c2 Merge "Mark time conversion functions as constexpr" 2015-04-21 21:50:28 +00:00
Mark Salyzyn
088c4f3b8a Merge "logd: Statistics headers" 2015-04-21 20:13:15 +00:00
Badhri Jagan Sridharan
82b0f7ba92 Merge "adb: set sys.usb.ffs.ready to signal usb pullup" 2015-04-21 19:58:46 +00:00
Elliott Hughes
da60a30b86 Merge "Add a test for shell escaping." 2015-04-21 19:48:06 +00:00
Badhri Jagan Sridharan
5f97370bab adb: set sys.usb.ffs.ready to signal usb pullup
This change sets sys.usb.ffs.ready to 1 to
trigger configfs based enumeration.

Change-Id: I222495fc667cce59675579069d164b0b484f3653
2015-04-21 12:44:31 -07:00
Elliott Hughes
9f2944aab0 Merge "Remove dead code." 2015-04-21 19:34:34 +00:00
Elliott Hughes
d5ff3e9449 Remove dead code.
We weren't even building this.

Change-Id: I8b2afbc76d784a7b24bbe0be6502b9fbcf0b5c09
2015-04-21 12:24:50 -07:00
Elliott Hughes
0053bb3f1a Add a test for shell escaping.
Until I fixed this, we would fail this example:

  $ adb shell sh -c 'echo hello; echo world'
  hello
  /system/bin/sh:  echo world: not found

Bug: http://b/19734868
Change-Id: I11a437cd0c0362303028f23fbaa103611b75707e
2015-04-21 12:15:31 -07:00
Mark Salyzyn
81b3eabc49 logd: class hierarcy for Uid and Pid statistics.
Add EntryBase and EntryBaseDropped base classes for statistical
entries to inherit from. Abstract add(), subtract() and drop()
methods to common LogBufferElement in each for entry policy decisions.
Some move of details out of LogStatistics.cpp and place them into
LogStatistics.h. Add statistical add(), subtract() and
drop() methods to hash table to call entries for policy.

Bug: 19608965
Change-Id: Ib8a33a8fe28871ef165d1632c6546a5c606231e8
2015-04-21 10:54:34 -07:00
Mark Salyzyn
5720d2c168 logd: Statistics headers
Answer to the question "Bytes or Lines?"

Change-Id: I352737265aeac63ea8d89e778d4222a9123bdf07
2015-04-21 10:54:34 -07:00
Elliott Hughes
6a2d5a34e8 Merge "Fix "adb sync" for devices without vendor and oem." 2015-04-21 17:53:08 +00:00
Elliott Hughes
d236d071b9 Fix "adb sync" for devices without vendor and oem.
Bug: http://b/20440110
Change-Id: I2481992198890f5ca50412c2b7ca361101961413
2015-04-21 10:17:07 -07:00
Elliott Hughes
e434ad1dd7 Merge "Always explain why bind(2) failed." 2015-04-21 16:52:21 +00:00
Elliott Hughes
14b65736c5 Merge "Use ' quoting to escape arguments." 2015-04-21 16:47:43 +00:00
Elliott Hughes
eb7d308a37 Merge "Remove a declaration for an unimplemented function." 2015-04-21 04:43:06 +00:00
Elliott Hughes
e886ba9c4e Remove a declaration for an unimplemented function.
Change-Id: I890cef52e9a8c26d98f227f269a7dcfcb6eaa795
2015-04-20 20:55:43 -07:00
Mark Salyzyn
76ed92c3c6 Merge "logd: better drop message merging" 2015-04-20 21:09:10 +00:00
Colin Cross
631cf14627 Merge "Fix windows adb build" 2015-04-20 20:09:51 +00:00
Mark Salyzyn
2c9d909a00 logd: better drop message merging
- Former algorithm anlo coalesced adjacent records
- New algorithm maintains a hash list of all drop
  records and coalesces them all.

Bug: 20334069
Bug: 20370119
Change-Id: Idc15ce31fc1087c2cfa39da60c62feade8b88761
2015-04-20 12:58:54 -07:00
Colin Cross
dc1e482b20 Fix windows adb build
libc++ is not available on windows yet, but it already defaults to
static libstdc++.

Change-Id: I85a766ead84f71fe1f2f59be6ac739b0b833b6db
2015-04-20 12:43:02 -07:00
Colin Cross
b2b06de5fc Merge "statically link adb and fastboot against libc++" 2015-04-20 18:05:29 +00:00
Richard Uhler
587fb6a091 Fix typos in comments
Change-Id: Ia06ae6bec66e140fb302c650f7d62304864ca840
2015-04-20 10:10:33 -07:00
Nick Kralevich
63fba52c2c Merge "create /data/misc/gatekeeper" 2015-04-20 16:01:07 +00:00
Mark Salyzyn
5c39e0ada8 rootfs: init.rc start logd parse error
init: /init.rc: 490: invalid option 'start'

Change-Id: Ica985e45d4652dab0ebd434803344f14cc73d834
2015-04-20 15:56:14 +00:00
Nick Kralevich
1450586ffd create /data/misc/gatekeeper
Change-Id: I7631401ac21b60a22f6fd4052814186bf3bc2b05
2015-04-20 08:55:12 -07:00
Elliott Hughes
7b506090e1 Always explain why bind(2) failed.
This has confused several people lately.

Bug: http://b/20219978
Change-Id: I2537ceb83bff0b3166c230c728d4389a983db858
2015-04-20 08:09:20 -07:00
Michael Wright
65e93c3b6f Mark time conversion functions as constexpr
Change-Id: I753c6975a8e1d78978c31175b2e1868eb374c442
2015-04-20 15:06:01 +01:00
Narayan Kamath
4d0cb5e806 Merge "Reserve space on disk using fallocate" 2015-04-20 09:49:36 +00:00
Łukasz Szymczyk
e1d5a6aa5c Reserve space on disk using fallocate
There were crashes when android failed to extract
zip archives due to out of free space on disk, with stacks like:

  #00 pc 00000000000156b0 /system/lib64/libc.so (memcpy+176)
  #01 pc 000000000002e5b8 /system/lib64/libandroidfw.so
  #02 pc 000000000002f488 /system/lib64/libandroidfw.so (ExtractToMemory+328)
  #03 pc 000000000002f5c8 /system/lib64/libandroidfw.so (ExtractEntryToFile+268)
  #04 pc 00000000000287d8 /system/lib64/libandroidfw.so (android::ZipFileRO::\
  uncompressEntry(void*, int) const+12)

Space for the file is now allocated using fallocate rather than
ftruncate, since ftruncate dont actually reserve space on disk. When writes
to the mmaped pointer fails to be realized due to out of space SIGBUS
is the result. With this change we make sure that there is space available
before mmaping the pointer.

Change-Id: Ic5e8c33dbe729edb57919dacff73811b34cc2dc2
2015-04-20 09:49:26 +00:00
Elliott Hughes
34c91eddb0 Merge "Fix the Windows adb build." 2015-04-19 20:30:26 +00:00
Elliott Hughes
53daee6a2b Fix the Windows adb build.
It looks like we can't use clang on Windows yet because libc++ isn't ready.
So move back to GCC for the Windows host clang. Work around the mingw
printf format string problems that made us want to switch to clang in the
first place, and #include "sysdeps.h" in adb_utils.cpp to work around the
absence of lstat(2) on Windows.

Change-Id: Icd0797a8c0c2d1d326bdd704ba6bcafcbaeb742f
2015-04-19 13:17:01 -07:00
Johan Redestig
4f673306fc Setup signal handler before any exec command
Fixes init deadlock when an exec command was called
in an on-init section.

The exec command handling relies on that the signal handler
mechanism is working to know when to continue executing
commands.

Change-Id: Ib0ce75ffad7cf3bf926c93d0506b2fe3e5a92630
2015-04-18 14:18:25 +02:00
Elliott Hughes
5498adefb0 Use ' quoting to escape arguments.
The specific motivating case is "text;ls;1.apk", but rather than continue
adding individual characters to the list of characters to be escaped, let's
just switch to quote all arguments with ', which only leaves ' itself to be
escaped.

Bug: 20323053
Bug: 19734868
Change-Id: I8bd71db9373bc2d1169fc11e46c889da6638550a
2015-04-17 20:55:04 -07:00
Elliott Hughes
623aa1c47a Merge "Use escape_arg in "adb backup"." 2015-04-18 03:37:14 +00:00
Elliott Hughes
6c34bbaa68 Use escape_arg in "adb backup".
This doesn't fix the injection vulnerability, but it makes "adb backup"
no worse than the other commands, and lets me fix them all at once.

Bug: 20323053
Change-Id: I39843c065d9d738b6b7943b2ffd660e4a031cc36
2015-04-17 20:30:09 -07:00
Elliott Hughes
81fa3039fa Merge "Remove yet more fixed-length buffers (and their overruns)." 2015-04-18 01:03:14 +00:00
Elliott Hughes
a7090b94c1 Remove yet more fixed-length buffers (and their overruns).
Bug: 20317724
Change-Id: If137fc96f5f23576ccecd388ac87afefa47337c6
2015-04-17 17:58:35 -07:00
Elliott Hughes
340e62f05e Merge "Fix comment typo." 2015-04-18 00:17:34 +00:00
Elliott Hughes
1daf86aa20 Fix comment typo.
Change-Id: I2d7082c44123e90d74b2669ab29d787b9aa64863
2015-04-17 17:08:16 -07:00
Elliott Hughes
8d2abbea76 Merge "Switch adb over to clang." 2015-04-17 22:42:36 +00:00
Elliott Hughes
2083fa6b01 Switch adb over to clang.
Change-Id: Ib5511dcba56e80ffce6bc293d99251ccfd61c330
2015-04-17 15:27:13 -07:00
Elliott Hughes
61a004c05f Merge "Fix more buffer overruns." 2015-04-17 22:24:27 +00:00
Elliott Hughes
5830577bd8 Fix more buffer overruns.
Also add some tests.

Bug: 20323050
Change-Id: I9eaf3dc04efd85206663c4cca4f8c1208620a89a
2015-04-17 15:23:31 -07:00