Commit graph

11417 commits

Author SHA1 Message Date
Elliott Hughes
e44d25d645 Merge "Add Google-style StringPrintf." 2015-02-03 23:23:11 +00:00
Elliott Hughes
6b3be2902d Add Google-style StringPrintf.
Change-Id: If333c28b8ed047346a2dd85e591c4bedbab874cc
2015-02-03 15:21:07 -08:00
Elliott Hughes
d4a6fc5bc2 Merge "Init: Fix Clang unsupported attributes" 2015-02-03 22:51:47 +00:00
Elliott Hughes
9fc43358f7 Merge "Extra Win32 compatibility." 2015-02-03 22:27:42 +00:00
Elliott Hughes
714196d05c Extra Win32 compatibility.
Change-Id: Ibc583aba580f4fc15c243f495ead44b2ce4c6e5e
2015-02-03 14:26:58 -08:00
Elliott Hughes
6c6f39678c Merge "Fix Mac build." 2015-02-03 21:03:45 +00:00
Elliott Hughes
af4885a4a8 Fix Mac build.
I knew I should have created a new library that doesn't build for the
Mac or Windows rather than adding to libutils...

Change-Id: I7c07eaa93affb7e83d4da384f03652c39065562a
2015-02-03 13:02:57 -08:00
Elliott Hughes
6974ba4ed4 Merge "Add Google-style ReadFileToString and WriteStringToFile." 2015-02-03 20:19:08 +00:00
Elliott Hughes
dec12b2b71 Add Google-style ReadFileToString and WriteStringToFile.
Bug: 19217569
Change-Id: I64789d3fa6777ee30a324cdf00fdc275c1230e1b
2015-02-03 12:18:11 -08:00
Elliott Hughes
8457a7f9aa Merge "Remove netcfg's unused options." 2015-02-03 20:01:13 +00:00
Elliott Hughes
187eade127 Remove netcfg's unused options.
Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still
seem to be used.

Change-Id: I9f0b580474258fa648deb5287f98d8ec5533ca6f
2015-02-03 11:59:22 -08:00
Elliott Hughes
2b2b7632f5 Merge "Revert "Remove netcfg's unused options."" 2015-02-03 19:56:43 +00:00
Elliott Hughes
c463025a19 Revert "Remove netcfg's unused options."
This reverts commit f8e83054cb.

Change-Id: Iede772f96ff9008277df433dcbb5f6603de65283
2015-02-03 19:56:35 +00:00
Andreas Gampe
4fd6d50181 Merge "Init: Fix literal" 2015-02-03 19:32:36 +00:00
Andreas Gampe
0ab46c9e2b Init: Fix literal
This is a literal 0 implicitly converted to a NULL.

Change-Id: I0573e85eb0578f938877c4bec79054081c27e661
2015-02-03 11:31:11 -08:00
Andreas Gampe
fe2fb359d6 Init: Fix Clang unsupported attributes
Make attributes conditional on not compiling with Clang.

Change-Id: Ic4e9b382308651c7b1901bfa192b6591672dc5ab
2015-02-03 11:25:26 -08:00
Elliott Hughes
6a728fde77 Merge "Remove netcfg's unused options." 2015-02-03 19:09:27 +00:00
Elliott Hughes
f8e83054cb Remove netcfg's unused options.
Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still
seem to be used.

Change-Id: Iaf499c06b09ffe5e0925339b9cd6e502f3234a86
2015-02-03 11:08:07 -08:00
Elliott Hughes
ef89e8d146 Merge "Revert "Remove netcfg's unused options."" 2015-02-03 19:08:01 +00:00
Elliott Hughes
ca77255c26 Revert "Remove netcfg's unused options."
This reverts commit 24c1885bc1.

Change-Id: Iaae6502e2db90d67b4275faa104cfc6a0abc65c6
2015-02-03 19:07:43 +00:00
Elliott Hughes
67900498cf Merge "Remove netcfg's unused options." 2015-02-03 19:01:21 +00:00
Elliott Hughes
c7a6e489f4 Merge "Trivial cleanup of recent changes." 2015-02-03 16:07:42 +00:00
Elliott Hughes
d3e37d14e7 Trivial cleanup of recent changes.
A typo in the documentation for one, and a couple of signed/unsigned warnings
in the implementation of the other.

Change-Id: I8fb4b7448ac901c543dea7420aabcedf13ec1bd8
2015-02-02 16:43:32 -08:00
Elliott Hughes
b101f8795a Merge "init: Implement 'exec' command." 2015-02-03 00:26:04 +00:00
San Mehat
429721c5c4 init: Implement 'exec' command.
(cherry-pick of d05ab3952ec0e38f33a0e80ce6b9eb45b0064ba4.)

Change-Id: Id6d9bb32e51a0ad090ed8240cc505dc45b57b35d
2015-02-02 16:22:56 -08:00
Elliott Hughes
46adfa69b6 Merge "init: Add support "&&" operator in property triggers" 2015-02-03 00:22:26 +00:00
Badhri Jagan Sridharan
0b41512a2e init: Add support "&&" operator in property triggers
"&&" operator can now be used to test the validity
of two of more properties.

For example:

on property:test.a=1 && property:test.b=1
    setprop test.c 1

The above stub sets the test.c to 1 only when
both test.a=1 and test.b=1

(cherry-pick of 162f7d797c67019a7a3f08c3b0f0ffc91d548ddc.)

Change-Id: I72c19f7aa92231372a416193618ee6c7fd368141
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
2015-02-02 16:21:05 -08:00
Nick Kralevich
a73774e62e Merge "Add O_CLOEXEC to lots of open() calls." 2015-02-02 22:47:21 +00:00
Elliott Hughes
24c1885bc1 Remove netcfg's unused options.
Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still
seem to be used.

Change-Id: Ie0aecf5b18bd854cfb5878b6cfdd7160c9f42526
2015-02-02 14:39:42 -08:00
Nick Kralevich
45a884f85f Add O_CLOEXEC to lots of open() calls.
and other related fixups.

Change-Id: Ia88fb37a07ff6777d00c49800081f5a519c0c78d
2015-02-02 14:37:22 -08:00
Nick Kralevich
520ca3e13a Merge "builtins.c: Don't require file open() for chmod/chown" 2015-02-02 22:03:52 +00:00
Nick Kralevich
bc60954fae builtins.c: Don't require file open() for chmod/chown
42a9349dc4 modified init's
builtin chmod, chown, and mkdir calls to avoid following
symlinks. This addressed a number of attacks we were seeing
at the time where poorly written init scripts were following
attacker supplied symlinks resulting in rooting vulnerabilities.

To avoid race conditions, the previous implementation only ran
fchown / fchmod on file descriptors opened with open(O_NOFOLLOW).
Unfortunately, unlike the normal "chown" or "chmod" calls, this
requires read or write access to the underlying file. This
isn't ideal, as opening some files may have side effects, or
init may not have permission to open certain files (such as when
SELinux is enabled).

Instead of using open(O_NOFOLLOW) + fchown(), use lchown() instead.
As before, the target of the symlink won't be modified by chown.
This also supports setting the ownership of symlinks.

Instead of using open(O_NOFOLLOW) + fchmod(), use
fchmodat(AT_SYMLINK_NOFOLLOW) instead. As before, the target of the
symlink won't be modified by chmod.

This change will continue to ensure that chown/chmod/mkdir doesn't
follow symlinks, without requiring init to open every file in
read-only or read-write mode.

This change depends on bionic commit I1eba0cdb2c509d9193ceecf28f13118188a3cfa7

Addresses the following mako/occam SELinux denial:

  audit(1422770408.951:6): avc:  denied  { write } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=7207 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file

Change-Id: I14fde956784d65c44e7aa91dd7eea9a004df3081
2015-02-02 13:45:21 -08:00
Elliott Hughes
88342c99a1 Merge "The bsddroid project has been dead since 2010." 2015-02-02 19:29:23 +00:00
Dmitriy Ivanov
7cb19579bc Merge "Add close_file flag to OpenArchiveFd()" 2015-02-02 18:48:29 +00:00
Elliott Hughes
506aea4361 The bsddroid project has been dead since 2010.
And even if it wasn't, they should probably keep this stuff in their own
repository.

Change-Id: If9fa2e47ee2700098d8a99f6986f7e89fc6dfdf3
2015-01-31 11:24:14 -08:00
Nick Kralevich
d07555dba0 Merge "ensure /data/tombstones exists on all Android devices" 2015-01-31 02:06:46 +00:00
Dmitriy Ivanov
40b52b2c88 Add close_file flag to OpenArchiveFd()
* We should be able to keep fd alive after CloseArchive()

Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-01-30 17:57:13 -08:00
Nick Kralevich
0359d778a5 ensure /data/tombstones exists on all Android devices
/data/tombstones is referenced by core platform code, but is not
guaranteed to exist on all Android devices. Move the directory
creation out of device specific files and into the core
init.rc file.

Bug: https://code.google.com/p/android/issues/detail?id=93207
Change-Id: I94ae5199a6a32c4fe555ca994fc4a8345e0c9690
2015-01-30 17:38:06 -08:00
Elliott Hughes
6b1d86322e Merge "Add missing includes." 2015-01-30 06:24:20 +00:00
Elliott Hughes
3d74d7a739 Add missing includes.
Change-Id: Iaa130c0a7eb2cbc0c8486546e5b622661b6d9e23
2015-01-29 21:31:23 -08:00
Elliott Hughes
0114e1243a Merge "Add ps --ppid." 2015-01-30 04:03:40 +00:00
Elliott Hughes
b5fc3132ee Add ps --ppid.
Needed for a libcore test.

Change-Id: Ia21ecf5f7bd8be7f1882d0014d7949d40f6841a5
2015-01-29 17:20:47 -08:00
Dan Albert
d170bb035d Merge "Remove fastbootd." 2015-01-29 22:48:19 +00:00
Dan Albert
71b99df503 Remove fastbootd.
Change-Id: I23240c7690763f8718c82cb0e8ffdcfa58d02629
2015-01-29 10:37:25 -08:00
Paul Lawrence
07dcb12e3e Merge changes If22008be,Id0049ce6
* changes:
  Make encryption configurable
  Provide a way to select force encryption from vendor partition
2015-01-28 21:14:09 +00:00
Elliott Hughes
06b4e9826a Merge "Add missing <malloc.h> and <string.h> includes." 2015-01-28 19:46:59 +00:00
Paul Lawrence
36d0eaecd7 Make encryption configurable
Delay mounting encryptable but unencrypted volumes until we can
check the ro.vold.forceencrypt flag, then optionally encrypt.

Requires matching vold change from
    https://googleplex-android-review.git.corp.google.com/#/c/615309/

Bug: 18764230
Change-Id: If22008be8de6a4f3216b349f81ace49be1730314
2015-01-28 11:41:53 -08:00
Paul Lawrence
2f7ee6b7dd Provide a way to select force encryption from vendor partition
This allows a vendor to force encryption on devices via a vendor
partition flag:

ro.vold.forceencryption 1

Bug: 18764230
Change-Id: Id0049ce64e34e4f6f96e593aadd70c277ac131c8
2015-01-28 11:41:35 -08:00
Elliott Hughes
a744b05984 Add missing <malloc.h> and <string.h> includes.
Change-Id: Ia41756e607663d056e7d2fdd7ecbec7e5841a913
2015-01-28 11:37:57 -08:00
Sami Tolvanen
9c4c5a6ed9 Merge "Verify token length before adb signs it" 2015-01-28 14:32:52 +00:00