* [Buildroot] [PATCH] package: dropbear: make PATH configurable
@ 2018-03-08 21:44 Markus Mayer
2018-03-08 21:48 ` Yann E. MORIN
2018-03-09 9:04 ` Nicolas Cavallari
0 siblings, 2 replies; 8+ messages in thread
From: Markus Mayer @ 2018-03-08 21:44 UTC (permalink / raw)
To: buildroot
Make the default PATH dropbear is using configurable.
If not specified, it will continue to default to dropbear's
DEFAULT_PATH.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
Please let me know what you think. Thanks.
package/dropbear/Config.in | 6 ++++++
package/dropbear/dropbear.mk | 8 ++++++++
2 files changed, 14 insertions(+)
diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
index 6700778161ba..d38ecf50834a 100644
--- a/package/dropbear/Config.in
+++ b/package/dropbear/Config.in
@@ -55,4 +55,10 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG
Enable logging of dropbear access to lastlog. Notice that
Buildroot does not generate lastlog by default.
+config BR2_PACKAGE_DROPBEAR_PATH
+ string "dropbear default path"
+ help
+ Use the path specified here as dropbear's default path.
+ If not specified, dropbear will use "/usr/bin:/bin".
+
endif
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 01a1a07b7696..ddbedf3bce93 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
$(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
endef
+ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
+define DROPBEAR_CUSTOM_PATH
+ $(SED) 's|^\(#define DEFAULT_PATH\).*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
+endef
+
+DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
+endif
+
define DROPBEAR_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
$(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-08 21:44 [Buildroot] [PATCH] package: dropbear: make PATH configurable Markus Mayer
@ 2018-03-08 21:48 ` Yann E. MORIN
2018-03-08 22:29 ` Markus Mayer
2018-03-09 9:04 ` Nicolas Cavallari
1 sibling, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2018-03-08 21:48 UTC (permalink / raw)
To: buildroot
Markus, All,
On 2018-03-08 13:44 -0800, Markus Mayer spake thusly:
> Make the default PATH dropbear is using configurable.
>
> If not specified, it will continue to default to dropbear's
> DEFAULT_PATH.
Isn't it better to jut let the user provide a ~/.profile file which
actually sets the PATH?
Regards,
Yann E. MORIN.
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>
> Please let me know what you think. Thanks.
>
> package/dropbear/Config.in | 6 ++++++
> package/dropbear/dropbear.mk | 8 ++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
> index 6700778161ba..d38ecf50834a 100644
> --- a/package/dropbear/Config.in
> +++ b/package/dropbear/Config.in
> @@ -55,4 +55,10 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG
> Enable logging of dropbear access to lastlog. Notice that
> Buildroot does not generate lastlog by default.
>
> +config BR2_PACKAGE_DROPBEAR_PATH
> + string "dropbear default path"
> + help
> + Use the path specified here as dropbear's default path.
> + If not specified, dropbear will use "/usr/bin:/bin".
> +
> endif
> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
> index 01a1a07b7696..ddbedf3bce93 100644
> --- a/package/dropbear/dropbear.mk
> +++ b/package/dropbear/dropbear.mk
> @@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
> $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
> endef
>
> +ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
> +define DROPBEAR_CUSTOM_PATH
> + $(SED) 's|^\(#define DEFAULT_PATH\).*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
> +endef
> +
> +DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
> +endif
> +
> define DROPBEAR_INSTALL_INIT_SYSTEMD
> $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
> $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
> --
> 2.7.4
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-08 21:48 ` Yann E. MORIN
@ 2018-03-08 22:29 ` Markus Mayer
2018-03-09 0:34 ` Christopher McCrory
0 siblings, 1 reply; 8+ messages in thread
From: Markus Mayer @ 2018-03-08 22:29 UTC (permalink / raw)
To: buildroot
On 8 March 2018 at 13:48, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Markus, All,
>
> On 2018-03-08 13:44 -0800, Markus Mayer spake thusly:
>> Make the default PATH dropbear is using configurable.
>>
>> If not specified, it will continue to default to dropbear's
>> DEFAULT_PATH.
>
> Isn't it better to jut let the user provide a ~/.profile file which
> actually sets the PATH?
That's certainly one way to do it and one can still choose to do that
for when it works.
Where we have found it helpful to change the default is for
non-interactive shells, i.e. running a command via ssh without logging
in first. If you try to do "ssh eval-board ifconfig" it'll fail,
because /sbin isn't in the path. And .profile doesn't help you.
There's an example:
$ ssh brcmstb ifconfig
sh: ifconfig: command not found
No surprise, because /sbin isn't in the PATH.
$ ssh brcmstb 'echo $PATH'
/usr/bin:/bin
But hold on. ".profile" does exist and it does add /sbin to the PATH.
Still no luck, though.
$ ssh brcmstb 'cat .profile'
PATH=/bin:/usr/bin:/sbin:/usr/sbin
Of course it works if you specify the full path.
$ ssh brcmstb /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:10:18:DD:33:10
inet addr:192.168.15.8 Bcast:192.168.15.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:364 errors:0 dropped:0 overruns:0 frame:0
TX packets:274 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:65845 (64.3 KiB) TX bytes:45749 (44.6 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
And when you log in, ".profile" does what you expect it to do. So,
".profile" works for interactive shells, but not for non-interactive
ones.
$ ssh brcmstb
# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin
Hence the idea of allowing a user to modify the DEFAULT_PATH in dropbear itself.
Regards,
-Markus
> Regards,
> Yann E. MORIN.
>
>> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
>> ---
>>
>> Please let me know what you think. Thanks.
>>
>> package/dropbear/Config.in | 6 ++++++
>> package/dropbear/dropbear.mk | 8 ++++++++
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
>> index 6700778161ba..d38ecf50834a 100644
>> --- a/package/dropbear/Config.in
>> +++ b/package/dropbear/Config.in
>> @@ -55,4 +55,10 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG
>> Enable logging of dropbear access to lastlog. Notice that
>> Buildroot does not generate lastlog by default.
>>
>> +config BR2_PACKAGE_DROPBEAR_PATH
>> + string "dropbear default path"
>> + help
>> + Use the path specified here as dropbear's default path.
>> + If not specified, dropbear will use "/usr/bin:/bin".
>> +
>> endif
>> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
>> index 01a1a07b7696..ddbedf3bce93 100644
>> --- a/package/dropbear/dropbear.mk
>> +++ b/package/dropbear/dropbear.mk
>> @@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
>> $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
>> endef
>>
>> +ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
>> +define DROPBEAR_CUSTOM_PATH
>> + $(SED) 's|^\(#define DEFAULT_PATH\).*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
>> +endef
>> +
>> +DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
>> +endif
>> +
>> define DROPBEAR_INSTALL_INIT_SYSTEMD
>> $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
>> $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
>> --
>> 2.7.4
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
> | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
> '------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-08 22:29 ` Markus Mayer
@ 2018-03-09 0:34 ` Christopher McCrory
2018-03-09 17:10 ` Christopher McCrory
0 siblings, 1 reply; 8+ messages in thread
From: Christopher McCrory @ 2018-03-09 0:34 UTC (permalink / raw)
To: buildroot
On Mar 8, 2018 2:29 PM, "Markus Mayer" <mmayer@broadcom.com> wrote:
On 8 March 2018 at 13:48, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Markus, All,
>
> On 2018-03-08 13:44 -0800, Markus Mayer spake thusly:
>> Make the default PATH dropbear is using configurable.
>>
>> If not specified, it will continue to default to dropbear's
>> DEFAULT_PATH.
>
> Isn't it better to jut let the user provide a ~/.profile file which
> actually sets the PATH?
That's certainly one way to do it and one can still choose to do that
for when it works.
Where we have found it helpful to change the default is for
non-interactive shells, i.e. running a command via ssh without logging
in first. If you try to do "ssh eval-board ifconfig" it'll fail,
because /sbin isn't in the path. And .profile doesn't help you.
There's an example:
$ ssh brcmstb ifconfig
sh: ifconfig: command not found
No surprise, because /sbin isn't in the PATH.
$ ssh brcmstb 'echo $PATH'
/usr/bin:/bin
But hold on. ".profile" does exist and it does add /sbin to the PATH.
Still no luck, though.
$ ssh brcmstb 'cat .profile'
PATH=/bin:/usr/bin:/sbin:/usr/sbin
Of course it works if you specify the full path.
$ ssh brcmstb /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:10:18:DD:33:10
inet addr:192.168.15.8 Bcast:192.168.15.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:364 errors:0 dropped:0 overruns:0 frame:0
TX packets:274 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:65845 (64.3 KiB) TX bytes:45749 (44.6 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
And when you log in, ".profile" does what you expect it to do. So,
".profile" works for interactive shells, but not for non-interactive
ones.
$ ssh brcmstb
# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin
ssh -t $host echo $PATH
Hence the idea of allowing a user to modify the DEFAULT_PATH in dropbear
itself.
Regards,
-Markus
> Regards,
> Yann E. MORIN.
>
>> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
>> ---
>>
>> Please let me know what you think. Thanks.
>>
>> package/dropbear/Config.in | 6 ++++++
>> package/dropbear/dropbear.mk | 8 ++++++++
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
>> index 6700778161ba..d38ecf50834a 100644
>> --- a/package/dropbear/Config.in
>> +++ b/package/dropbear/Config.in
>> @@ -55,4 +55,10 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG
>> Enable logging of dropbear access to lastlog. Notice that
>> Buildroot does not generate lastlog by default.
>>
>> +config BR2_PACKAGE_DROPBEAR_PATH
>> + string "dropbear default path"
>> + help
>> + Use the path specified here as dropbear's default path.
>> + If not specified, dropbear will use "/usr/bin:/bin".
>> +
>> endif
>> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
>> index 01a1a07b7696..ddbedf3bce93 100644
>> --- a/package/dropbear/dropbear.mk
>> +++ b/package/dropbear/dropbear.mk
>> @@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
>> $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
>> endef
>>
>> +ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
>> +define DROPBEAR_CUSTOM_PATH
>> + $(SED) 's|^\(#define DEFAULT_PATH\).*|\1
$(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
>> +endef
>> +
>> +DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
>> +endif
>> +
>> define DROPBEAR_INSTALL_INIT_SYSTEMD
>> $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
>> $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
>> --
>> 2.7.4
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.-
-------------------.
> | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
conspiracy: |
> | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___
|
> | +33 223 225 172 `------------.-------: X AGAINST | \e/ There
is no |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v
conspiracy. |
> '------------------------------^-------^------------------^-
-------------------'
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180308/e5021b41/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-08 21:44 [Buildroot] [PATCH] package: dropbear: make PATH configurable Markus Mayer
2018-03-08 21:48 ` Yann E. MORIN
@ 2018-03-09 9:04 ` Nicolas Cavallari
1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Cavallari @ 2018-03-09 9:04 UTC (permalink / raw)
To: buildroot
On 08/03/2018 22:44, Markus Mayer wrote:
> Make the default PATH dropbear is using configurable.
>
> If not specified, it will continue to default to dropbear's
> DEFAULT_PATH.
>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>
> Please let me know what you think. Thanks.
>
> package/dropbear/Config.in | 6 ++++++
> package/dropbear/dropbear.mk | 8 ++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
> index 6700778161ba..d38ecf50834a 100644
> --- a/package/dropbear/Config.in
> +++ b/package/dropbear/Config.in
> @@ -55,4 +55,10 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG
> Enable logging of dropbear access to lastlog. Notice that
> Buildroot does not generate lastlog by default.
>
> +config BR2_PACKAGE_DROPBEAR_PATH
> + string "dropbear default path"
> + help
> + Use the path specified here as dropbear's default path.
> + If not specified, dropbear will use "/usr/bin:/bin".
> +
> endif
> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
> index 01a1a07b7696..ddbedf3bce93 100644
> --- a/package/dropbear/dropbear.mk
> +++ b/package/dropbear/dropbear.mk
> @@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
> $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
> endef
>
> +ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
> +define DROPBEAR_CUSTOM_PATH
> + $(SED) 's|^\(#define DEFAULT_PATH\).*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
> +endef
You should probably protect this regex a bit more. It could overwrite
a future macro beginning with DEFAULT_PATH, or it could stop working
if someone add spaces between #define and DEFAULT_PATH. Such future
bugs could stay unnoticed if the compilation does not fail.
Alternatively, you could append an #undef and #define at the end of
the file, so that #undef can fails if DEFAULT_PATH does not exist anymore.
BTW, you probably know that ifconfig is deprecated, and the
replacement is 'ip a' from busybox or iproute2, which is inside /bin
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-09 0:34 ` Christopher McCrory
@ 2018-03-09 17:10 ` Christopher McCrory
2018-03-09 21:29 ` Markus Mayer
0 siblings, 1 reply; 8+ messages in thread
From: Christopher McCrory @ 2018-03-09 17:10 UTC (permalink / raw)
To: buildroot
On Thu, Mar 8, 2018 at 4:34 PM, Christopher McCrory <chrismcc@gmail.com>
wrote:
<snip>
>
> $ ssh brcmstb
> # echo $PATH
> /bin:/usr/bin:/sbin:/usr/sbin
>
>
>
>
> ssh -t $host echo $PATH
>
>
I thought that would work (forcing a term), but it doesn't
This will do what you want on your local project
$ cat output/local.mk
DROPBEAR_CONF_OPTS += --enable-foo=bar
define DROPBEAR_CUSTOM_PATH
$(SED) 's|^\(#define DEFAULT_PATH\).*|\1
"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"|'
$(@D)/options.h
endef
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
--
Christopher McCrory
To the optimist, the glass is half full.
To the pessimist, the glass is half empty.
To the engineer, the glass is twice as big as it needs to be.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180309/4ec865f7/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-09 17:10 ` Christopher McCrory
@ 2018-03-09 21:29 ` Markus Mayer
0 siblings, 0 replies; 8+ messages in thread
From: Markus Mayer @ 2018-03-09 21:29 UTC (permalink / raw)
To: buildroot
On 9 March 2018 at 09:10, Christopher McCrory <chrismcc@gmail.com> wrote:
>
> On Thu, Mar 8, 2018 at 4:34 PM, Christopher McCrory <chrismcc@gmail.com>
> wrote:
>
> <snip>
>
>>
>> $ ssh brcmstb
>> # echo $PATH
>> /bin:/usr/bin:/sbin:/usr/sbin
>>
>>
>> ssh -t $host echo $PATH
>>
>
> I thought that would work (forcing a term), but it doesn't
>
> This will do what you want on your local project
>
> $ cat output/local.mk
> DROPBEAR_CONF_OPTS += --enable-foo=bar
>
> define DROPBEAR_CUSTOM_PATH
> $(SED) 's|^\(#define DEFAULT_PATH\).*|\1
> "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"|'
> $(@D)/options.h
> endef
>
> DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
If nobody else wants to make use of this feature, we can certainly
stick it in local.mk. I figured it might be beneficial to others, as
well.
I'll create a version with a safer regexp as suggested by Nicolas, and
then I'll let the maintainers decide if this is worthwhile or not.
Regards,
-Markus
> --
> Christopher McCrory
> To the optimist, the glass is half full.
> To the pessimist, the glass is half empty.
> To the engineer, the glass is twice as big as it needs to be.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
2018-03-09 22:41 [Buildroot] [PATCH v2] " Markus Mayer
@ 2018-07-01 1:57 ` Carlos Santos
0 siblings, 0 replies; 8+ messages in thread
From: Carlos Santos @ 2018-07-01 1:57 UTC (permalink / raw)
To: buildroot
Markus Mayer wrote:
> Make the default PATH dropbear is using configurable.
>
> If not specified, it will continue to default to dropbear's
> DEFAULT_PATH.
>
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
> package/dropbear/Config.in | 6 ++++++
> package/dropbear/dropbear.mk | 8 ++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
> index 6700778161..0cc68d737d 100644
> --- a/package/dropbear/Config.in
> +++ b/package/dropbear/Config.in
> @@ -55,4 +55,10 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG
> Enable logging of dropbear access to lastlog. Notice that
> Buildroot does not generate lastlog by default.
>
> +config BR2_PACKAGE_DROPBEAR_PATH
> + string "dropbear default path"
> + help
> + Use the path specified here as dropbear's default path.
> + If not specified, dropbear will use "/usr/bin:/bin".
> +
> endif
Looks nice but it would be good to add a similar configuration for
openssl, whose default user PATH is "/usr/bin:/bin:/usr/sbin:/sbin".
In fact I believe we should make both ssh servers use the same user
PATH.
> diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
> index 01a1a07b76..9da340670a 100644
> --- a/package/dropbear/dropbear.mk
> +++ b/package/dropbear/dropbear.mk
> @@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
> $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
> endef
>
> +ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
> +define DROPBEAR_CUSTOM_PATH
> + $(SED) 's|^\(#define \+DEFAULT_PATH\)[ ]\+.*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
> +endef
> +
> +DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
> +endif
> +
> define DROPBEAR_INSTALL_INIT_SYSTEMD
> $(INSTALL) -D -m 644 package/dropbear/dropbear.service \
> $(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
This must be updated to put customised options in localoptions.h (refer
to commit 2e035a9aecc37b87a277fd53f84743a18a6f03a7).
--
Carlos Santos
DATACOM P&D
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-07-01 1:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 21:44 [Buildroot] [PATCH] package: dropbear: make PATH configurable Markus Mayer
2018-03-08 21:48 ` Yann E. MORIN
2018-03-08 22:29 ` Markus Mayer
2018-03-09 0:34 ` Christopher McCrory
2018-03-09 17:10 ` Christopher McCrory
2018-03-09 21:29 ` Markus Mayer
2018-03-09 9:04 ` Nicolas Cavallari
2018-03-09 22:41 [Buildroot] [PATCH v2] " Markus Mayer
2018-07-01 1:57 ` [Buildroot] [PATCH] " Carlos Santos
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.