OLD | NEW |
1 #!/bin/bash -p | 1 #!/bin/bash -p |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Called as root before Keystone ticket promotion to ensure a suitable | 7 # Called as root before Keystone ticket promotion to ensure a suitable |
8 # environment for Keystone installation. Ultimately, these features should be | 8 # environment for Keystone installation. Ultimately, these features should be |
9 # integrated directly into the Keystone installation. | 9 # integrated directly into the Keystone installation. |
10 # | 10 # |
11 # If the two branding paths are given, then the branding information is also | 11 # If the two branding paths are given, then the branding information is also |
12 # copied and the permissions on the system branding file are set to be owned by | 12 # copied and the permissions on the system branding file are set to be owned by |
13 # root, but readable by anyone. | 13 # root, but readable by anyone. |
14 # | 14 # |
15 # Note that this script will be invoked with the real user ID set to the | 15 # Note that this script will be invoked with the real user ID set to the |
16 # user's ID, but the effective user ID set to 0 (root). bash -p is used on | 16 # user's ID, but the effective user ID set to 0 (root). bash -p is used on |
17 # the first line to prevent bash from setting the effective user ID to the | 17 # the first line to prevent bash from setting the effective user ID to the |
18 # real user ID (dropping root privileges). | 18 # real user ID (dropping root privileges). |
19 # | 19 # |
20 # TODO(mark): Remove this script when able. See http://b/2285921 and | 20 # TODO(mark): Remove this script when able. See http://b/2285921 and |
21 # http://b/2289908. | 21 # http://b/2289908. |
22 | 22 |
23 set -e | 23 set -e |
24 | 24 |
25 # This script runs as root, so be paranoid about things like ${PATH}. | 25 # This script runs as root, so be paranoid about things like ${PATH}. |
26 export PATH="/usr/bin:/usr/sbin:/bin:/sbin" | 26 export PATH="/usr/bin:/usr/sbin:/bin:/sbin" |
27 | 27 |
28 # Output the pid to stdout before doing anything else. See | 28 # Output the pid to stdout before doing anything else. See |
29 # chrome/browser/mac/authorization_util.h. | 29 # base/mac/authorization_util.h. |
30 echo "${$}" | 30 echo "${$}" |
31 | 31 |
32 if [ ${#} -ne 0 ] && [ ${#} -ne 2 ] ; then | 32 if [ ${#} -ne 0 ] && [ ${#} -ne 2 ] ; then |
33 echo "usage: ${0} [USER_BRAND SYSTEM_BRAND]" >& 2 | 33 echo "usage: ${0} [USER_BRAND SYSTEM_BRAND]" >& 2 |
34 exit 2 | 34 exit 2 |
35 fi | 35 fi |
36 | 36 |
37 if [ ${#} -eq 2 ] ; then | 37 if [ ${#} -eq 2 ] ; then |
38 USER_BRAND="${1}" | 38 USER_BRAND="${1}" |
39 SYSTEM_BRAND="${2}" | 39 SYSTEM_BRAND="${2}" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 # pass to fix the permissions on any symbolic links. | 88 # pass to fix the permissions on any symbolic links. |
89 find "${LIB_GOOG_GSU}" -type l -exec chmod -h "${CHMOD_MODE}" {} + >& \ | 89 find "${LIB_GOOG_GSU}" -type l -exec chmod -h "${CHMOD_MODE}" {} + >& \ |
90 /dev/null | 90 /dev/null |
91 | 91 |
92 # TODO(mark): If GoogleSoftwareUpdate.bundle is missing, dump TicketStore | 92 # TODO(mark): If GoogleSoftwareUpdate.bundle is missing, dump TicketStore |
93 # too? | 93 # too? |
94 fi | 94 fi |
95 fi | 95 fi |
96 | 96 |
97 exit 0 | 97 exit 0 |
OLD | NEW |