OpenWrt Forum Archive

Topic: Modify existing program (dropbear)

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have the svn image of whiterussian and can build it and use the image ok. All I want to do is modify a c file in dropbear (to allow external connections to a forwarded port, not just from localhost). Is there a make target from the top level that will rebuild the dropbear package? When I run just "make" or "make dropbear" I never see anything compile in the dropbear area. What is the correct way to do this?

Ok, figured it out myself, it think. Looks like you have to add the approrpriate patch file for the change you want into openwrt/package/dropbear/patches and remove the package and the expanded/patched source directory, e.g.,
cd openwrt
rm openwrt/packages/dropbear*
rm -rf openwrt/build_mipsel/dropbear*
make
Now have new/improved dropbear pkg, and rebuilt images as a side-effect.
Possibly the SDK provides a better way to just modify a package?

Mat Johnston (Dropbear author) made a fix for this in 0.47 per a request I made for exactly this same thing.

>On Thu, Mar 09, 2006 at 10:05:51AM -0500, David Cook wrote:
>> I have used the following command to create a tunnel for rsync between
>> the OpenWRT box running dropbear and my server.
>> /usr/bin/ssh -i ${SSH_host_key} -p ${SSH_port} ${SSH_server} -l
>> ${SSH_user} -L 873:${LAN_IP}:873 "keepalive ${Customer}" &
>>
>> (I am running a small program "keepalive" on the server to poll the
>> device periodically so NAT tables don't go stale).
>>
>> Even though I specify the lan address (192.168.1.1) the tunnel only
>> appears to work from the originating host by rsyncing to 127.0.0.1.
>> I want to have other devices on the lan rsync to 192.168.1.1 so that my
>> remote rsync server appears to be the gateway on the lan.
>>
>> What am I doing wrong or is this even possible?
>
>Does giving the -a option to dropbear (added in 0.47) do
>what you want? That'll make it listen on all interfaces, not
>just localhost.
>
>Cheers,
>Matt

I found 0.47 in the default packages list but had to install it manually as there is both .45-x & .47-x in the directory but the script only sees the .45 version.

FYI, Matt released 0.48 this morning.

>I've also updated scp to the latest OpenSSH version, fixing
>a security issue.
>
>http://matt.ucc.asn.au/dropbear/releases/dropbear-0.48.tar.gz
>
>Matt
>
>
>0.48 - Thurs 9 March 2006
>
>- Check that the circular buffer is properly empty before
>  closing a channel, which could cause truncated transfers
>  (thanks to Tomas Vanek for helping track it down)
>
>- Implement per-IP pre-authentication connection limits
>  (after some poking from Pablo Fernandez)
>
>- Exit gracefully if trying to connect to as SSH v1 server
>  (reported by Rushi Lala)
>
>- Only read /dev/random once at startup when in non-inetd mode
>
>- Allow ctrl-c to close a dbclient password prompt (may
>  still have to press enter on some platforms)
>
>- Merged in uClinux patch for inetd mode
>
>- Updated to scp from OpenSSH 4.3p2 - fixes a security issue
>  where use of system() could cause users to execute arbitrary
>  code through malformed filenames, ref CVE-2006-0225
>

dbc.

The discussion might have continued from here.