diff options
author | Kit <2726-kit@users.gitlab.alpinelinux.org> | 2020-05-27 02:32:24 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2020-05-29 10:02:33 +0000 |
commit | 299a1c1afb07fab3c57f60a3545e60492a9c496b (patch) | |
tree | dd11cdf09eea8d81442dc82d8fcf4731fa3e35a1 | |
parent | d924c05aa4f8e643279bee47ba55d1d04b6a1097 (diff) | |
download | alpine_aports-299a1c1afb07fab3c57f60a3545e60492a9c496b.tar.bz2 alpine_aports-299a1c1afb07fab3c57f60a3545e60492a9c496b.tar.xz alpine_aports-299a1c1afb07fab3c57f60a3545e60492a9c496b.zip |
main/openrc: fix parsing quoted kernel options in firstboot
Quoted kernel options in /proc/cmdline look like this:
modules=something "ssh_key=ssh-rsa foobar user@foo" quiet
Without the eval this would be parsed as: opt='modules=something'
opt='"ssh_key=ssh-rsa' opt='foobar' opt='user@foo"' opt='quiet'
With the eval in this branch the options are parsed correctly.
Since ssh keys need spaces and therefor must be quoted, passing ssh_key
by kernel option cannot work as currently implemented.
fixes #9504
-rw-r--r-- | main/openrc/APKBUILD | 4 | ||||
-rw-r--r-- | main/openrc/firstboot.initd | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD index 7a14dd5878..41aa574c62 100644 --- a/main/openrc/APKBUILD +++ b/main/openrc/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | pkgname=openrc | 2 | pkgname=openrc |
3 | pkgver=0.42.1 | 3 | pkgver=0.42.1 |
4 | _ver=${pkgver/_git*/} | 4 | _ver=${pkgver/_git*/} |
5 | pkgrel=9 | 5 | pkgrel=10 |
6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" | 6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" |
7 | url="https://github.com/OpenRC/openrc" | 7 | url="https://github.com/OpenRC/openrc" |
8 | arch="all" | 8 | arch="all" |
@@ -133,5 +133,5 @@ c1615dbeb18e2f988237ecbef830a01fd79970365a799e8704abefab9c716ab45553b3c15f1e3d24 | |||
133 | e945859bee6d0ddcfe1897df3af22b80ac1f5a93308bb8dd7b2dafe145bdb16d25b2a9ec627a7b5e8d7a6f458403fcacd914c981c4a38b736c8ffa258a5bfd6b networking.initd | 133 | e945859bee6d0ddcfe1897df3af22b80ac1f5a93308bb8dd7b2dafe145bdb16d25b2a9ec627a7b5e8d7a6f458403fcacd914c981c4a38b736c8ffa258a5bfd6b networking.initd |
134 | 80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd | 134 | 80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd |
135 | d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd | 135 | d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd |
136 | f65b061b4272463071022e88a7392d5573f2d95f91e42c8b4f3ef69171604460ddd3d426dfbab382f73a3fac68d4b4ff3a923fdc49fb6fd9f27ebd3ab24e0d0e firstboot.initd | 136 | 3371527b2c67cacbb68db54fcb4322e8b7cc7edfd83c648a56156865f1d0d671b91e310de82b1f33ab3ca6136922d2466d1f3632bd3111323e7f3975fce79a88 firstboot.initd |
137 | 2d5f9f6d41b7c0a8643cfdee1ce3c399bfe4ebff54421f33ab1e74c1c4c1b96a49e54b5cd69f0339a060342e4e5a11067bbff68c39fa487919259d73e8e46ed1 sysctl.initd" | 137 | 2d5f9f6d41b7c0a8643cfdee1ce3c399bfe4ebff54421f33ab1e74c1c4c1b96a49e54b5cd69f0339a060342e4e5a11067bbff68c39fa487919259d73e8e46ed1 sysctl.initd" |
diff --git a/main/openrc/firstboot.initd b/main/openrc/firstboot.initd index 27f2c1f374..9376905959 100644 --- a/main/openrc/firstboot.initd +++ b/main/openrc/firstboot.initd | |||
@@ -4,7 +4,8 @@ | |||
4 | 4 | ||
5 | # read kernel options | 5 | # read kernel options |
6 | init_KOPT() { | 6 | init_KOPT() { |
7 | for opt in $(cat /proc/cmdline 2>/dev/null); do | 7 | eval "set -- $(cat /proc/cmdline 2>/dev/null)" |
8 | for opt; do | ||
8 | case "$opt" in | 9 | case "$opt" in |
9 | ssh_*=*) | 10 | ssh_*=*) |
10 | eval "KOPT_${opt%%=*}='${opt#*=}'" ;; | 11 | eval "KOPT_${opt%%=*}='${opt#*=}'" ;; |