OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS 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 echo "Adding mock Google Accounts server certs." | 7 echo "Adding mock Google Accounts server certs." |
8 | 8 |
9 # TODO(cmasone): Generate these on the fly? | 9 # TODO(cmasone): Generate these on the fly? |
10 CERT_DIR="${GCLIENT_ROOT}/src/platform/login_manager" | 10 CERT_DIR="${GCLIENT_ROOT}/src/platform/login_manager" |
11 CERT_NAME="mock_server" | 11 CERT_NAME="mock_server" |
12 | 12 |
13 cat "${CERT_DIR}/${CERT_NAME}.key" > "${ROOT_FS_DIR}/etc/${CERT_NAME}.key" | 13 cat "${CERT_DIR}/${CERT_NAME}.key" > "${ROOT_FS_DIR}/etc/${CERT_NAME}.key" |
14 | 14 |
15 # Sadly, our fake cert HAS to be first in this file. | 15 # Sadly, our fake cert HAS to be first in this file. |
16 TMPFILE=$(mktemp) | 16 TMPFILE=$(mktemp) |
17 CERT_FILE="${ROOT_FS_DIR}/etc/login_trust_root.pem" | 17 CERT_FILE="${ROOT_FS_DIR}/etc/login_trust_root.pem" |
| 18 PERMS=$(stat --printf="%a" "${CERT_FILE}") |
18 cat "${CERT_DIR}/${CERT_NAME}.pem" "${CERT_FILE}" > "${TMPFILE}" | 19 cat "${CERT_DIR}/${CERT_NAME}.pem" "${CERT_FILE}" > "${TMPFILE}" |
19 mv -f "${TMPFILE}" "${CERT_FILE}" | 20 mv -f "${TMPFILE}" "${CERT_FILE}" |
| 21 chmod "${PERMS}" "${CERT_FILE}" |
OLD | NEW |