Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcp: fixed OS Login enabling #1445

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/bugfixes/2023-11-30-gce-oslogin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- GCP: Fixed OS Login enabling ([scripts#1445](https://github.com/flatcar/scripts/pull/1445))
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Before=sshd.socket

[Service]
Type=oneshot
RemainAfterExit=true

ExecStart=/oem/bin/enable-oslogin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ insert_include() {
local src_config="${1}" options="${2}" includedir="${3}"
local name copy regexp_options regexp lineno comment_options

if [[ ! "${includedir}" =~ ^/.* ]]; then
die "includir must be an absolute path (i.e, starting with /). Got: ${includedir}"
fi

name=${src_config##*/}
copy="${T}/${name}"
cp -a "${src_config}" "${copy}" || die
Expand All @@ -251,7 +255,7 @@ insert_include() {
head -n "${lineno}" "${copy}" || die
cat <<-EOF || die
# Make sure that all ${comment_options} options are below this Include!
Include "${EPREFIX}/${includedir}/*.conf"
Include "${EPREFIX}${includedir}/*.conf"

EOF
tail -n "+${lineno}" "${copy}" || die
Expand Down
Loading