diff options
Diffstat (limited to 'meta/recipes-core/dropbear')
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch | 74 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch | 22 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch | 26 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch | 17 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch | 35 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear/dropbearkey.service | 2 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear_2020.81.bb | 3 | ||||
-rw-r--r-- | meta/recipes-core/dropbear/dropbear_2025.88.bb (renamed from meta/recipes-core/dropbear/dropbear.inc) | 57 |
8 files changed, 136 insertions, 100 deletions
diff --git a/meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch b/meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch new file mode 100644 index 0000000000..967b66322f --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0001-Fix-proxycmd-without-netcat.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | From 5cc0127000db5f7567b54d0495fb91a8e452fe09 Mon Sep 17 00:00:00 2001 | ||
2 | From: Konstantin Demin <rockdrilla@gmail.com> | ||
3 | Date: Fri, 9 May 2025 22:39:35 +0300 | ||
4 | Subject: [PATCH] Fix proxycmd without netcat | ||
5 | |||
6 | fixes e5a0ef27c2 "Execute multihop commands directly, no shell" | ||
7 | |||
8 | Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> | ||
9 | |||
10 | Upstream-Status: Backport [https://github.com/mkj/dropbear/commit/5cc0127000db5f7567b54d0495fb91a8e452fe09] | ||
11 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
12 | --- | ||
13 | src/cli-main.c | 12 +++++++++++- | ||
14 | 1 file changed, 11 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/src/cli-main.c b/src/cli-main.c | ||
17 | index 2fafa88..0a052a3 100644 | ||
18 | --- a/src/cli-main.c | ||
19 | +++ b/src/cli-main.c | ||
20 | @@ -77,7 +77,11 @@ int main(int argc, char ** argv) { | ||
21 | } | ||
22 | |||
23 | #if DROPBEAR_CLI_PROXYCMD | ||
24 | - if (cli_opts.proxycmd || cli_opts.proxyexec) { | ||
25 | + if (cli_opts.proxycmd | ||
26 | +#if DROPBEAR_CLI_MULTIHOP | ||
27 | + || cli_opts.proxyexec | ||
28 | +#endif | ||
29 | + ) { | ||
30 | cli_proxy_cmd(&sock_in, &sock_out, &proxy_cmd_pid); | ||
31 | if (signal(SIGINT, kill_proxy_sighandler) == SIG_ERR || | ||
32 | signal(SIGTERM, kill_proxy_sighandler) == SIG_ERR || | ||
33 | @@ -110,11 +114,13 @@ static void shell_proxy_cmd(const void *user_data_cmd) { | ||
34 | dropbear_exit("Failed to run '%s'\n", cmd); | ||
35 | } | ||
36 | |||
37 | +#if DROPBEAR_CLI_MULTIHOP | ||
38 | static void exec_proxy_cmd(const void *unused) { | ||
39 | (void)unused; | ||
40 | run_command(cli_opts.proxyexec[0], cli_opts.proxyexec, ses.maxfd); | ||
41 | dropbear_exit("Failed to run '%s'\n", cli_opts.proxyexec[0]); | ||
42 | } | ||
43 | +#endif | ||
44 | |||
45 | static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { | ||
46 | char * cmd_arg = NULL; | ||
47 | @@ -145,9 +151,11 @@ static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { | ||
48 | cmd_arg = m_malloc(shell_cmdlen); | ||
49 | snprintf(cmd_arg, shell_cmdlen, "exec %s", cli_opts.proxycmd); | ||
50 | exec_fn = shell_proxy_cmd; | ||
51 | +#if DROPBEAR_CLI_MULTIHOP | ||
52 | } else { | ||
53 | /* No shell */ | ||
54 | exec_fn = exec_proxy_cmd; | ||
55 | +#endif | ||
56 | } | ||
57 | |||
58 | ret = spawn_command(exec_fn, cmd_arg, sock_out, sock_in, NULL, pid_out); | ||
59 | @@ -159,6 +167,7 @@ static void cli_proxy_cmd(int *sock_in, int *sock_out, pid_t *pid_out) { | ||
60 | cleanup: | ||
61 | m_free(cli_opts.proxycmd); | ||
62 | m_free(cmd_arg); | ||
63 | +#if DROPBEAR_CLI_MULTIHOP | ||
64 | if (cli_opts.proxyexec) { | ||
65 | char **a = NULL; | ||
66 | for (a = cli_opts.proxyexec; *a; a++) { | ||
67 | @@ -166,6 +175,7 @@ cleanup: | ||
68 | } | ||
69 | m_free(cli_opts.proxyexec); | ||
70 | } | ||
71 | +#endif | ||
72 | } | ||
73 | |||
74 | static void kill_proxy_sighandler(int UNUSED(signo)) { | ||
diff --git a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch index 684641dcbd..0687e5dab1 100644 --- a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch +++ b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch | |||
@@ -1,15 +1,18 @@ | |||
1 | Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h | 1 | From cdc6a4a57a86d8116a92a5d905993e65cf723556 Mon Sep 17 00:00:00 2001 |
2 | From: Richard Purdie <richard@openedhand.com> | ||
3 | Date: Wed, 31 Aug 2005 10:45:47 +0000 | ||
4 | Subject: [PATCH] urandom-xauth-changes-to-options.h | ||
2 | 5 | ||
3 | Upstream-Status: Inappropriate [configuration] | 6 | Upstream-Status: Inappropriate [configuration] |
4 | --- | 7 | --- |
5 | default_options.h | 2 +- | 8 | src/default_options.h | 2 +- |
6 | 1 file changed, 1 insertion(+), 1 deletion(-) | 9 | 1 file changed, 1 insertion(+), 1 deletion(-) |
7 | 10 | ||
8 | diff --git a/default_options.h b/default_options.h | 11 | diff --git a/src/default_options.h b/src/default_options.h |
9 | index 3b75eb8..1fd8082 100644 | 12 | index 6e970bb..ccc8b47 100644 |
10 | --- a/default_options.h | 13 | --- a/src/default_options.h |
11 | +++ b/default_options.h | 14 | +++ b/src/default_options.h |
12 | @@ -243,7 +243,7 @@ Homedir is prepended unless path begins with / */ | 15 | @@ -317,7 +317,7 @@ group1 in Dropbear server too */ |
13 | 16 | ||
14 | /* The command to invoke for xauth when using X11 forwarding. | 17 | /* The command to invoke for xauth when using X11 forwarding. |
15 | * "-q" for quiet */ | 18 | * "-q" for quiet */ |
@@ -17,7 +20,4 @@ index 3b75eb8..1fd8082 100644 | |||
17 | +#define XAUTH_COMMAND "xauth -q" | 20 | +#define XAUTH_COMMAND "xauth -q" |
18 | 21 | ||
19 | 22 | ||
20 | /* if you want to enable running an sftp server (such as the one included with | 23 | /* If you want to enable running an sftp server (such as the one included with |
21 | -- | ||
22 | 1.7.11.7 | ||
23 | |||
diff --git a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch index 857681520c..6743f506e9 100644 --- a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch +++ b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From b8cece92ba19aa77ac013ea161bfe4c7147747c9 Mon Sep 17 00:00:00 2001 | 1 | From 253ca01f0fc50dbaeb2ff8bcece0c34256eba94f Mon Sep 17 00:00:00 2001 |
2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> | 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> |
3 | Date: Wed, 2 Dec 2015 11:36:02 +0200 | 3 | Date: Wed, 2 Dec 2015 11:36:02 +0200 |
4 | Subject: Enable pam | 4 | Subject: [PATCH] Enable pam |
5 | 5 | ||
6 | We need modify file default_options.h besides enabling pam in | 6 | We need modify file default_options.h besides enabling pam in |
7 | configure if we want dropbear to support pam. | 7 | configure if we want dropbear to support pam. |
@@ -11,14 +11,14 @@ Upstream-Status: Pending | |||
11 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> | 11 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> |
12 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | 12 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
13 | --- | 13 | --- |
14 | default_options.h | 4 ++-- | 14 | src/default_options.h | 4 ++-- |
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | 15 | 1 file changed, 2 insertions(+), 2 deletions(-) |
16 | 16 | ||
17 | diff --git a/default_options.h b/default_options.h | 17 | diff --git a/src/default_options.h b/src/default_options.h |
18 | index 3b75eb8..8617cd0 100644 | 18 | index ccc8b47..12768d1 100644 |
19 | --- a/default_options.h | 19 | --- a/src/default_options.h |
20 | +++ b/default_options.h | 20 | +++ b/src/default_options.h |
21 | @@ -179,7 +179,7 @@ group1 in Dropbear server too */ | 21 | @@ -228,7 +228,7 @@ group1 in Dropbear server too */ |
22 | 22 | ||
23 | /* Authentication Types - at least one required. | 23 | /* Authentication Types - at least one required. |
24 | RFC Draft requires pubkey auth, and recommends password */ | 24 | RFC Draft requires pubkey auth, and recommends password */ |
@@ -27,16 +27,12 @@ index 3b75eb8..8617cd0 100644 | |||
27 | 27 | ||
28 | /* Note: PAM auth is quite simple and only works for PAM modules which just do | 28 | /* Note: PAM auth is quite simple and only works for PAM modules which just do |
29 | * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c). | 29 | * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c). |
30 | @@ -187,7 +187,7 @@ group1 in Dropbear server too */ | 30 | @@ -236,7 +236,7 @@ group1 in Dropbear server too */ |
31 | * but there's an interface via a PAM module. It won't work for more complex | 31 | * but there's an interface via a PAM module. It won't work for more complex |
32 | * PAM challenge/response. | 32 | * PAM challenge/response. |
33 | * You can't enable both PASSWORD and PAM. */ | 33 | * You can't enable both PASSWORD and PAM. */ |
34 | -#define DROPBEAR_SVR_PAM_AUTH 0 | 34 | -#define DROPBEAR_SVR_PAM_AUTH 0 |
35 | +#define DROPBEAR_SVR_PAM_AUTH 1 | 35 | +#define DROPBEAR_SVR_PAM_AUTH 1 |
36 | 36 | ||
37 | /* ~/.ssh/authorized_keys authentication */ | 37 | /* ~/.ssh/authorized_keys authentication. |
38 | #define DROPBEAR_SVR_PUBKEY_AUTH 1 | 38 | * You must define DROPBEAR_SVR_PUBKEY_AUTH in order to use plugins. */ |
39 | |||
40 | -- | ||
41 | 2.1.4 | ||
42 | |||
diff --git a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch index deed78ffb9..44861088cc 100644 --- a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch +++ b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From e3a5db1b6d3f6382a15b2266458c26c645a10f18 Mon Sep 17 00:00:00 2001 | 1 | From 16b147f97f0938cddb55ec1c90bc919c13f26fc0 Mon Sep 17 00:00:00 2001 |
2 | From: Mingli Yu <Mingli.Yu@windriver.com> | 2 | From: Mingli Yu <Mingli.Yu@windriver.com> |
3 | Date: Thu, 6 Sep 2018 15:54:00 +0800 | 3 | Date: Thu, 6 Sep 2018 15:54:00 +0800 |
4 | Subject: [PATCH] dropbear configuration file | 4 | Subject: [PATCH] dropbear configuration file |
@@ -12,14 +12,14 @@ Signed-off-by: Maxin B. John <maxin.john@enea.com> | |||
12 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> | 12 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> |
13 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | 13 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> |
14 | --- | 14 | --- |
15 | svr-authpam.c | 2 +- | 15 | src/svr-authpam.c | 2 +- |
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
17 | 17 | ||
18 | diff --git a/svr-authpam.c b/svr-authpam.c | 18 | diff --git a/src/svr-authpam.c b/src/svr-authpam.c |
19 | index d201bc9..165ec5c 100644 | 19 | index ec14632..026102f 100644 |
20 | --- a/svr-authpam.c | 20 | --- a/src/svr-authpam.c |
21 | +++ b/svr-authpam.c | 21 | +++ b/src/svr-authpam.c |
22 | @@ -223,7 +223,7 @@ void svr_auth_pam(int valid_user) { | 22 | @@ -224,7 +224,7 @@ void svr_auth_pam(int valid_user) { |
23 | } | 23 | } |
24 | 24 | ||
25 | /* Init pam */ | 25 | /* Init pam */ |
@@ -28,6 +28,3 @@ index d201bc9..165ec5c 100644 | |||
28 | dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", | 28 | dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", |
29 | rc, pam_strerror(pamHandlep, rc)); | 29 | rc, pam_strerror(pamHandlep, rc)); |
30 | goto cleanup; | 30 | goto cleanup; |
31 | -- | ||
32 | 2.7.4 | ||
33 | |||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch b/meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch deleted file mode 100644 index b54581f17a..0000000000 --- a/meta/recipes-core/dropbear/dropbear/dropbear-disable-weak-ciphers.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From c347ece05a7fdbf50d76cb136b9ed45caed333f6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joseph Reynolds <joseph.reynolds1@ibm.com> | ||
3 | Date: Thu, 20 Jun 2019 16:29:15 -0500 | ||
4 | Subject: [PATCH] dropbear: new feature: disable-weak-ciphers | ||
5 | |||
6 | This feature disables all CBC, SHA1, and diffie-hellman group1 ciphers | ||
7 | in the dropbear ssh server and client since they're considered weak ciphers | ||
8 | and we want to support the stong algorithms. | ||
9 | |||
10 | Upstream-Status: Inappropriate [configuration] | ||
11 | Signed-off-by: Joseph Reynolds <joseph.reynolds1@ibm.com> | ||
12 | |||
13 | --- | ||
14 | default_options.h | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/default_options.h b/default_options.h | ||
18 | index 1aa2297..7ff1394 100644 | ||
19 | --- a/default_options.h | ||
20 | +++ b/default_options.h | ||
21 | @@ -163,12 +163,12 @@ IMPORTANT: Some options will require "make clean" after changes */ | ||
22 | * Small systems should generally include either curve25519 or ecdh for performance. | ||
23 | * curve25519 is less widely supported but is faster | ||
24 | */ | ||
25 | -#define DROPBEAR_DH_GROUP14_SHA1 1 | ||
26 | +#define DROPBEAR_DH_GROUP14_SHA1 0 | ||
27 | #define DROPBEAR_DH_GROUP14_SHA256 1 | ||
28 | #define DROPBEAR_DH_GROUP16 0 | ||
29 | #define DROPBEAR_CURVE25519 1 | ||
30 | #define DROPBEAR_ECDH 1 | ||
31 | -#define DROPBEAR_DH_GROUP1 1 | ||
32 | +#define DROPBEAR_DH_GROUP1 0 | ||
33 | |||
34 | /* When group1 is enabled it will only be allowed by Dropbear client | ||
35 | not as a server, due to concerns over its strength. Set to 0 to allow | ||
diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service index 71a12a6110..501e47124f 100644 --- a/meta/recipes-core/dropbear/dropbear/dropbearkey.service +++ b/meta/recipes-core/dropbear/dropbear/dropbearkey.service | |||
@@ -9,6 +9,6 @@ Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear" | |||
9 | EnvironmentFile=-/etc/default/dropbear | 9 | EnvironmentFile=-/etc/default/dropbear |
10 | Type=oneshot | 10 | Type=oneshot |
11 | ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR} | 11 | ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR} |
12 | ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key | 12 | ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_RSAKEY_ARGS |
13 | RemainAfterExit=yes | 13 | RemainAfterExit=yes |
14 | Nice=10 | 14 | Nice=10 |
diff --git a/meta/recipes-core/dropbear/dropbear_2020.81.bb b/meta/recipes-core/dropbear/dropbear_2020.81.bb deleted file mode 100644 index c7edea84f8..0000000000 --- a/meta/recipes-core/dropbear/dropbear_2020.81.bb +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | require dropbear.inc | ||
2 | |||
3 | SRC_URI[sha256sum] = "48235d10b37775dbda59341ac0c4b239b82ad6318c31568b985730c788aac53b" | ||
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear_2025.88.bb index ed3ef3384a..72a886d907 100644 --- a/meta/recipes-core/dropbear/dropbear.inc +++ b/meta/recipes-core/dropbear/dropbear_2025.88.bb | |||
@@ -9,10 +9,8 @@ LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD" | |||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f" | 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f" |
10 | 10 | ||
11 | DEPENDS = "zlib virtual/crypt" | 11 | DEPENDS = "zlib virtual/crypt" |
12 | RPROVIDES_${PN} = "ssh sshd" | 12 | RPROVIDES:${PN} = "ssh sshd" |
13 | RCONFLICTS_${PN} = "openssh-sshd openssh" | 13 | RCONFLICTS:${PN} = "openssh-sshd openssh" |
14 | |||
15 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
16 | 14 | ||
17 | SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ | 15 | SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ |
18 | file://0001-urandom-xauth-changes-to-options.h.patch \ | 16 | file://0001-urandom-xauth-changes-to-options.h.patch \ |
@@ -21,8 +19,12 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ | |||
21 | file://dropbear@.service \ | 19 | file://dropbear@.service \ |
22 | file://dropbear.socket \ | 20 | file://dropbear.socket \ |
23 | file://dropbear.default \ | 21 | file://dropbear.default \ |
22 | file://0001-Fix-proxycmd-without-netcat.patch \ | ||
24 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ | 23 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ |
25 | ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} " | 24 | " |
25 | |||
26 | SRC_URI[sha256sum] = "783f50ea27b17c16da89578fafdb6decfa44bb8f6590e5698a4e4d3672dc53d4" | ||
27 | MIRRORS += "http://matt.ucc.asn.au/dropbear/releases/ https://dropbear.nl/mirror/releases/" | ||
26 | 28 | ||
27 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ | 29 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ |
28 | file://0006-dropbear-configuration-file.patch \ | 30 | file://0006-dropbear-configuration-file.patch \ |
@@ -33,8 +35,6 @@ PAM_PLUGINS = "libpam-runtime \ | |||
33 | pam-plugin-permit \ | 35 | pam-plugin-permit \ |
34 | pam-plugin-unix \ | 36 | pam-plugin-unix \ |
35 | " | 37 | " |
36 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}" | ||
37 | |||
38 | inherit autotools update-rc.d systemd | 38 | inherit autotools update-rc.d systemd |
39 | 39 | ||
40 | CVE_PRODUCT = "dropbear_ssh" | 40 | CVE_PRODUCT = "dropbear_ssh" |
@@ -42,25 +42,30 @@ CVE_PRODUCT = "dropbear_ssh" | |||
42 | INITSCRIPT_NAME = "dropbear" | 42 | INITSCRIPT_NAME = "dropbear" |
43 | INITSCRIPT_PARAMS = "defaults 10" | 43 | INITSCRIPT_PARAMS = "defaults 10" |
44 | 44 | ||
45 | SYSTEMD_SERVICE_${PN} = "dropbear.socket" | 45 | SYSTEMD_SERVICE:${PN} = "dropbear.socket" |
46 | 46 | ||
47 | SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" | 47 | SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" |
48 | BINCOMMANDS = "dbclient ssh scp" | 48 | BINCOMMANDS = "dbclient ssh scp" |
49 | EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' | 49 | EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' |
50 | 50 | ||
51 | PACKAGECONFIG ?= "disable-weak-ciphers" | 51 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam x11', d)}" |
52 | PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam,${PAM_PLUGINS}" | ||
52 | PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" | 53 | PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt" |
53 | PACKAGECONFIG[disable-weak-ciphers] = "" | 54 | PACKAGECONFIG[x11] = ",,,,xauth" |
54 | |||
55 | EXTRA_OECONF += "\ | ||
56 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" | ||
57 | 55 | ||
58 | # This option appends to CFLAGS and LDFLAGS from OE | 56 | # This option appends to CFLAGS and LDFLAGS from OE |
59 | # This is causing [textrel] QA warning | 57 | # This is causing [textrel] QA warning |
60 | EXTRA_OECONF += "--disable-harden" | 58 | EXTRA_OECONF += "--disable-harden" |
61 | 59 | ||
62 | # musl does not implement wtmp/logwtmp APIs | 60 | # musl does not implement wtmp/logwtmp APIs |
63 | EXTRA_OECONF_append_libc-musl = " --disable-wtmp --disable-lastlog" | 61 | EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" |
62 | |||
63 | do_configure:append() { | ||
64 | echo "/* Dropbear features */" > ${B}/localoptions.h | ||
65 | if ${@bb.utils.contains('PACKAGECONFIG', 'x11', 'true', 'false', d)}; then | ||
66 | echo "#define DROPBEAR_X11FWD 1" >> ${B}/localoptions.h | ||
67 | fi | ||
68 | } | ||
64 | 69 | ||
65 | do_install() { | 70 | do_install() { |
66 | install -d ${D}${sysconfdir} \ | 71 | install -d ${D}${sysconfdir} \ |
@@ -71,7 +76,7 @@ do_install() { | |||
71 | ${D}${sbindir} \ | 76 | ${D}${sbindir} \ |
72 | ${D}${localstatedir} | 77 | ${D}${localstatedir} |
73 | 78 | ||
74 | install -m 0644 ${WORKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear | 79 | install -m 0644 ${UNPACKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear |
75 | 80 | ||
76 | install -m 0755 dropbearmulti ${D}${sbindir}/ | 81 | install -m 0755 dropbearmulti ${D}${sbindir}/ |
77 | 82 | ||
@@ -89,32 +94,32 @@ do_install() { | |||
89 | -e 's,/usr/sbin,${sbindir},g' \ | 94 | -e 's,/usr/sbin,${sbindir},g' \ |
90 | -e 's,/var,${localstatedir},g' \ | 95 | -e 's,/var,${localstatedir},g' \ |
91 | -e 's,/usr/bin,${bindir},g' \ | 96 | -e 's,/usr/bin,${bindir},g' \ |
92 | -e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear | 97 | -e 's,/usr,${prefix},g' ${UNPACKDIR}/init > ${D}${sysconfdir}/init.d/dropbear |
93 | chmod 755 ${D}${sysconfdir}/init.d/dropbear | 98 | chmod 755 ${D}${sysconfdir}/init.d/dropbear |
94 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then | 99 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then |
95 | install -d ${D}${sysconfdir}/pam.d | 100 | install -d ${D}${sysconfdir}/pam.d |
96 | install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/ | 101 | install -m 0644 ${UNPACKDIR}/dropbear ${D}${sysconfdir}/pam.d/ |
97 | fi | 102 | fi |
98 | 103 | ||
99 | # deal with systemd unit files | 104 | # deal with systemd unit files |
100 | install -d ${D}${systemd_unitdir}/system | 105 | install -d ${D}${systemd_system_unitdir} |
101 | install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system | 106 | install -m 0644 ${UNPACKDIR}/dropbearkey.service ${D}${systemd_system_unitdir} |
102 | install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system | 107 | install -m 0644 ${UNPACKDIR}/dropbear@.service ${D}${systemd_system_unitdir} |
103 | install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system | 108 | install -m 0644 ${UNPACKDIR}/dropbear.socket ${D}${systemd_system_unitdir} |
104 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | 109 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
105 | -e 's,@BINDIR@,${bindir},g' \ | 110 | -e 's,@BINDIR@,${bindir},g' \ |
106 | -e 's,@SBINDIR@,${sbindir},g' \ | 111 | -e 's,@SBINDIR@,${sbindir},g' \ |
107 | ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service | 112 | ${D}${systemd_system_unitdir}/dropbear.socket ${D}${systemd_system_unitdir}/*.service |
108 | } | 113 | } |
109 | 114 | ||
110 | inherit update-alternatives | 115 | inherit update-alternatives |
111 | 116 | ||
112 | ALTERNATIVE_PRIORITY = "20" | 117 | ALTERNATIVE_PRIORITY = "20" |
113 | ALTERNATIVE_${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}" | 118 | ALTERNATIVE:${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}" |
114 | 119 | ||
115 | ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" | 120 | ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" |
116 | 121 | ||
117 | pkg_postrm_append_${PN} () { | 122 | pkg_postrm:${PN} () { |
118 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then | 123 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then |
119 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key | 124 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key |
120 | fi | 125 | fi |
@@ -123,4 +128,6 @@ pkg_postrm_append_${PN} () { | |||
123 | fi | 128 | fi |
124 | } | 129 | } |
125 | 130 | ||
126 | FILES_${PN} += "${bindir}" | 131 | CONFFILES:${PN} = "${sysconfdir}/default/dropbear" |
132 | |||
133 | FILES:${PN} += "${systemd_system_unitdir}/dropbearkey.service" | ||