M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,29 @@
Upstream-Status: Pending
Index: dropbear-0.49/configure.in
===================================================================
--- dropbear-0.49.orig/configure.in
+++ dropbear-0.49/configure.in
@@ -164,14 +164,20 @@ AC_ARG_ENABLE(openpty,
AC_MSG_NOTICE(Not using openpty)
else
AC_MSG_NOTICE(Using openpty if available)
- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
+ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
fi
],
[
AC_MSG_NOTICE(Using openpty if available)
- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
+ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
]
)
+
+if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
+ AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
+ no_ptc_check=yes
+ no_ptmx_check=yes
+fi
AC_ARG_ENABLE(syslog,
@@ -0,0 +1,98 @@
DESCRIPTION = "Dropbear is a lightweight SSH and SCP implementation"
HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
SECTION = "console/network"
# some files are from other projects and have others license terms:
# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3a5b0c2f0d0c49dfde9558ae2036683c"
DEPENDS = "zlib"
RPROVIDES = "ssh sshd"
DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.gz \
file://urandom-xauth-changes-to-options.h.patch \
file://dropbear-0.53.1-static_build_fix.patch \
file://configure.patch \
file://fix-2kb-keys.patch \
file://allow-nopw.patch;apply=no \
file://init \
${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
PAM_SRC_URI = "file://dropbear-enable-pam.patch \
file://dropbear-configuration-file.patch \
file://dropbear"
inherit autotools update-rc.d
INITSCRIPT_NAME = "dropbear"
INITSCRIPT_PARAMS = "defaults 10"
CFLAGS_prepend = " -I. "
LD = "${CC}"
SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
BINCOMMANDS = "dbclient ssh scp"
EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
EXTRA_OECONF += "\
${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
DISTRO_TYPE ?= "${@base_contains("IMAGE_FEATURES", "debug-tweaks", "debug", "",d)}"
do_debug_patch() {
if [ "${DISTRO_TYPE}" = "debug" ]; then
bbnote "WARNING: applying allow-nopw.patch which allows password-less logins!"
patch -p1 < ${WORKDIR}/allow-nopw.patch
fi
}
addtask do_debug_patch after do_patch before do_configure
do_install() {
install -d ${D}${sysconfdir} \
${D}${sysconfdir}/init.d \
${D}${sysconfdir}/default \
${D}${sysconfdir}/dropbear \
${D}${bindir} \
${D}${sbindir} \
${D}${localstatedir}
install -m 0755 dropbearmulti ${D}${sbindir}/
ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
for i in ${SBINCOMMANDS}
do
ln -s ./dropbearmulti ${D}${sbindir}/$i
done
cat ${WORKDIR}/init | sed -e 's,/etc,${sysconfdir},g' \
-e 's,/usr/sbin,${sbindir},g' \
-e 's,/var,${localstatedir},g' \
-e 's,/usr/bin,${bindir},g' \
-e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear
chmod 755 ${D}${sysconfdir}/init.d/dropbear
for i in ${DISTRO_FEATURES};
do
if [ ${i} = "pam" ]; then
install -d ${D}${sysconfdir}/pam.d
install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
fi
done
}
pkg_postinst_${PN} () {
update-alternatives --install ${bindir}/scp scp ${sbindir}/dropbearmulti 20
update-alternatives --install ${bindir}/ssh ssh ${sbindir}/dropbearmulti 20
}
pkg_postrm_append_${PN} () {
if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
fi
if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
rm ${sysconfdir}/dropbear/dropbear_dss_host_key
fi
update-alternatives --remove ssh ${bindir}/dropbearmulti
update-alternatives --remove scp ${bindir}/dropbearmulti
}
@@ -0,0 +1,19 @@
Enable blank password login function for new release dropbear.
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Mei Lei <lei.mei@intel.com>
diff --git a/options.h b/options.h
index 73689ad..041ddaa 100644
--- a/options.h
+++ b/options.h
@@ -180,7 +180,7 @@ much traffic. */
* Public key logins are allowed for blank-password accounts regardless of this
* setting. PAM is not affected by this setting, it uses the normal pam.d
* settings ('nullok' option) */
-/* #define ALLOW_BLANK_PASSWORD */
+#define ALLOW_BLANK_PASSWORD
#define ENABLE_CLI_PASSWORD_AUTH
#define ENABLE_CLI_PUBKEY_AUTH
@@ -0,0 +1,4 @@
#%PAM-1.0
auth include common-auth
account include common-account
@@ -0,0 +1,58 @@
Upstream-Status: Submitted
dropbear: fix static build
A more appropriate fix is to remove @CRYPTLIB@ from the objs
line, since it will cause problems with target checking,
this change also meets the goals of the orignal change which
was to not link libcrypt to all binaries.
svr-authpasswd.o: In function `svr_auth_password':
svr-authpasswd.c:(.text+0xfc): undefined reference to `crypt'
collect2: ld returned 1 exit status
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Index: dropbear-2011.54/Makefile.in
===================================================================
--- dropbear-2011.54.orig/Makefile.in 2011-11-08 04:48:15.000000000 -0800
+++ dropbear-2011.54/Makefile.in 2011-12-27 13:44:41.644354442 -0800
@@ -56,7 +56,7 @@
loginrec.h atomicio.h x11fwd.h agentfwd.h tcpfwd.h compat.h \
listener.h fake-rfc2553.h
-dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS) @CRYPTLIB@
+dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS)
dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS)
dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS)
dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS)
@@ -158,7 +158,10 @@
dropbearkey: $(dropbearkeyobjs)
dropbearconvert: $(dropbearconvertobjs)
-dropbear dbclient dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile
+dropbear: $(HEADERS) $(LIBTOM_DEPS) Makefile
+ $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBS) @CRYPTLIB@
+
+dbclient dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile
$(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBS)
# scp doesn't use the libs so is special.
@@ -169,14 +172,14 @@
# multi-binary compilation.
MULTIOBJS=
ifeq ($(MULTI),1)
- MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs))) @CRYPTLIB@
+ MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs)))
CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI
endif
dropbearmulti: multilink
multibinary: $(HEADERS) $(MULTIOBJS) $(LIBTOM_DEPS) Makefile
- $(CC) $(LDFLAGS) -o dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
+ $(CC) $(LDFLAGS) -o dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS) @CRYPTLIB@
multilink: multibinary $(addprefix link, $(PROGRAMS))
@@ -0,0 +1,18 @@
dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
--- a/svr-authpam.c 2008-11-11 22:09:03.000000000 +0800
+++ b/svr-authpam.c.new 2011-08-29 09:53:24.000000000 +0800
@@ -199,7 +199,7 @@
userData.passwd = password;
/* Init pam */
- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s\n",
rc, pam_strerror(pamHandlep, rc));
goto cleanup;
@@ -0,0 +1,22 @@
dropbear: We need modify file option.h besides enabling pam in \
configure if we want dropbear to support pam.
Upstream-Status: Pending
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
--- a/options.h 2011-07-12 13:27:39.008819183 +0800
+++ b/options.h.new 2011-07-12 13:37:37.780819308 +0800
@@ -149,9 +149,9 @@
* but there's an interface via a PAM module - don't bother using it otherwise.
* You can't enable both PASSWORD and PAM. */
-#define ENABLE_SVR_PASSWORD_AUTH
+//#define ENABLE_SVR_PASSWORD_AUTH
/* PAM requires ./configure --enable-pam */
-/*#define ENABLE_SVR_PAM_AUTH*/
+#define ENABLE_SVR_PAM_AUTH
#define ENABLE_SVR_PUBKEY_AUTH
/* Wether to ake public key options in authorized_keys file into account */
@@ -0,0 +1,13 @@
Upstream-Status: Inappropriate [configuration]
diff -Nurd dropbear-0.45/kex.h dropbear-0.45.patched/kex.h
--- dropbear-0.45/kex.h 2005-03-06 20:27:02.000000000 -0800
+++ dropbear-0.45.patched/kex.h 2005-03-08 15:22:44.064583279 -0800
@@ -64,6 +64,6 @@
};
-#define MAX_KEXHASHBUF 2000
+#define MAX_KEXHASHBUF 3000
#endif /* _KEX_H_ */
+106
View File
@@ -0,0 +1,106 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $remote_fs $syslog $networking
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Dropbear Secure Shell server
### END INIT INFO
#
# Do not configure this file. Edit /etc/default/dropbear instead!
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dropbear
NAME=dropbear
DESC="Dropbear SSH server"
DROPBEAR_PORT=22
DROPBEAR_EXTRA_ARGS=
NO_START=0
set -e
test ! -r /etc/default/dropbear || . /etc/default/dropbear
test "$NO_START" = "0" || exit 0
test -x "$DAEMON" || exit 0
test ! -h /var/service/dropbear || exit 0
readonly_rootfs=0
for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
case $flag in
ro)
readonly_rootfs=1
;;
esac
done
if [ $readonly_rootfs = "1" ]; then
mkdir -p /var/lib/dropbear
DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
else
DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
fi
test -z "$DROPBEAR_BANNER" || \
DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
test -n "$DROPBEAR_RSAKEY" || \
DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
test -n "$DROPBEAR_DSSKEY" || \
DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
test -n "$DROPBEAR_KEYTYPES" || \
DROPBEAR_KEYTYPES="rsa"
gen_keys() {
for t in $DROPBEAR_KEYTYPES; do
case $t in
rsa)
test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
;;
dsa)
test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
;;
esac
done
}
case "$1" in
start)
echo -n "Starting $DESC: "
gen_keys
KEY_ARGS=""
test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
start-stop-daemon -S \
-x "$DAEMON" -- $KEY_ARGS \
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon -K -x "$DAEMON"
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon -K -x "$DAEMON"
sleep 1
KEY_ARGS=""
test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
start-stop-daemon -S \
-x "$DAEMON" -- $KEY_ARGS \
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
diff --git a/options.h b/options.h
index d309ab4..7fbe97b 100644
--- a/options.h
+++ b/options.h
@@ -236,7 +236,7 @@ much traffic. */
/* The command to invoke for xauth when using X11 forwarding.
* "-q" for quiet */
#ifndef XAUTH_COMMAND
-#define XAUTH_COMMAND "/usr/bin/X11/xauth -q"
+#define XAUTH_COMMAND "xauth -q"
#endif
/* if you want to enable running an sftp server (such as the one included with
@@ -0,0 +1,6 @@
require dropbear.inc
SRC_URI[md5sum] = "ce1e236c4a8df0cb95253defee6716b5"
SRC_URI[sha256sum] = "a5fe60fa9c11e7b0f6a21ef6e86a53ce3d55236548901905070ff1c1716fbf47"
PR = "r1"