Commit Graph

4982 Commits

Author SHA1 Message Date
Rom Lemarchand 2c3b2e12c1 Merge "logwrap: Replace sigprocmask with pthread_sigmask" 2013-01-29 00:13:25 +00:00
Rom Lemarchand 665118f502 Merge "logwrap: wait for child process when receiving SIGINT or SIGQUIT" 2013-01-29 00:12:11 +00:00
Rom Lemarchand ed179d2f98 logwrap: Replace sigprocmask with pthread_sigmask
sigprocmask has undefined behavior when called from a thread.
Replacing with pthread_sigmask to ensure correct behavior if
logwrap() gets called from a thread.

Change-Id: I77b6959d345eac8d7b90039ed8144ead8c19a00c
2013-01-29 00:05:24 +00:00
Rom Lemarchand 75c289aab9 logwrap: wait for child process when receiving SIGINT or SIGQUIT
- Wait for the child to exit before propagating SIGINT and SIGQUIT
to the parent
- Add ignore_int_quit argument to logwrap() that gives the caller the
option to ignore SIGINT and SIGQUIT while logwrap is running

Change-Id: If5c96cf23094917211310f00aa6aed515f110f5b
2013-01-29 00:04:50 +00:00
Rom Lemarchand 99e1966400 logwrap: ensure child exits with _exit
Always exit the child process with _exit() rather than exit() to ensure none
of the parent's atexit functions get called if the child needs to exit before
calling exec.

Change-Id: I6a75111ef1bb3468c114c98743565471cf82c9dd
2013-01-28 15:44:24 -08:00
Benoit Goby 83dee8e4e5 Merge "adb: Read secure adb keys on every auth request" 2013-01-28 23:33:28 +00:00
Rom Lemarchand 078ca5e30d Merge "logwrap: remove unnecessary call to setuid/setgid" 2013-01-28 23:23:53 +00:00
Rom Lemarchand e74313baf8 Merge "logwrap: fix off by 1 argument error" 2013-01-28 23:23:40 +00:00
Rom Lemarchand 45509f9fdd Merge "logwrapper: switch to signal handlers for SIGCHLD" 2013-01-28 23:22:55 +00:00
Nick Kralevich d11fb12019 Merge "property_service: make /dev/__properties__ readable" 2013-01-28 22:50:52 +00:00
Rom Lemarchand cfb5ec3c28 logwrap: remove unnecessary call to setuid/setgid
Android allows all users to write to log.
The setuid/setgid call is unneeded and could cause unintended
side effects when called from daemons or programs that need
to run as root.

Change-Id: I3bdb26eaa4363ef037615e45a1a5cb1ceb4088f3
2013-01-28 13:12:37 -08:00
Rom Lemarchand 611f5b4b93 logwrap: fix off by 1 argument error
Fix off by 1 argument parsing error in liblogwrap.

Change-Id: I79832ae338a71c445f9f616d780c577826874386
2013-01-28 13:11:32 -08:00
Rom Lemarchand 0cc2cab6af logwrapper: switch to signal handlers for SIGCHLD
Switch to a signal handler to monitor SIGCHLD.
Also, clean up the exit path and log a warning when the
previous SIGCHLD sigaction is not default or ignore.

Change-Id: I7ef7daabee18d80e9e82fba3943cf1d03b504ae3
2013-01-28 13:08:04 -08:00
Colin Cross fa341f5b66 Merge commit '35d5b7e6' into master 2013-01-23 21:20:23 -08:00
Colin Cross c86396eba2 am 5fc4fdc6: am 2447afdb: Merge "fastboot: use better exported api from libext4_utils"
# Via Android Git Automerger (1) and others
* commit '5fc4fdc6a06cfa151d29f751d9d9beb8cb781a6a':
  fastboot: use better exported api from libext4_utils
2013-01-23 20:52:29 -08:00
Colin Cross 35d5b7e624 am 61ae5dfd: Merge "fastboot: add errno.h to fix windows build"
# Via Colin Cross (1) and Gerrit Code Review (1)
* commit '61ae5dfda0ddf74b5f05446aa1f76f3aa1917202':
  fastboot: add errno.h to fix windows build
2013-01-23 19:50:02 -08:00
Colin Cross 61ae5dfda0 Merge "fastboot: add errno.h to fix windows build" 2013-01-24 03:19:32 +00:00
Colin Cross 81c632e4da fastboot: add errno.h to fix windows build
The removal of extra headers from ext4_utils.h removed an indirect
include of errno.h that breaks building with USE_MINGW=1.

Change-Id: Ic8448db97b5c056a139dc836e1d6f3aaafb917c9
2013-01-23 19:13:43 -08:00
Colin Cross 5fc4fdc6a0 am 2447afdb: Merge "fastboot: use better exported api from libext4_utils"
# Via Colin Cross (1) and Gerrit Code Review (1)
* commit '2447afdb9ee2607b932805bd2efd8006242f4d62':
  fastboot: use better exported api from libext4_utils
2013-01-23 17:35:20 -08:00
Colin Cross 2447afdb9e Merge "fastboot: use better exported api from libext4_utils" 2013-01-24 00:55:08 +00:00
Colin Cross 2aaf5e84f0 fastboot: use better exported api from libext4_utils
Switch fastboot to use an exported api from libext4_utils that
will change less often, and remove some of the implementation
details from fastboot.

Change-Id: I85a10c8f58abe8093d0c781e1a0e100c348ef0d9
2013-01-23 15:43:41 -08:00
Nick Kralevich 7ece0a862c property_service: make /dev/__properties__ readable
Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Make the /dev/__properties__ file accessible, so an app can
get properties directly from the file, rather than relying on
environment variables.

Preserve the environment variable for compatibility with pre-existing
apps.

Bug: 8045561
Change-Id: If81e2b705eca43ddd8b491871aceff59c0e00387
2013-01-23 09:30:17 -08:00
Dmitry Shmidt 4db7df71da toolbox: renice: Add -t TYPE parameter and switch to getopt
Change-Id: Idaedabe1505a9c373629ef1fd31aa4b4beb068c2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-01-22 16:59:36 -08:00
Nick Kralevich 2840647b15 Revert "init: make system properties more secure."
This reverts commit 51e06618db.

Bug: 8045561
2013-01-22 12:46:09 -08:00
David Turner 5bf8a4200c am 3dbcb6d6: am 98d07897: Merge "Windows adb: Make client stdout and stderr handles uninheritable"
* commit '3dbcb6d6c6befc406e4ce4e2b7aa9ad2635dfbb8':
  Windows adb: Make client stdout and stderr handles uninheritable
2013-01-21 02:56:36 -08:00
David Turner 3dbcb6d6c6 am 98d07897: Merge "Windows adb: Make client stdout and stderr handles uninheritable"
* commit '98d0789772b94b9b0c2aecfab74dc1a9283a91b1':
  Windows adb: Make client stdout and stderr handles uninheritable
2013-01-21 02:51:40 -08:00
David Turner 98d0789772 Merge "Windows adb: Make client stdout and stderr handles uninheritable" 2013-01-21 10:16:54 +00:00
Nick Kralevich 51e06618db init: make system properties more secure.
Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Modify system property handling so that we get the properties
from a root owned properties file, rather than using an
environment variable.

Related to bug: 8029617

Change-Id: I18610128e11c4037ed6f4dec6eba20f69fa647eb
2013-01-18 14:31:19 -08:00
Benoit Goby 345cb066d2 adb: Read secure adb keys on every auth request
The framework can now clear the user key list, so we need to reload the
key list on every auth request instead of loading it once when adbd
starts.
This also fixes issues with encrypted devices, where the user key file
is only readable after the user has unlocked the device.

Change-Id: I350c5aab986f8ca86b95f316398d03012553e581
2013-01-15 17:16:22 -08:00
Elliott Hughes d984497a88 am 989c033b: am 026b3953: Merge "The localtime_tz and mktime_tz extensions are now in bionic."
* commit '989c033bf3de0e81fbb9f4aad2a52d6e17093d8c':
  The localtime_tz and mktime_tz extensions are now in bionic.
2013-01-15 14:44:16 -08:00
Elliott Hughes 989c033bf3 am 026b3953: Merge "The localtime_tz and mktime_tz extensions are now in bionic."
* commit '026b3953d4471cd43c850ee72bbca7cc77e87a34':
  The localtime_tz and mktime_tz extensions are now in bionic.
2013-01-15 14:33:22 -08:00
Elliott Hughes 026b3953d4 Merge "The localtime_tz and mktime_tz extensions are now in bionic." 2013-01-15 13:21:55 -08:00
Elliott Hughes def8d6a706 The localtime_tz and mktime_tz extensions are now in bionic.
(cherry-pick of d03072ffde. This change
was originally committed to AOSP, is in internal master, but was somehow
lost from AOSP.)

Bug: 7012465

Conflicts:

	libcutils/Android.mk

Change-Id: I08ee8eb9b8ce5d3f9d8f2e67437d653e08697bc1
2013-01-15 11:34:08 -08:00
Rom Lemarchand b58a822955 logwrapper: prevent logwrap from hanging when child dies
Sometimes the read on the PTY can wait indefinitely if the child
dies. By using a poll statement that monitors both the output
of the child and its state we prevent this from happening.

Change-Id: I51d5556c66f039bca673145ca72db262977e1689
2013-01-14 11:11:58 -08:00
Rom Lemarchand 1b325d1968 Merge "logwrapper: split into liblogwrap and the executable itself" 2013-01-11 18:58:54 -08:00
Robert Greenwalt c93d30f50d Merge "Support 4 dns servers, up from 2" 2013-01-11 15:38:59 -08:00
Rom Lemarchand 113bd47d61 logwrapper: split into liblogwrap and the executable itself
Abstracting the functionality of logwrapper into a library and making
use of it for the logwrapper executable.

Change-Id: I2bcf722413f3a8454c6f52137dec86c4477fb8b5
2013-01-11 13:58:29 -08:00
Alex Ray 60efde774d Merge "cutils: add simple reference counter" 2013-01-11 13:25:34 -08:00
Ying Wang 2c43b55814 resolved conflicts for merge of f62f1e3a to master
Change-Id: I35c66859e2c454c20c8acc6b2b1f0833032205bb
2013-01-10 15:35:05 -08:00
Alex Ray d874cc8bb9 cutils: add simple reference counter
Change-Id: Iefb34abc864cb4ca2da2f1c85c45f89af8c7fe8b
2013-01-10 15:23:55 -08:00
Robert Greenwalt fdd573188d Support 4 dns servers, up from 2
bug:5958524
Change-Id: I61c25e23d21e92653ec9b874d3d456a330d8fe05
2013-01-10 11:36:09 -08:00
Rom Lemarchand 7f213f878d Merge "Revert "Remove -d option from logwrapper"" 2013-01-10 09:42:12 -08:00
JP Abgrall 571c136768 adb: HACK: (linux only) allow temp mitigation for multithreaded issues
There are serious multithreading issues between the fdevent and transport
subsystems which both manipulate struct asocket and struct fde concurrently.
The prevalent symptom being around multiple socket closures which stomp
 on each other, typically causing:
   "glibc detected *** adb: double free or corruption ..."

This HACK allows forcing CPU affinity via an env var. E.g.:
  export ADB_CPU_AFFINITY_BUG6558362=0
which will cause ONLY the adb server and all its threads to be pegged
to CPU 0.

The result is visible in valgrind's helgrind: no *socket_close() related
data races. But tons of other races are still there.

Bug: 6558362
Change-Id: I0f112390a6a921c64b2a783297be9e99ce27fd56
2013-01-09 15:34:21 -08:00
Ray Donnelly 267aa8b00e Windows adb: Make client stdout and stderr handles uninheritable
Change-Id: Ib0519a199c9504aad1d0ecc3757f4d162984bf22
2013-01-08 23:02:28 +00:00
Ying Wang f62f1e3a07 am ef2ea99b: Merge "Correct LOCAL_LDLIBS of adb"
* commit 'ef2ea99bfe1e19c451882c3c8eb19368d0087ff6':
  Correct LOCAL_LDLIBS of adb
2013-01-08 15:00:41 -08:00
Ying Wang ef2ea99bfe Merge "Correct LOCAL_LDLIBS of adb" 2013-01-08 13:56:07 -08:00
Alex Ray 9067dd3aef Merge "cutils: bitops: add include for bool" 2013-01-07 17:04:20 -08:00
Alex Ray 81ec96df4f cutils: bitops: add include for bool
Change-Id: I3eca5a7c1f5ec66ded1229ccb6ca1dbb5d608ffd
2013-01-07 16:58:01 -08:00
Alex Ray b65bea46ad Merge "cutils: Add bitmask utilities to bitops" 2013-01-07 16:38:50 -08:00
Alex Ray 2111bc7b28 cutils: Add bitmask utilities to bitops
Bitmask utils handle resource tracking using a (multi-word) bitmask.

Change-Id: I2ae45df1ac8c665c29ea9cae32a757168686b96c
2013-01-07 13:02:28 -08:00