chromiumos/platform/libchromeos.git
15 months agolibchromes: remove '-Wl,-z,defs' when asan enabled. 37/65737/4 master
Yunlian Jiang [Wed, 14 Aug 2013 16:32:44 +0000 (09:32 -0700)]
libchromes: remove '-Wl,-z,defs' when asan enabled.

This removes the '-Wl,-z,defs' from link command line when
asan is enabled to make the asan build pass.
This is the same issue as
https://code.google.com/p/address-sanitizer/issues/detail?id=111
BUG=None
TEST=libchromes build successfully with asan.
Change-Id: Ic59a0e115fa5d9751ba7ff3e71b1fb93b0e25912
Reviewed-on: https://gerrit.chromium.org/gerrit/65737
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>

18 months agoAdd libchromeos/libpolicy GYP file 86/38286/36 factory-4290.B factory-4455.B factory-pit-4280.B factory-pit-4390.B factory-pit-4471.B factory-spring-4262.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B release-R29-4319.B release-R30-4537.B stabilize-4255.B stabilize-4287.B stabilize-4443.B stabilize-4512.B
Liam McLoughlin [Mon, 4 Mar 2013 23:09:53 +0000 (18:09 -0500)]
Add libchromeos/libpolicy GYP file

BUG=chromium:220003
TEST=Run emerge-<board> -v platform2 with and without platform2 USE
flag on a range of boards plus the host

Change-Id: I65a1fc8738070f7d8aa9b47e146b3f5860a0c7fd
Reviewed-on: https://gerrit.chromium.org/gerrit/38286
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
18 months agoProcessImpl: fix uid/gid checks 13/56113/2
Mike Frysinger [Tue, 21 May 2013 22:51:41 +0000 (18:51 -0400)]
ProcessImpl: fix uid/gid checks

The code sets the initial uid/gid to -1 and then does uid_t>=0 to see if
the caller has initialized things.  The issue is that uid_t/gid_t are not
signed, so the >=0 check always returns true.

Instead, check against the explicit default value (-1) so that gcc will
cast them up to the same values.

Building the code warned us about this too:
chromeos/process.cc:188:14: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
    if (gid_ >= 0 && setresgid(gid_, gid_, gid_) < 0) {
        ~~~~ ^  ~
chromeos/process.cc:193:14: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
    if (uid_ >= 0 && setresuid(uid_, uid_, uid_) < 0) {
        ~~~~ ^  ~

BUG=None
TEST=`cros_run_unit_tests --board=x86-alex -p libchromeos` passes

Change-Id: I8b90744b289e0fe3131aec0451222070aa9c592f
Reviewed-on: https://gerrit.chromium.org/gerrit/56113
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agocryptohome: add GetHashedUserPath() helper 12/56112/2
Mike Frysinger [Tue, 21 May 2013 22:49:49 +0000 (18:49 -0400)]
cryptohome: add GetHashedUserPath() helper

When you already have a hashed copy of the username, we don't want to
use GetUserPath() as that will hash the username a second time.  Add
a helper where we can pash in the hashed value and bypass things.

BUG=chromium:221778
TEST=`cros_run_unit_tests --board=x86-alex -p libchromeos` passes

Change-Id: I16a04ff1e9cf145eb974438a5e0477d8b30e3c4b
Reviewed-on: https://gerrit.chromium.org/gerrit/56112
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agoExpose newly added HTTP-based downloads AU policy via libchromeos 35/51235/3
Jay Srinivasan [Wed, 15 May 2013 01:11:14 +0000 (18:11 -0700)]
Expose newly added HTTP-based downloads AU policy via libchromeos

BUG=chromium:235562
TEST=Unit tests pass.

Change-Id: I5c03ae887de549fa385b7f994299df645598c781
Reviewed-on: https://gerrit.chromium.org/gerrit/51235
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
18 months ago[libchromeos] grab current cryptohome Platform 72/50172/3 factory-4128.B factory-spring-4131.B release-R28-4100.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainB
Elly Fong-Jones [Mon, 6 May 2013 15:35:21 +0000 (11:35 -0400)]
[libchromeos] grab current cryptohome Platform

cryptohome currently has the most 'complete' Platform, so fault it into here,
then we'll have cryptohome use it. The ecryptfs/keyutils wrappers are stubs that
explode when called to avoid forcing every use of libchromeos to link
libkeyutils and libecryptfs.

TEST=unit,trybot
BUG=chromium:216672

Change-Id: I3121aac23df740fd65eea6d23b70c1939c2d8290
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50172
Reviewed-by: Will Drewry <wad@chromium.org>
18 months agoAdd new session_manager errors appropriate for multiprofile 01/49601/3
Chris Masone [Tue, 30 Apr 2013 04:18:57 +0000 (21:18 -0700)]
Add new session_manager errors appropriate for multiprofile

CHROMEOS_LOGIN_ERROR_POLICY_INIT_FAIL, for when we can't create a
UserPolicyService for a new user.

BUG=chromium:235179
TEST=emerge-amd64-generic libchromeos, check for new constants in installed headers.

Change-Id: If95842ef3866dcc208b1a09d226684817e648873
Reviewed-on: https://gerrit.chromium.org/gerrit/49601
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

18 months agoCoerce username to lowercase before sanitzing. 31/49731/3
Chris Masone [Wed, 1 May 2013 17:29:12 +0000 (10:29 -0700)]
Coerce username to lowercase before sanitzing.

Coercing the username to lowercase before sanitzing ensures that,
no matter what CaPitaliZation the caller uses, the same value
is returned.

BUG=None
TEST=unit tests
TEST=lumpy trybot run.

Change-Id: Id9c68031cc5ac9588847a81f4a68c91a74b8bc26
Reviewed-on: https://gerrit.chromium.org/gerrit/49731
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

18 months agoChange GetGuestUserName() to kGuestUserName 05/49605/2
Chris Masone [Tue, 30 Apr 2013 17:57:32 +0000 (10:57 -0700)]
Change GetGuestUserName() to kGuestUserName

Having a method that takes a string literal and returns a copy as
a std::string seems odd.  We can keep this as a kOnstant,
and reduce copies while also remaining more flexible.

CQ-DEPEND=I5aee09cb66e60ef3b5f8f64bf76d7dd7837dab41

BUG=None
TEST=build libchromeos

Change-Id: Ie070102429856f21e571cc1073e661d6b5b1c5f3
Reviewed-on: https://gerrit.chromium.org/gerrit/49605
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

19 months ago[libchromeos] add GetGuestUserName 37/47637/2 stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B
Elly Fong-Jones [Tue, 9 Apr 2013 13:30:43 +0000 (09:30 -0400)]
[libchromeos] add GetGuestUserName

BUG=chromium:224288
TEST=adhoc
Patch in https://gerrit.chromium.org/gerrit/#/c/47262/ then run cryptohome unit
tests

Change-Id: I5503ec33f5b235e48cc5c78400e2c6d74227e9f1
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47637
Reviewed-by: Will Drewry <wad@chromium.org>
19 months agoRevert "Revert "cryptohome: Make SanitizeUserName() compatible with cryptohome"" 44/47244/3
Elly Jones [Wed, 3 Apr 2013 17:36:32 +0000 (10:36 -0700)]
Revert "Revert "cryptohome: Make SanitizeUserName() compatible with cryptohome""

This reverts commit 6e8f24e5f10aeba2feb9d72a49f276fc0f2ed7de. See
https://gerrit.chromium.org/gerrit/#/c/47061/

Change-Id: I6f01c2a51cecd3b2d5fff0fb54c8d45728fd00a2
Reviewed-on: https://gerrit.chromium.org/gerrit/47244
Commit-Queue: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Elly Jones <ellyjones@chromium.org>
20 months agoRevert "cryptohome: Make SanitizeUserName() compatible with cryptohome" 21/43921/2 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B release-R27-3912.B stabilize-3881.0.B stabilize-3912.79.B toolchainA
Will Drewry [Mon, 25 Feb 2013 20:08:12 +0000 (14:08 -0600)]
Revert "cryptohome: Make SanitizeUserName() compatible with cryptohome"

This reverts commit 6662de05b47125f5d75e03b8ffa8441905c9aafa.
login_manager/device_local_policy_service.cc depends on the hashes, so
this will need to be relanded when migration code is ready.

BUG=chromium-os:38444
TEST=n/a

Signed-off-by: Will Drewry <wad@chromium.org>
Change-Id: Iabd51d743aa439a29c09429ae6f201d0a7d17d5b
Reviewed-on: https://gerrit.chromium.org/gerrit/43921
Reviewed-by: Elly Jones <ellyjones@chromium.org>
20 months agocryptohome: Make SanitizeUserName() compatible with cryptohome 20/42520/2
Will Drewry [Mon, 4 Feb 2013 03:18:28 +0000 (21:18 -0600)]
cryptohome: Make SanitizeUserName() compatible with cryptohome

SanitizeUserName() does not produce strings which are compatible
with cryptohome.  This is a known issue that was supposed
to be resolved before this code went into common use.

This change just downcases the sanitized username to match
cryptohome. This _should_ only impact ephemeral mountpoints in
/home/user and /home/root which should be empty and cleaned up.
(They should be changed to tmpfs mountpoints.)

TEST=emerged, output matches cryptohome (lowercase), TODO still - boot test, BVT run
     Tested that IsSanitizedUserName() returns true for the new lowercase output.
BUG=chromium-os:38444

Change-Id: I8be838106fa9df9e51ac31d9d6fa5887f7203a45
Reviewed-on: https://gerrit.chromium.org/gerrit/42520
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Queue: Will Drewry <wad@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
20 months agocryptohome.h: add Get/SetSystemSalt() 37/42437/2
Will Drewry [Thu, 31 Jan 2013 22:31:16 +0000 (16:31 -0600)]
cryptohome.h: add Get/SetSystemSalt()

The only way to test services which use this library is to use a real system
salt file.  This change avoids ever walking the filesystem dependent code in
when under test.

BUG=chromium-os:38444
TEST=builds and works using a not-yet-posted cryptohome unittest change
     No rush to review this until the c-home changes post.

Change-Id: I2c88fd12753c44f7dbce02665ecb0a4bb40c505b
Signed-off-by: Will Drewry <wad@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42437
Reviewed-by: Kees Cook <keescook@chromium.org>
21 months ago[libchromeos] Update to compile against revved libchrome 03/43103/2 release-R26-3701.B stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B toolchain-3701.42.B
Chris Masone [Tue, 12 Feb 2013 18:18:30 +0000 (10:18 -0800)]
[libchromeos] Update to compile against revved libchrome

A header or two has moved around; update paths.  Also, remove
some conflicting (and unneeded) forward declarations.

Lastly, the logging in ProcessImpl::Wait() didn't correctly extract
the signal number that killed a process, in the event that the process
failed to exit normally.  This seems to have been working OK by
happenstance.  This adds the appropriate macro to extract the signal
number in all cases.

BUG=chromium-os:38805
TEST=build libchromeos and run unittests.

Change-Id: If2fe14b869cf5a7d569d2b927fe612df7ffbd567
Reviewed-on: https://gerrit.chromium.org/gerrit/43103
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

21 months agoRemove the Reload call from the PolicyProvider constructor. 33/42533/3 stabilize-bluetooth-smart
Julian Pastarmov [Mon, 4 Feb 2013 16:01:33 +0000 (17:01 +0100)]
Remove the Reload call from the PolicyProvider constructor.

BUG=chromium-os:38541
TEST=unit tests should still pass.
CQ-DEPEND=I042e9d1cfbefa479ff18c0b1bc170a15cec705bc
CQ-DEPEND=I6ea0c67caf19fd003500f16253262bab2b18ab2b
CQ-DEPEND=I3f9ca593247816534d4f9f87e8a0c7db593b87b5

Change-Id: I20461078ca890c6ec2f81ad5383c06c4d75a64cd
Reviewed-on: https://gerrit.chromium.org/gerrit/42533
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
22 months agoFix libchrome process_test - clear log before testing accumulated log. 06/39906/3 factory-3536.B stabilize-3658.0.0
Han Shen [Tue, 18 Dec 2012 23:11:49 +0000 (15:11 -0800)]
Fix libchrome process_test - clear log before testing accumulated log.

Although it is a reasonable fix, this does not fail during current
build/test circle, it only fails when we are testing new binutils
release.

TEST=all libchrome tests passed
BUG=None

Change-Id: Icf99fffe77c19b57e9d0e83f3c11eeb9566f026a
Reviewed-on: https://gerrit.chromium.org/gerrit/39906
Reviewed-by: Guozhi Wei <carrot@google.com>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Reviewed-by: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@google.com>
Commit-Queue: Han Shen <shenhan@google.com>

2 years agoLoad system salt in SanitizeUserName. release-R25-3428.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize2 toolchain-3428.65.B
Mattias Nissler [Wed, 31 Oct 2012 14:32:24 +0000 (15:32 +0100)]
Load system salt in SanitizeUserName.

External callers of SanitizeUserName shouldn't have to worry about lazy
system salt loading, so make an attempt to load the salt in
SanitizeUserName().

BUG=None
TEST=Compiles and passes tests.

Change-Id: I0a752592a6e8ee5db70800bb8df4262e3739d7f4
Reviewed-on: https://gerrit.chromium.org/gerrit/37013
Reviewed-by: Bartosz Fabianowski <bartfab@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
2 years agoAdded a ScopedArray type for glib GArrays. factory-2993.B factory-3004.B
Darren Krahn [Thu, 4 Oct 2012 21:02:32 +0000 (14:02 -0700)]
Added a ScopedArray type for glib GArrays.

The motivation for this change is the use of GArray by the cryptohome
module.

BUG=chromium-os:34805
TEST=Use ScopedArray in cryptohome and run unit tests and
platform_Attestation autotest.

Change-Id: I3d5b4f7ff7a18300c6f131435576e149308698da
Reviewed-on: https://gerrit.chromium.org/gerrit/34673
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2 years agoMake compiler-generated vtable map variables global.
Caroline Tice [Wed, 26 Sep 2012 20:44:32 +0000 (13:44 -0700)]
Make compiler-generated vtable map variables global.

BUG=none
TEST=emerge-$board libchromeos
./build_image --board=$board test

Change-Id: I0cb65cc8c2071ac97769304df057e7bea9df3a9e
Reviewed-on: https://gerrit.chromium.org/gerrit/34129
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Caroline Tice <cmtice@chromium.org>
Commit-Ready: Caroline Tice <cmtice@chromium.org>

2 years ago[libchromeos] add Platform factory-2985.B
Elly Fong-Jones [Tue, 18 Sep 2012 17:07:09 +0000 (13:07 -0400)]
[libchromeos] add Platform

This class is being moved from cryptohome so it can be used elsewhere
(login_manager primarily).

BUG=chromium-os:34536
TEST=build

Change-Id: I979f70e3f783bb64a46238678606937b3f3b98e9
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33536
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2 years ago[libchromeos] add SecureBlob(const std::string&) constructor
Elly Fong-Jones [Fri, 21 Sep 2012 21:53:56 +0000 (17:53 -0400)]
[libchromeos] add SecureBlob(const std::string&) constructor

BUG=chromium-os:30637
TEST=unit

Change-Id: I26359d197c98da591129fa4c31fd40b55f6d3a71
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/33810
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years ago[libchrome] add ERROR_ALREADY_SESSION factory-2846.B factory-2848.B factory-2914.B firmware-stout-2817.B release-R23-2913.B stabilize stabilize-daisy stabilize-link stabilize-link-2913.278
Elly Jones [Thu, 23 Aug 2012 15:11:33 +0000 (11:11 -0400)]
[libchrome] add ERROR_ALREADY_SESSION

TEST=build
BUG=chromium-os:33357

Change-Id: I8df309cbfb055802cf7da44397e3dcb7f2e1396a
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31216
Reviewed-by: Chris Masone <cmasone@chromium.org>
2 years agoFix libchromeos for gcc 4.7 build.
Han Shen [Wed, 22 Aug 2012 17:56:30 +0000 (10:56 -0700)]
Fix libchromeos for gcc 4.7 build.

Added explict <unistd.h> inclusion.

BUG=None
TEST=Built using gcc 4.7 for x86-generic.

Change-Id: Ifab211ed7c7e818098dc2febde4f5ad6bfb11284
Reviewed-on: https://gerrit.chromium.org/gerrit/31123
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Ready: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
Reviewed-by: Han Shen <shenhan@chromium.org>
Reviewed-by: asharif <asharif@chromium.org>
2 years ago[libchromeos] add utility::SecureRandomString() firmware-butterfly-2788.B
Elly Jones [Mon, 20 Aug 2012 20:19:15 +0000 (16:19 -0400)]
[libchromeos] add utility::SecureRandomString()

BUG=chromium-os:6615
TEST=adhoc

Change-Id: Ib887422eff5afcb58a74678565787a96d80db893
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30898
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years agochromeos: Make LOG(FATAL) cause crashes
Christopher Wiley [Fri, 10 Aug 2012 17:44:03 +0000 (10:44 -0700)]
chromeos: Make LOG(FATAL) cause crashes

LOG(FATAL) is supposed to log some message and then crash the process.
However, the handler in syslog_logging.h tells base/logging that it
handles the message, regardless of the severity. Unfortunately, this
prevents the expected crash.

BUG=chromium-os:33351
TEST=Unit tests pass, added new test for fatal crashes that now passes

Change-Id: I7f9780b81bde26457f76ebeec689fd9eb4a4fdb7
Reviewed-on: https://gerrit.chromium.org/gerrit/30011
Tested-by: Christopher Wiley <wiley@chromium.org>
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
2 years ago[libchromeos] support a pre-exec hook factory-2717.B factory-2723.14.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B release-R22-2723.B
Elly Jones [Mon, 9 Jul 2012 16:08:48 +0000 (12:08 -0400)]
[libchromeos] support a pre-exec hook

Support a hook that is called after all other setup but right before exec() in
the child process; this can be used for things like doing additional sandboxing.

Also, clean up the argument-array code in Start(), which appeared to operate
under the assumption that the argument array given to execve(2) has to be
contiguous in RAM.

TEST=unit
BUG=chromium-os:30740

Change-Id: Iccdb34e7d43a4d29ae131a37acc5a2192d287579
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26925
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years agoAdds a method to retrieve the release channel delegation flag from the policy blob. factory-2569.B
Julian Pastarmov [Fri, 6 Jul 2012 13:57:29 +0000 (15:57 +0200)]
Adds a method to retrieve the release channel delegation flag from the policy blob.

BUG=chromium-os:32339
TEST=unit tests

Change-Id: I750b120e855b8b66b0c5884d76d0a0e9f76fc58f
Reviewed-on: https://gerrit.chromium.org/gerrit/26856
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Commit-Ready: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
2 years agolibpolicy: set default symbol visibility to hidden
Mike Frysinger [Fri, 17 Feb 2012 21:18:38 +0000 (16:18 -0500)]
libpolicy: set default symbol visibility to hidden

This allows gcc to make assumptions about other symbols and thus avoid
going through the PLT.  This ends up saving us about ~4KiB of text and
~1KiB of data.

BUG=chromium-os:26654
TEST=`emerge-x86-alex libchromeos update_manager metrics` still works
TEST=`libpolicy_unittest` passes
TEST=`cbuildbot arm-generic-full` passes

Change-Id: I93c8a4bd244f611fd44c614c3f7df09f35a80e4a
Reviewed-on: https://gerrit.chromium.org/gerrit/16289
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>

2 years agolibpolicy: only export symbols we want to
Mike Frysinger [Fri, 17 Feb 2012 20:56:28 +0000 (15:56 -0500)]
libpolicy: only export symbols we want to

Only the policy namespace is exported in the policy headers, so make
sure we hide all other symbols.  Otherwise we end up exporting symbols
that we imported from libbase.

BUG=chromium-os:26654
TEST=`emerge-x86-alex libchromeos update_manager metrics` still works
TEST=`libpolicy_unittest` passes
TEST=`cbuildbot arm-generic-full` passes

Change-Id: I9023e9adb9846f9da6c7a04fddd0d60212d18fc0
Reviewed-on: https://gerrit.chromium.org/gerrit/16288
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>

2 years agomove string helpers to libcros factory-2475.B release-R21-2465.B
Mike Frysinger [Mon, 11 Jun 2012 22:15:11 +0000 (18:15 -0400)]
move string helpers to libcros

The only project using these funcs is libcros, so move them to that
project to avoid having to create a small shared library for it.

BUG=chromium-os:29973
TEST=`cbuildbot {x86,amd64,arm}-generic-full` worked

Change-Id: I55c296408a014c919d2cd58b157e6ccbab98666f
Reviewed-on: https://gerrit.chromium.org/gerrit/25043
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years agoMoved SecureBlob to libchromeos. factory-2460.B
Darren Krahn [Fri, 8 Jun 2012 21:52:47 +0000 (14:52 -0700)]
Moved SecureBlob to libchromeos.

Previously this class was in the cryptohome module.

BUG=chromium-os:27681
TEST=Ran all unit tests and verified SecureBlob tests are running.

Change-Id: I8e41dc4b8c2d07129de90ff91de6554fd7fd6097
Reviewed-on: https://gerrit.chromium.org/gerrit/25121
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>

2 years ago[libchromeos] handle variants in DBusPropertyMapToValue
Elly Jones [Thu, 7 Jun 2012 21:01:40 +0000 (17:01 -0400)]
[libchromeos] handle variants in DBusPropertyMapToValue

Handle variant types appearing as elements in other containers.

BUG=chromium-os:30740
TEST=Adhoc
/usr/libexec/debugd/helpers/network_status works with shill now

Change-Id: I67f4730e9276d15c55f2721f7cc1b152cc2df99f
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24758
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years agoWire up allowed AU connection types with libpolicy. factory-2394.B
Mattias Nissler [Wed, 23 May 2012 18:46:33 +0000 (20:46 +0200)]
Wire up allowed AU connection types with libpolicy.

BUG=chromium:31099
TEST=Compiles and passes tests.

Change-Id: Ibe0bb31de1238e1a1b6847f5a933b00885636ce9
Reviewed-on: https://gerrit.chromium.org/gerrit/23381
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
2 years agoLibchrome updates for enterprise policy to scatter downloads of updates.
Jay Srinivasan [Fri, 1 Jun 2012 02:24:56 +0000 (19:24 -0700)]
Libchrome updates for enterprise policy to scatter downloads of updates.

This CL provides methods to expose the newly added
scatter_factor_in_seconds policy. This policy is used to scatter the
downloads of ChromeOS updates over a given period of time in order to
reduce bandwidth spikes which may otherwise result due to simultaneous
downloads in large enterprises.

BUG=chromeos-29615: Implement scattering of downloads in UpdateEngine
TEST=update_engine works fine with new policy code. Updated unit tests.
Change-Id: I1f56b5516970d5988eebb2cf8f93f6905823801d
Reviewed-on: https://gerrit.chromium.org/gerrit/21557
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>

2 years agoPropagate new device policies for enterprise auto-update controls. factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B firmware-link-2348.B release-R19-2046.B release-R20-2268.B
Jay Srinivasan [Mon, 19 Mar 2012 18:44:48 +0000 (11:44 -0700)]
Propagate new device policies for enterprise auto-update controls.

Enterprise admins needs more control over Chrome OS auto-update behavior.
This CL propagates the newly added fields in the chrome_device_proto
so that update_engine can consume it.

BUG=27307: Implement StopAutoUpdate based on enterprise policy
TEST=ChromeOS updateengine works.
CQ-DEPEND=I873981e171b5e40ae0e16ba954042e228b5d23be
Change-Id: I61a498280c3ccca674e74581f1b03364d7896bc2
Reviewed-on: https://gerrit.chromium.org/gerrit/18398
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>

2 years agolibchromeos: build SLOT-ed shared libraries factory-1987.B
Mike Frysinger [Wed, 22 Feb 2012 18:57:05 +0000 (13:57 -0500)]
libchromeos: build SLOT-ed shared libraries

This merges the SLOT-ed libchrome into a SLOT-ed shared libchromeos.
Now all apps wil link against libchromeos rather than libbase.  This
allows us to lock things in and track the dependencies.  The fallout
is that we no longer build a static libchromeos.

Similarly for libpolicy, SLOT it and stop building libpolicy.a.

BUG=chromium-os:26736
TEST=`FEATURES=test emerge libchromeos` works
TEST=build_packages+build_image for x86-alex boots
TEST=`cbuildbot arm-generic-full` works
TEST=`cbuildbot x86-generic-full` works

URL: https://groups.google.com/a/chromium.org/group/chromium-os-dev/browse_thread/thread/75a1fdee269c41e4
Change-Id: Ibccd471f2cde7901f71750a3d67fd8ecb36dab40
Reviewed-on: https://gerrit.chromium.org/gerrit/16763
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>

2 years agoprocess: include base/stringprintf.h directly
Mike Frysinger [Wed, 7 Mar 2012 14:38:18 +0000 (09:38 -0500)]
process: include base/stringprintf.h directly

This code uses StringPrintf, but doesn't include the header.  Older
versions of libbase would implicitly include it, but newer ones do
not.  So include it ourselves to fix building with newer versions.

BUG=chromium-os:25872
TEST=`emerge-x86-alex libchromeos` works (with newer and older libbase)

Change-Id: I85ab12874374d7345789a78a67a40f3b79171c84
Reviewed-on: https://gerrit.chromium.org/gerrit/17473
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years agoUpdate libpolicy.h to find scoped_ptr.h in <base/memory>.
Eric Shienbrood [Wed, 29 Feb 2012 21:04:07 +0000 (16:04 -0500)]
Update libpolicy.h to find scoped_ptr.h in <base/memory>.

This is in preparation to the move to a newer libchrome, where
scoped_ptr.h no longer appears in base, just in base/memory.

BUG=chromium-os:16623
TEST=Do the emerge, and then examine /usr/include/policy/libpolicy.h

Change-Id: Ibfd200347084cf15de0168fd86d1a39eac1c96db
Reviewed-on: https://gerrit.chromium.org/gerrit/17078
Reviewed-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>

2 years agoclean up env handling
Mike Frysinger [Fri, 17 Feb 2012 20:55:46 +0000 (15:55 -0500)]
clean up env handling

This fixes up a few issues with the env handling:
 - unifies duplicate base setup between libchromeos and libpolicy
 - sets up sane defaults for ROOT and PKG_CONFIG
 - respects build env CPPFLAGS and LDFLAGS

BUG=chromium-os:26654
TEST=`emerge-x86-alex libchromeos update_manager metrics` still works
TEST=`libpolicy_unittest` passes
TEST=`cbuildbot arm-generic-full` passes

Change-Id: I0a165d8d90ecfbc6652e26349b0d38cabd739d9e
Reviewed-on: https://gerrit.chromium.org/gerrit/16287
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>

2 years agofix libpolicy dependencies with generated protoc files
Mike Frysinger [Fri, 17 Feb 2012 00:35:24 +0000 (19:35 -0500)]
fix libpolicy dependencies with generated protoc files

There is a race condition with the libpolicy build where scons will try to
compile the non-generated files before the protoc execution has finished,
and that fails since those non-generated files need the generated headers.

Make sure we list the headers as being generated outputs too so that scons
won't try to build the source files that need those headers before they
are available.

BUG=None
TEST=add `sleep 10s` before `protoc` in SConstruct and see `scons libpolicy.a -j 100` no longer fail

Change-Id: Ief4048a792d8f0fd3f0638b4e7457de433b056b3
Reviewed-on: https://gerrit.chromium.org/gerrit/16099
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>

2 years agoUse new name of the ephemeral_users device policy
Bartosz Fabianowski [Thu, 16 Feb 2012 01:06:01 +0000 (17:06 -0800)]
Use new name of the ephemeral_users device policy

This CL updates libpolicy to reflect the renaming of the
ephemeral_users device policy to ephemeral_users_enabled.

Note: Three different Chrome OS packages refer to the policy by name.
The CLs for these must be committed together.

BUG=chromium-os:26406
TEST=libpolicy_unittest
CQ-DEPEND=If93e33a06c667e88a5c9f69d2caaf738b9dae11d
CQ-DEPEND=I9a8c8e1a112304242fb42f6d6d660c9e3cb289f1

Change-Id: I41cfbcba1bd712104afe18ec61dadc9ccf0add08
Reviewed-on: https://gerrit.chromium.org/gerrit/15979
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Bartosz Fabianowski <bartfab@google.com>
Commit-Ready: Bartosz Fabianowski <bartfab@google.com>

2 years agoAdd helpers for working with multi home mount points
Bartosz Fabianowski [Fri, 10 Feb 2012 14:33:57 +0000 (15:33 +0100)]
Add helpers for working with multi home mount points

This CL adds helper functions for setting and retrieving previously
harcoded path components. An additional helper function checks
whether a given string corresponds to an obfuscated/sanitized user
name. These helpers will be used by cryptohomed in the fix for
issue 20004.

BUG=chromium-os:25861
TEST=all previous tests should pass
CQ-DEPEND=I09616bbbe5b57815ce377d209444c8c1876e9499

Change-Id: Iec5cb5109732a5adb3893f316fb961eb4168b416
Reviewed-on: https://gerrit.chromium.org/gerrit/15237
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Commit-Ready: Bartosz Fabianowski <bartfab@google.com>
Tested-by: Bartosz Fabianowski <bartfab@google.com>
2 years agolibchromeos: add option to include meta-data in syslog
mukesh agrawal [Thu, 9 Feb 2012 23:30:14 +0000 (15:30 -0800)]
libchromeos: add option to include meta-data in syslog

BUG=chromium-os:24539
TEST=manual

manual testing: built shill with and without chromeos::kLogHeader
option. observed that syslog messages included header
(<date>/<timestamp>:<severity>:<file>(<line>) when option was
present. observed that syslog messages did not include header
when option was absent.

Change-Id: I8792d1b7ac591bf45cdeb06714b824b14b08eaf4
Reviewed-on: https://gerrit.chromium.org/gerrit/15631
Reviewed-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
2 years agoExtend libpolicy to provide access to all device policy fields
Bartosz Fabianowski [Tue, 7 Feb 2012 10:54:21 +0000 (11:54 +0100)]
Extend libpolicy to provide access to all device policy fields

This CL extends libpolicy so that it provides access to all fields of
the device policy protobuf. That also includes the ephemeral users
policy which is being added to the protobuf on the Chrome side in the
following CL:

https://chromiumcodereview.appspot.com/9104038/

This CL should be committed once the above CL goes in and the version
of the chromeos-base/protofiles ebuild has been bumped to pull in the
new protobuf files.

BUG=chromium-os:20004
TEST=libpolicy_unittest
CQ-DEPEND=Ie7e0e5e1ee4deb4e2cce46702e3d865f27efcfce

Change-Id: I09616bbbe5b57815ce377d209444c8c1876e9499
Reviewed-on: https://gerrit.chromium.org/gerrit/15147
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Tested-by: Bartosz Fabianowski <bartfab@google.com>
Commit-Ready: Bartosz Fabianowski <bartfab@google.com>

2 years agoExtend libpolicy to also retrieve the device owner
Bartosz Fabianowski [Wed, 25 Jan 2012 15:31:26 +0000 (16:31 +0100)]
Extend libpolicy to also retrieve the device owner

The policy blob contains information about the device owner. This extends
libpolicy with a DevicePolicy::GetOwner() that retrieves the device owner's
e-mail address from the policy blob.

BUG=chromium-os:25416
TEST=libpolicy_unittest

Change-Id: I1bf8923b794528afea5ce216e4056e29c4d11593
Reviewed-on: https://gerrit.chromium.org/gerrit/14702
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Commit-Ready: Bartosz Fabianowski <bartfab@google.com>
Tested-by: Bartosz Fabianowski <bartfab@google.com>
2 years ago[libchromeos] Add DBus*ToValue().
Elly Jones [Fri, 6 Jan 2012 19:34:51 +0000 (14:34 -0500)]
[libchromeos] Add DBus*ToValue().

Add DBus{Message,MessageIter,PropertyMap}ToValue to convert DBus types to
libbase Value types.

BUG=chromium-os:23839
TEST=unit

Change-Id: Iaa00fae1577f21dc4fd39fe909970aaba97a7ff4
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13814
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years ago[libchromeos] update .pc file to use libchrome.pc
Elly Jones [Thu, 12 Jan 2012 22:32:04 +0000 (17:32 -0500)]
[libchromeos] update .pc file to use libchrome.pc

BUG=chromium-os:24959
TEST=build

Change-Id: I45efecc46e6a696dfaa5543ace9d3de90119c59d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14094
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 years ago[libchromeos] add other deps to pkg-config
Elly Jones [Wed, 11 Jan 2012 19:36:51 +0000 (14:36 -0500)]
[libchromeos] add other deps to pkg-config

BUG=chromium-os:24959
TEST=Adhoc
Built every package depending directly on libchromeos.

Change-Id: Idb9391c5a0e7f2ad48910c6ce4346958a4c774d3
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13991
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 years ago[libchromeos] add pkg-config file.
Elly Jones [Wed, 11 Jan 2012 18:15:42 +0000 (13:15 -0500)]
[libchromeos] add pkg-config file.

BUG=chromium-os:24959
TEST=Adhoc
emerge-$board libchromeos

Change-Id: Ic508fea4b98cd2c68abe7e5028018d5398fa0e85
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13984
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 years agoprocess: don't close child fds before finishing binding
Elly Jones [Wed, 7 Dec 2011 20:00:48 +0000 (15:00 -0500)]
process: don't close child fds before finishing binding

Leaving the child fds open allows for the same child fd to be bound to multiple
fds.

BUG=None
TEST=Adhoc
Build, build debugd, run ping in an erroneous way.

Change-Id: Idac0bdf8bf6bc5ea007d2d8a949a7cc6e2739d54
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/12568

2 years agoprocess: add BindFd method.
Elly Jones [Fri, 2 Dec 2011 20:22:09 +0000 (15:22 -0500)]
process: add BindFd method.

This method binds the specified file descriptor from the parent to the specified
file descriptor in the child, ala dup2(2). This is necessary if we want to pass
a socket to the child: if we have a socket fd s, and we use RedirectUsingPipe,
we end up with:

[child process] child_fd <----> parent_fd [parent] s <--- ...

There's nothing the parent can do to link parent_fd with s, though:
dup2(parent_fd, s) throws away s, and dup2(s, parent_fd) throws away any input
buffered on parent_fd by the child.

BUG=chromium-os:22533
TESTED_ON=x86-generic
TEST=Build,unittest,trybot

Try: http://naya.i.corp.google.com/tries/80df9824-5a62-42e3-8706-c8b3a07d72cb.txt
Change-Id: Id52fc7743a92d211b3620f1da4a33e4554b6406d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/12388

3 years agolibchromeos: move mountpoints into subdirectories factory-1235.B factory-1284.B factory-1412.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R16-1193.B release-R17-1412.B
Elly Jones [Mon, 17 Oct 2011 17:47:41 +0000 (13:47 -0400)]
libchromeos: move mountpoints into subdirectories

This lets us set permissions that apply to all user directories or all root
directories.

BUG=chromium-os:16681,chromium-os:20778
TEST=None

Change-Id: I240fe94590b592a983d0a9f37addf2b0cd081c1e
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10173
Reviewed-by: Will Drewry <wad@chromium.org>
3 years agolibchromeos: Add Get{User,Root}Path.
Elly Jones [Fri, 30 Sep 2011 20:34:32 +0000 (16:34 -0400)]
libchromeos: Add Get{User,Root}Path.

BUG=chromium-os:20778, chromium-os:16681
TEST=None yet

Change-Id: I211274b2abe961ae60a3402d5dd67fc2e7a5d21d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8571
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
3 years agodbus: Remove func that sends signal with no args
Simon Que [Thu, 22 Sep 2011 23:42:42 +0000 (16:42 -0700)]
dbus: Remove func that sends signal with no args

SendSignalWithNoArgumentsToSystemBus() is no longer being used.  Delete.

BUG=chromium-os:20115
TEST=none

Change-Id: Ia928bdc466ba4e2d128859b37717931e41f0e523
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8174
Reviewed-by: Satoru Takabayashi <satorux@chromium.org>
3 years agodbus: Add function to issue no-reply method call
Simon Que [Wed, 21 Sep 2011 23:45:31 +0000 (16:45 -0700)]
dbus: Add function to issue no-reply method call

Analogous to the existing SendSignalWithNoArgumentsToSystemBus().

BUG=chromium-os:20115
TEST=none

Change-Id: I37bff8827c77c2abd7cd5528cca5e3a627b74698
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8093
Reviewed-by: Satoru Takabayashi <satorux@chromium.org>
3 years agoChanged the project to use the proto files from the protofiles project.
Julian Pastarmov [Thu, 28 Jul 2011 13:39:26 +0000 (15:39 +0200)]
Changed the project to use the proto files from the protofiles project.

These used to be copied internally for solving the needed dependency on
chromes-chrome.

BUG=chromium-os:18342
TEST=The project should still build happily afterwards.

Change-Id: If6680179524a73f0c808d7c763606355adaca31a
Reviewed-on: http://gerrit.chromium.org/gerrit/4925
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
Commit-Ready: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
3 years agoReduced the amount of output from the policy lib. factory-1020.B
Julian Pastarmov [Mon, 5 Sep 2011 14:14:44 +0000 (16:14 +0200)]
Reduced the amount of output from the policy lib.

It used to be way to verbose for situations that are not considered fatal
errors for the OOBE stage in ChromeOS.

BUG=chromium-os:20043
TEST=Less frowns on the faces of QA.

Change-Id: I1dd0ab7ccc08f7cc496ffce95566e02082f05a9c
Reviewed-on: http://gerrit.chromium.org/gerrit/7259
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
3 years agoRemove dbus/service_constants.h from libchromeos.git. factory-980.B release-1011.B test-982.B
Satoru Takabayashi [Tue, 16 Aug 2011 21:21:18 +0000 (14:21 -0700)]
Remove dbus/service_constants.h from libchromeos.git.

This file is now maintained in system_api.git.

BUG=chromium-os:19054
TEST=emerge-x86-alex libchromeos system_api chromeos-login

Change-Id: I39aa63d1b1402c4aae284a8c65f83aa71ca5aa56
Reviewed-on: http://gerrit.chromium.org/gerrit/6120
Tested-by: Satoru Takabayashi <satorux@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 years agolibchromeos: add session-service constants.
Elly Jones [Thu, 11 Aug 2011 19:01:01 +0000 (15:01 -0400)]
libchromeos: add session-service constants.

BUG=chromium-os:19040
TEST=None (no functional change)

Change-Id: I8213e29c2114344155498ce6a552f50c252d6bed
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5756
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
3 years agoMove definitions of D-Bus string contants from .cc file to .h file.
Satoru Takabayashi [Fri, 12 Aug 2011 04:58:16 +0000 (21:58 -0700)]
Move definitions of D-Bus string contants from .cc file to .h file.

This will make it easier to use the constants. All you have to do is just
to include the header file. No need to link libchromeos. The goal is to
share the constants with Chrome.

The patch was created by a Python script, which has been uploaded to crosbug.com/19054

This change will reduce the binary size, as the compiler will be able to
eliminate unused constants, whereas all the constants were embedded into
the binary as part of libchromeos.a, regardless of whether they are used
or not, before this change.

The following is the result from libcros and session_manager (chromeos-login).

-rwxr-xr-x 1 satorux eng 690048 Aug 11 11:22 libcros.so.before
-rwxr-xr-x 1 satorux eng 655788 Aug 11 11:53 libcros.so.after

-rwxr-xr-x 1 satorux eng 865108 Aug 11 16:02 session_manager.before
-rwxr-xr-x 1 satorux eng 855428 Aug 11 16:04 session_manager.after

BUG=chromium-os:19054
TEST=emerge packages that use service_constants.h: libchromeos cromo cros-disks libcros chromeos-cryptohome chromeos-imageburner chromeos-login power_manager shill speech_synthesis chromeos-wm

Change-Id: I83d360a201f8936d76731de255bc8caf2e3ee0be
Reviewed-on: http://gerrit.chromium.org/gerrit/5854
Tested-by: Satoru Takabayashi <satorux@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 years agoRemove the #include of error_constants.h from service_constants.h.
Satoru Takabayashi [Fri, 12 Aug 2011 02:16:39 +0000 (19:16 -0700)]
Remove the #include of error_constants.h from service_constants.h.

All source files that reference the error constants have been modified to
include error_constants.h.

BUG=chromium-os:19054
TEST=emerge libchromeos and chromeos-login

Change-Id: Id7996e7736e21f685f0bc2bbc56768dfbaba1dde
Reviewed-on: http://gerrit.chromium.org/gerrit/5826
Tested-by: Satoru Takabayashi <satorux@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 years agoSeparate error constants from service_constants.h.
Satoru Takabayashi [Thu, 11 Aug 2011 21:05:33 +0000 (14:05 -0700)]
Separate error constants from service_constants.h.

The error constants are not D-Bus service constants like service names.
We'll remove #include "error_constants.h" from system_constants.h,
once all files that needs the error constants are modified.

BUG=chromium-os:19054
TEST=emerge libchromeos and chromeos-login

Change-Id: Ie6a0bfb63d1000fa2effc8f11a3c58cf8290b70b
Reviewed-on: http://gerrit.chromium.org/gerrit/5798
Tested-by: Satoru Takabayashi <satorux@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 years agoAdd release channel device policy to libpolicy. 0.15.877.B firmware-881-u-boot-v1 firmware-u-boot-v1
Patrick Dubroy [Mon, 1 Aug 2011 13:52:35 +0000 (15:52 +0200)]
Add release channel device policy to libpolicy.

BUG=chromium-os:17015
TEST=Added one new test to check that the method returns false when
the release channel is not specified in the policy.

Change-Id: I3c8b4ea9d7d21b685802bcaf60b4394f91709756
Reviewed-on: http://gerrit.chromium.org/gerrit/5068
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
3 years agoAdded MonitorConnection template with 4 arguments. 0.14.811.B
tbarzic [Wed, 20 Jul 2011 23:53:10 +0000 (16:53 -0700)]
Added MonitorConnection template with 4 arguments.

BUG=chromium-os:17673
TEST=NONE

Change-Id: Icd3d6aa65f8696f9b2dd12b28d638c0cf8f58302
Reviewed-on: http://gerrit.chromium.org/gerrit/4447
Reviewed-by: Zelidrag Hornung <zelidrag@chromium.org>
Tested-by: Toni Barzic <tbarzic@chromium.org>
3 years agoFix libchromeos build script to work on arm as well.
Julian Pastarmov [Fri, 22 Jul 2011 12:16:49 +0000 (14:16 +0200)]
Fix libchromeos build script to work on arm as well.

BUG=chromium-os:17011
TEST=Build on arm should not fail.

Change-Id: I8f0b32565e5d55fc91b00cbf5e1672c3f983aa48
Reviewed-on: http://gerrit.chromium.org/gerrit/4572
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
3 years agoAdded libpolicy to the repo.
Julian Pastarmov [Wed, 20 Jul 2011 12:30:46 +0000 (14:30 +0200)]
Added libpolicy to the repo.

BUG=chromium-os:17011
TEST=libpolicy_unittest
Change-Id: I2bc0bdecbb421ad72ceb5c4edde9436417ebf7c3
Reviewed-on: http://gerrit.chromium.org/gerrit/3130
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Julian Pastarmov <pastarmovj@chromium.org>
3 years agoAdd definitions related to controlling the keyboard backlight. 780.B
Doug Anderson [Fri, 24 Jun 2011 23:42:24 +0000 (16:42 -0700)]
Add definitions related to controlling the keyboard backlight.

BUG=chrome-os-partner:3482
TEST=Along with other changes, validated that dbus signal to powerd can control keylight.

Change-Id: I491173aefd5781ec36572e31859297d601467517
Reviewed-on: http://gerrit.chromium.org/gerrit/3210
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years ago[libchromeos] Add way more flimflam property names
Chris Masone [Wed, 15 Jun 2011 03:40:38 +0000 (20:40 -0700)]
[libchromeos] Add way more flimflam property names

BUG=chromium-os:16343
TEST=build it, and all dependent packages

Change-Id: I762ef8359332b8f08bba6358fe53baa81c4da4ff
Reviewed-on: http://gerrit.chromium.org/gerrit/2660
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agoAdd constants for user policy calls.
Mattias Nissler [Mon, 30 May 2011 14:21:43 +0000 (16:21 +0200)]
Add constants for user policy calls.

BUG=chromium-os:15189
TEST=none
R=cmasone

Change-Id: Ic37ab55c864b152c60df07481c1bdb1e14993b16
Reviewed-on: http://gerrit.chromium.org/gerrit/2843
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 years ago[libchromeos] Add flimflam, cashew, modemmanager constants
Chris Masone [Wed, 8 Jun 2011 21:55:59 +0000 (14:55 -0700)]
[libchromeos] Add flimflam, cashew, modemmanager constants

BUG=chromium-os:16303
TEST=emerge libchromeos, libcros to ensure new libchromeos header can co-exist with existing libcros headers

Change-Id: I1a61406484a6e8814fd17fa9ec8557d8c369ec14
Reviewed-on: http://gerrit.chromium.org/gerrit/2313
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years ago[common] remove shockingly obsolete debian stuff
Chris Masone [Wed, 8 Jun 2011 18:35:24 +0000 (11:35 -0700)]
[common] remove shockingly obsolete debian stuff

BUG=None
TEST=emerge-BOARD libchromeos

Change-Id: I9b8a0ea45264038a9dc5329908263a2320f036d1
Reviewed-on: http://gerrit.chromium.org/gerrit/2297
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agolibchromeos: add kSessionManagerRetrieveSessionState. 0.13.587.B
Daniel Erat [Fri, 27 May 2011 18:04:44 +0000 (11:04 -0700)]
libchromeos: add kSessionManagerRetrieveSessionState.

BUG=chromium-os:15294
TEST=none

Change-Id: Ic557f772acc9c1b56e6c4978fd88060bbb356073
Reviewed-on: http://gerrit.chromium.org/gerrit/1727
Tested-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years ago[libchromeos] Take advantage of new params in logging callback, handle VLOG() 0.13.558.B
Chris Masone [Tue, 24 May 2011 23:34:43 +0000 (16:34 -0700)]
[libchromeos] Take advantage of new params in logging callback, handle VLOG()

When we moved to the newer libbase stuff, the base::logging callbacks added a param called |message_start|
This points to the same place in the log message that we used to heurisitcally search for, so
now just go ahead and use it.

Also, VLOG() calls (which we can now do) pass a value for |severity| that we couldn't handle.  Now, set it to syslog's LOG_DEBUG level.

BUG=None
TEST=build shill with new libchromeos.a, run it and see verbose messages get logged correctly, along with normal LOG(INFO) stuff

Change-Id: Idcea88ba45add901685b94d157db788e9e2d5162
Reviewed-on: http://gerrit.chromium.org/gerrit/1510
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years ago[libchromeos] Roll forward to libchrome 84780(ish)
Chris Masone [Thu, 12 May 2011 17:40:11 +0000 (10:40 -0700)]
[libchromeos] Roll forward to libchrome 84780(ish)

Header files have moved.

BUG=chromium-os:14304
TEST=build

Change-Id: Ied759c2f84fcdaa7aa7e9a77fd84a6dfffb92ee0
Reviewed-on: http://gerrit.chromium.org/gerrit/811
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agoChange GID of the child process first before changing the UID. 0.13.509.B
Gaurav Shah [Tue, 10 May 2011 01:19:08 +0000 (18:19 -0700)]
Change GID of the child process first before changing the UID.

When dropping privileges, once the EUID of the process changes, it may no longer have the permissions to changes its EGID.

BUG=none
TEST=manual

Change-Id: Iba1be351331a1579fce9f5ccad82a375b5d59e5e
Reviewed-on: http://gerrit.chromium.org/gerrit/575
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Ken Mixter <kmixter@chromium.org>
3 years agoAdd a SafeMemcmp function to the common library
Gaurav Shah [Thu, 12 May 2011 20:57:59 +0000 (13:57 -0700)]
Add a SafeMemcmp function to the common library

The safe memory comparison performs the operation in time independent of the relationship between the 2 strings compared.

BUG=chromium-os:5295
TEST=emerge-{x86|arm}-generic chromeos-base/libchromeos

Change-Id: Ibb6a4b6b14ca72e41e5442691364dcd192036a63
Reviewed-on: http://gerrit.chromium.org/gerrit/796
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
3 years agolibchromeos: Added D-Bus service constants for power manager service
Chris Wolfe [Sun, 1 May 2011 16:56:16 +0000 (12:56 -0400)]
libchromeos: Added D-Bus service constants for power manager service

Change-Id: I98e79788ff6187ae5af2d7aba55041e71c907b90

BUG=chromium-os:13281
TEST=With related CLs, modified brightness using dbus-send.

Review URL: http://codereview.chromium.org/6711070

3 years agolibchromeos: Support setting uid/gid of child processes in process.h 0.12.433.B 0.12.433.B109 0.12.433.B62 0.13.434.B
Ken Mixter [Wed, 20 Apr 2011 01:43:08 +0000 (18:43 -0700)]
libchromeos: Support setting uid/gid of child processes in process.h

Change-Id: Idaf6e635114ec55a8c25cb71cdfaadc45e334d26

R=sosa@chromium.org
BUG=none
TEST=unittests and emerging a dependent executable

Review URL: http://codereview.chromium.org/6865041

3 years agoConstants for Cryptohome API added
Denis Glotov [Tue, 19 Apr 2011 16:39:37 +0000 (20:39 +0400)]
Constants for Cryptohome API added

Change-Id: I5b762561a2229185200b77ebdc4d67a99e7f1cf5

BUG=chromium-os:4065
TEST=manual

Review URL: http://codereview.chromium.org/6883047

3 years agoAdded constants for the dbus function names for cryptohome's InstallAttributes calls.
Julian Pastarmov [Fri, 15 Apr 2011 12:13:41 +0000 (16:13 +0400)]
Added constants for the dbus function names for cryptohome's InstallAttributes calls.

BUG=chrome-os:14119
TEST=Manual.
TBR=mnissler@chromium.org

Signed-off-by: Nikita Kostylev <nkostylev@chromium.org>
Author:    Julian Pastarmov <pastarmovj@chromium.org>
Original CL: http://codereview.chromium.org/6837023/

Review URL: http://codereview.chromium.org/6837023

Change-Id: If62e8abb0089db77831f52a1ff5504f6950dc473

Review URL: http://codereview.chromium.org/6870007
Patch from Julian Pastarmov <pastarmovj@chromium.org>.

3 years agolibchromeos: Add new cryptohomed dbus method names
Ken Mixter [Tue, 12 Apr 2011 19:47:58 +0000 (12:47 -0700)]
libchromeos: Add new cryptohomed dbus method names

Change-Id: I5aedb95b5d4089c0b50f2e811fe15a85b1ca59bf

R=gspencer@chromium.org
BUG=chromium-os:12296
TEST=builds

Review URL: http://codereview.chromium.org/6820021

3 years agolibchromeos: add pipe support to Process 0.12.362.B 0.12.369.B 0.12.392.B
Ken Mixter [Wed, 16 Mar 2011 02:34:42 +0000 (19:34 -0700)]
libchromeos: add pipe support to Process

Change-Id: Ic09957371b72b4649144320cc504d207e9b7d37b

BUG=chromium-os:11814
TEST=unit tests

Review URL: http://codereview.chromium.org/6624039

3 years ago[common] Add constants for new session manager API calls
Chris Masone [Mon, 14 Mar 2011 22:17:38 +0000 (15:17 -0700)]
[common] Add constants for new session manager API calls

Constants to name StorePolicy and RetrievePolicy DBus methods on session_manager.

BUG=12670
TEST=build, unit test libchromeos and chromeos-login

Change-Id: Ia15d359fac6e84c0e25b321ca2723fb752a05015

R=kmixter@chromium.org

Review URL: http://codereview.chromium.org/6696001

3 years agoAdd constants for new cryptohome API 0.11.241.B 0.11.257.B 0.11.257.B90 11.1.241.B
Denis Glotov [Fri, 4 Mar 2011 13:33:57 +0000 (16:33 +0300)]
Add constants for new cryptohome API

Change-Id: Ia70a961d46a70b25b2f29fe4edc9db6d08ae5170

BUG=chromium-os:12713
TEST=none

Review URL: http://codereview.chromium.org/6603016

3 years agolibchromeos: re-push add process control library, syslog logging capability, and...
Ken Mixter [Thu, 3 Mar 2011 02:01:37 +0000 (18:01 -0800)]
libchromeos: re-push add process control library, syslog logging capability, and run unit tests

This reverts commit 61e719072d7afa18ecd4b29278ed19ea36b12737.

BUG=
TEST=emerge with and without ndebug, run unit tests

Review URL: http://codereview.chromium.org/6597120

Change-Id: Icbd13fb028bc1c45dce8ea50e70218207e509c82

3 years agolibchromeos: revert add process control library, syslog logging capability, and run...
Ken Mixter [Wed, 2 Mar 2011 20:53:06 +0000 (12:53 -0800)]
libchromeos: revert add process control library, syslog logging capability, and run unit tests

This reverts commit f7cb327eb8d7dc59d9529f8699b8e528a8903be4.

BUG=
TEST=

Review URL: http://codereview.chromium.org/6602095

Change-Id: I5786d8898104c3f43165da0cef9c41273db68f6f

3 years agolibchromeos: add process control library, syslog logging capability, and run unit...
Ken Mixter [Wed, 2 Mar 2011 19:50:12 +0000 (11:50 -0800)]
libchromeos: add process control library, syslog logging capability, and run unit tests

Change-Id: I9d9a00eeb649666efc1f2fdac1914e4bf6f1149c

BUG=n0ne
TEST=unit tests

Review URL: http://codereview.chromium.org/6509006

3 years agoTypo fix
Denis Glotov [Mon, 14 Feb 2011 17:31:06 +0000 (20:31 +0300)]
Typo fix
(in "MonitorSignal low-level wrapper introduced")

Change-Id: I12dd3725dcd05ba5fd490d1a94575fd794aa335b

BUG=chromium-os:11121
TEST=manual

Review URL: http://codereview.chromium.org/6484039

3 years agoMonitorSignal low-level wrapper introduced
Denis Glotov [Fri, 11 Feb 2011 19:32:49 +0000 (22:32 +0300)]
MonitorSignal low-level wrapper introduced

Change-Id: I12dd3725dcd05ba5fd490d1a94575fd794aa335b

BUG=chromium-os:11121
TEST=none

Review URL: http://codereview.chromium.org/6485006

3 years agoIntroducing kPowerStateChangedSignal - system sleeping state signal
Denis Glotov [Wed, 9 Feb 2011 17:52:01 +0000 (20:52 +0300)]
Introducing kPowerStateChangedSignal - system sleeping state signal

Change-Id: Ib65aea9efe3a02d315eb18cafbd27eff29fd99a5

BUG=chromium-os:11121
TEST=none

Review URL: http://codereview.chromium.org/6463027

3 years agoAdd a char* mapping, for the new CertPath compat code in libcros.
Nathan Williams [Mon, 7 Feb 2011 14:23:29 +0000 (09:23 -0500)]
Add a char* mapping, for the new CertPath compat code in libcros.

Change-Id: Ibd966645328258c37a5b07e7d24ddba24cd03c6a

BUG=n0ne
TEST=Instlal this and libcros and run chrome.

Review URL: http://codereview.chromium.org/6396009

3 years agoCreated a dbus service called LibCrosService (for lack of a better name) that runs...
Kuan Tan [Thu, 6 Jan 2011 23:57:17 +0000 (15:57 -0800)]
Created a dbus service called LibCrosService (for lack of a better name) that runs in chrome executable.  This service currently exposes the functionality of resolving network proxies for given URLs.  If more functionalities are required from chrome later, just simply add methods to this service.  This implementation spans across several pkgs, this is the libchromeos pkg.

BUG=chromium-os:8890
TEST=none

Review URL: http://codereview.chromium.org/5022005

Change-Id: Ide271254b6b6b9906a4baa475f6149d01dd2467e

3 years agocommon: Add EmitLoginPromptVisible constant.
Daniel Erat [Thu, 16 Dec 2010 16:55:39 +0000 (08:55 -0800)]
common: Add EmitLoginPromptVisible constant.

This is the name of a D-Bus method that I'm adding to the
login manager in http://codereview.chromium.org/5858003/.

Change-Id: I6ca715a1daa1d53efec95b1d5612483bdf85d597

BUG=chromium-os:10349
TEST=none
TBR=cmasone

Review URL: http://codereview.chromium.org/5864006

4 years agolibchromeos: add RestartEntd dbus method string
Ken Mixter [Tue, 23 Nov 2010 19:17:21 +0000 (11:17 -0800)]
libchromeos: add RestartEntd dbus method string

Change-Id: I5c6039e9d13852d3cbe3f7c3e168dac2f9146668

BUG=9282
TEST=It builds

Review URL: http://codereview.chromium.org/5189003

4 years agoStop spamming to /var/log/ui/ui.LATEST.
Yusuke Sato [Sat, 23 Oct 2010 01:51:00 +0000 (10:51 +0900)]
Stop spamming to /var/log/ui/ui.LATEST.

The code path modified in this CL is used only by libcros to communicate with candidate_window. Because candidate_window process is started dynamically, the LOG(ERROR) path is taken very often.

Change-Id: Iaeea21d9d1a78b6ecbb91c83cf55286649e751df

BUG=8041
TEST=manually

Review URL: http://codereview.chromium.org/3977003

4 years agodbus: Add kRequestRestartSignal constant for power_manager
Benson Leung [Thu, 21 Oct 2010 06:23:07 +0000 (23:23 -0700)]
dbus: Add kRequestRestartSignal constant for power_manager

Adds "RequestRestart"

Change-Id: Id7ba3df8cad3df1ce47911906cadf3538d6e56ff
Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:7995
TEST=dbus-send --type=signal --system / \
 org.chromium.PowerManager.RequestRestart

Review URL: http://codereview.chromium.org/3960002

4 years agoAdd SendSignalWithNoArgumentsToSystemBus() to dbus.h
Satoru Takabayashi [Wed, 20 Oct 2010 05:50:52 +0000 (14:50 +0900)]
Add SendSignalWithNoArgumentsToSystemBus() to dbus.h

The original code is from libcros's chromeos_screen_lock.cc.
We should have this in a common place so we can use this from elsewhere.

BUG=chromium-os:5763
BUG=chromium-os:6526

Change-Id: Ia703a18b2344013a01bc136d9c8d320a45c9dedc

TEST=Confirmed that the screen locker works as before with this fucntion.

Review URL: http://codereview.chromium.org/3922003

4 years agodbus: Add power manager "BrightnessChanged" signal.
Daniel Erat [Tue, 19 Oct 2010 01:20:52 +0000 (18:20 -0700)]
dbus: Add power manager "BrightnessChanged" signal.

Change-Id: Ie530d92d3bc0233b805fe29a2c87de773a868a0a

BUG=chromium-os:4816
TEST=built it

Review URL: http://codereview.chromium.org/3804002

4 years agoAdd constants for new TpmCanAttemptOwnership API.
Frank Swiderski [Mon, 4 Oct 2010 21:58:42 +0000 (14:58 -0700)]
Add constants for new TpmCanAttemptOwnership API.

Change-Id: Ia1c4ebe37019b5aed10435625f46323a98d071d2

BUG=3065
TEST=

Review URL: http://codereview.chromium.org/3387016