Commit graph

18447 commits

Author SHA1 Message Date
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
Elliott Hughes
79e1c7a7f8 AOSP master doesn't have "cmd".
Change-Id: I0f524b779a623a9e2db923fd9003b102460ae46f
2015-11-06 18:05:16 -08:00
Elliott Hughes
ae2a64e2ba Merge "use new cmd command" 2015-11-07 02:03:31 +00:00
Todd Kennedy
6fa848adba use new cmd command
Instead of using the pm command, 'adb install' and 'adb uninstall' will now
use the cmd command. Additionally, the APK will be streamed directly to
package installer instead of creating a temporary file.

(cherry-pick of d039800a4e008b52c532f901e3bb34b40877cf30.)
Change-Id: Ie7529afa5b039d29cc8183f36085ff4e66b3457a
2015-11-06 18:00:05 -08:00
Josh Gao
7fc45c3326 Merge "adb: pull empty directories." 2015-11-07 00:53:03 +00:00
Josh Gao
8c2fb1f3de Merge "adb: remove superfluous checks." 2015-11-07 00:52:12 +00:00
Josh Gao
a837df8590 adb: remove superfluous checks.
Change-Id: I4d9ceb301b0d242b0bad9a0faa8e2a1824f36cca
2015-11-06 15:19:53 -08:00
Josh Gao
6580096c97 adb: pull empty directories.
Pushing empty directories is more troublesome, and probably either
requires changes to the server, or hacky `adb shell mkdir` stuff.

Bug: http://b/25395071
Change-Id: I4db6a993429a56e5c5ca994752418503b6f5d7c4
2015-11-06 15:04:24 -08:00
Bertrand Simonnet
9940a132fb Merge "metricsd: add SendBoolToUMA to metrics interface" 2015-11-06 20:47:58 +00:00
Josh Gao
f00db9d8b8 Merge "adb: add basename_lock to mutex_list.h." 2015-11-06 20:43:49 +00:00
Josh Gao
a239543061 Merge changes Iced6c414,Ie82d51ec
* changes:
  adb: make local_build_list match remote_build_list.
  adb: C++ify more of the push/pull functions.
2015-11-06 20:22:24 +00:00
Josh Gao
250107e9f7 adb: add basename_lock to mutex_list.h.
Fixes crash on Windows.

Change-Id: Ic87d8ff30a2e824b6012e7e94b8d83442e17d000
2015-11-06 12:19:23 -08:00
Nathan Bullock
adc1c23537 metricsd: add SendBoolToUMA to metrics interface
Bug: 25561571
Change-Id: I698d2408e2f462865f6512b7be17ff0851a1f97c
2015-11-06 14:45:49 -05:00
Mark Salyzyn
588b399eb1 Merge "packagelistparser: rename to libpackagelistparser" 2015-11-06 18:14:52 +00:00
Elliott Hughes
8bc7a4d443 Merge "Revert "Revert "Add MIPS64r6 support for libpixelflinger""" 2015-11-06 15:35:27 +00:00
Elliott Hughes
606d4aecfb Revert "Revert "Add MIPS64r6 support for libpixelflinger""
This reverts commit 7fd121788a.

Change-Id: Ic1204a8407c235b07c643764d5f2800631fecd72
2015-11-06 16:02:25 +01:00
Daniel Rosenberg
f8e70a3a60 Merge "Fastboot changes to support A/B partitioning" 2015-11-06 03:43:49 +00:00
Daniel Rosenberg
b7bd4ae529 Fastboot changes to support A/B partitioning
Introduce support for -slot option for specifying slots,
and set_active, for changing the current slot.
Change-Id: Ib3b2a75491c0d0413534dd0c1d7bcb52555bba66
2015-11-05 18:07:46 -08:00
Christopher Ferris
fa5fbae27f Merge "Fix bug in writing zips." 2015-11-05 21:03:09 +00:00
William Roberts
f420ff1ca7 packagelistparser: rename to libpackagelistparser
When packagelistparser was moved from frameworks/base/libs to system/core it
was never renamed in-line with things in system/core. Libs start with lib,
executables or subdirs do not.

For example, libusb versus logwrapper show the lib versus executable naming
split.

Change-Id: Ia1ed404347927ecfc2d037c83b2fe2a68b3966ba
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-11-05 12:12:38 -08:00
Dan Albert
0f61f86870 Merge "Use std::unique_ptr instead of UniquePtr." 2015-11-05 19:32:28 +00:00
Dan Albert
fe8213f0dd Merge "[gatekeeperd] copy uid to local before passing to u_map" 2015-11-05 19:19:26 +00:00
Andres Morales
70309ff8c7 [gatekeeperd] copy uid to local before passing to u_map
The compiler will issue the unaligned access instuctions
when reading from a packed struct. Since 'find' takes a
reference, if we pass the field directly it is removed
from its packed context and may be unreadable.

Read the field out directly from the packed struct and pass
in aligned to u_map to fix.

Bug: 22367550
Change-Id: Ia3b639c7518154ff5a2b7c233b752e154eab9aad
(cherry picked from commit 6e83dc4d325d68b568c841d3e88fda2a93e00663)
2015-11-05 11:09:21 -08:00
Elliott Hughes
c77c1a3f0a Merge "Revert "Add MIPS64r6 support for libpixelflinger"" 2015-11-05 18:55:12 +00:00
Elliott Hughes
7fd121788a Revert "Add MIPS64r6 support for libpixelflinger"
This reverts commit ab5265ebe6.

This broke the mips64 build (which, stupidly, I hadn't tested):

  system/core/libpixelflinger/codeflinger/MIPS64Assembler.h:24:35: fatal error: tinyutils/KeyedVector.h: No such file or directory
   #include "tinyutils/KeyedVector.h"

Change-Id: I4fa1c04e196592fd1ef893a83c75261a55d32290
2015-11-05 18:54:11 +00:00
Christopher Ferris
a2a32b0ec6 Fix bug in writing zips.
The code does not handle an edge case where writing a compressed
image can overflow the avail_out data when doing a flush. Add a
loop to keep writing the data while deflate indicates that it doesn't
have enough space to write out the compressed data during the flush.

Change-Id: I1f1d1646457ed9b67ed24f6582688c300186c23c
2015-11-05 10:48:05 -08:00
Tom Cherry
a7c7bce252 Fix isValid() condition for libsync tests
Upstream modifications in K3.12 to the sw_sync driver set O_CLOEXEC on
the fd's returned by the SW_SYNC_IOC_CREATE_FENCE ioctl, therefore we
check the return of fcntl() for a non-negative value instead of strictly 0.

Change-Id: If4c82750fcc0aa3a57f243fa2a94691e3150e4a4
2015-11-05 10:07:53 -08:00
Elliott Hughes
251f8b69fb Merge "Add MIPS64r6 support for libpixelflinger" 2015-11-05 18:03:18 +00:00
Dan Albert
f2d2509690 Use std::unique_ptr instead of UniquePtr.
Bug: http://b/22403888
Change-Id: I398fa43b8f33c9281d7ff238521d75f1dcb8a5e7
2015-11-05 01:09:22 -08:00
Will Drewry
d3b177ccb5 Merge "Populate BRILLO_CRASH_SERVER from the product config" 2015-11-05 03:37:02 +00:00
Will Drewry
e680f358ec Populate BRILLO_CRASH_SERVER from the product config
Using cfgtree.mk, this change adds support to load the
crash server URL directly from a file in the product tree
during the build.

BUG=25343470
TEST=build image, check in etc for the populated osrelease.d file

Change-Id: I6342a829936809b9553a32be7bc58285c86dd732
2015-11-04 18:48:30 -08:00
Josh Gao
cd7c1ed700 adb: make local_build_list match remote_build_list.
local_build_list previously was returning an int, 0 on success and -1 on
failure, while remote_build_list was returning a bool, true on success
and false on failure.

Change-Id: Iced6c4142e2f843048d81c4e133d6b6dc75a35dd
2015-11-04 17:46:11 -08:00
Josh Gao
d97315731f adb: C++ify more of the push/pull functions.
Change-Id: Ie82d51ecadf5c94f3b138f5b13a17c3b46c61899
2015-11-04 17:46:11 -08:00
Josh Gao
11d18f1491 Merge changes I70c94c4b,Ifd8769ed
* changes:
  adb: make mkdirs/secure_mkdirs do what they say.
  adb: remove use of mkdirs from `adb backup`.
2015-11-05 01:45:22 +00:00
Colin Cross
e0debcf33e Merge "Use exported headers instead of copying" 2015-11-05 01:17:12 +00:00
Colin Cross
7f68acb135 Use exported headers instead of copying
Use LOCAL_C_EXPORT_INCLUDE_DIRS to share exported headers instead of
copying them to $OUT/obj/include.  Fixes make warnings on multiple rules
to copy the headers from the shared and static versions of the library.

Change-Id: Ide68ed604a62c9eb693dc4bca892f1781622ff95
2015-11-04 17:05:24 -08:00
Bertrand Simonnet
900d9df1e5 Merge "metricsd: Collect average cpu usage information." 2015-11-04 23:20:26 +00:00
Josh Gao
45b6fc878a adb: make mkdirs/secure_mkdirs do what they say.
Previously, mkdirs/secure_mkdirs wouldn't create a directory at the
specified path, only the ones above it.

Bug: http://b/25459942
Change-Id: I70c94c4b44d90723cb4a063657fc40e5bcb3b10e
2015-11-04 14:51:23 -08:00
Josh Gao
09c5bbf0fb adb: remove use of mkdirs from adb backup.
`adb backup -f nonexistent/directories/foo <pkg>` shouldn't create the
directory structure if they don't already exist.

Change-Id: Ifd8769ed7ee5e733a6635751ad09b714ab58ea4b
2015-11-04 14:35:43 -08:00
Josh Gao
77cdfbd50c Merge "adb: make adb_basename match the POSIX behavior." 2015-11-04 22:26:32 +00:00
Josh Gao
787f3442cc adb: make adb_basename match the POSIX behavior.
Previously, adb_basename was behaving according to the GNU, POSIX-incompatible
basename, despite POSIX adb_dirname existing alongside it. This patch changes
adb_basename to pass through to the POSIX basename.

Bug: http://b/25456821
Change-Id: I62a4865cccf3b9cdbc112e3e53ff475aa4a23bd9
2015-11-04 14:21:35 -08:00
Elliott Hughes
8660035010 Merge "Fix Mac adb build." 2015-11-04 21:14:19 +00:00
Elliott Hughes
0fbf9618bb Fix Mac adb build.
The Mac doesn't have <termio.h>, and it looks like the canonical place for
struct winsize is <sys/ioctl.h> anyway.

  system/core/adb/commandline.cpp:44:10: fatal error: 'termio.h' file not found
  #include <termio.h>

Bug: http://b/19734542
Change-Id: I3bfbf58cdb9b582f3b7e2c9ef0977613001cd3ac
2015-11-04 13:07:47 -08:00