1
1

Initial dump from Zyxel

This commit is contained in:
2026-04-17 17:00:52 +02:00
commit 81fec250f4
23116 changed files with 5231237 additions and 0 deletions
@@ -0,0 +1,44 @@
Index: busybox-1_20_1/loginutils/login.c
===================================================================
--- busybox-1_20_1.orig/loginutils/login.c 2018-09-03 22:20:24.831396390 +0800
+++ busybox-1_20_1/loginutils/login.c 2018-09-03 22:30:26.072598027 +0800
@@ -796,7 +796,7 @@
if (correct_password(pw)){
#ifdef ZCFG_SUPPORT
reset_authorize_fail_cnt(cur_user_idx);
-#endif
+
if (authGpPrivilege){
objIndex_t logAccountObjIid;
rdm_ZyLogCfgGpAccount_t *accountObj = NULL;
@@ -926,7 +926,7 @@
#endif
}
-
+#endif //#ifdef ZCFG_SUPPORT
break;
}
#endif /* ENABLE_PAM */
Index: busybox-1_20_1/modutils/depmod.c
===================================================================
--- busybox-1_20_1.orig/modutils/depmod.c 2018-09-03 22:21:08.863397101 +0800
+++ busybox-1_20_1/modutils/depmod.c 2018-09-03 22:33:44.606694592 +0800
@@ -14,7 +14,7 @@
#include "modutils.h"
#include <sys/utsname.h> /* uname() */
-#if 1 /* <JoannaSu>, <20180420>, <modify buffer for filepath to avoid segfault> */
+#ifdef ZCFG_SUPPORT /* <JoannaSu>, <20180420>, <modify buffer for filepath to avoid segfault> */
#include "zos_api.h"
#include "zlog_api.h"
#define ZYXEL_TMP_BASE_PATH "/var/"
@@ -129,7 +129,7 @@
static void xfreopen_write(const char *file, FILE *f)
{
-#if 1 //due to depmod can't generate file at read-only file system, so modify the path that generate file
+#ifdef ZCFG_SUPPORT //due to depmod can't generate file at read-only file system, so modify the path that generate file
#if 1 /* <JoannaSu>, <20180420>, <modify buffer for filepath to avoid segfault> */
char *modulePath = NULL;
@@ -0,0 +1,129 @@
Index: busybox-1_20_1/networking/ping.c
===================================================================
--- busybox-1_20_1.orig/networking/ping.c 2018-09-19 15:12:03.203877814 +0800
+++ busybox-1_20_1/networking/ping.c 2018-09-19 15:23:04.807263089 +0800
@@ -1011,6 +1011,7 @@
ping4(lsa);
}
}
+
#ifdef ZCFG_SUPPORT
static int common_ping(int opt)
{
@@ -1110,11 +1111,9 @@
strcat(pingscmd, param);
}
-#ifdef ZCFG_SUPPORT
if(nhost == 1)
sprintf(param, " zyxel_pings_start_%s", hostname);
else
-#endif
sprintf(param, " %s", hostname);
strcat(pingscmd, param);
@@ -1122,7 +1121,6 @@
system(pingscmd);
}
-#ifdef ZCFG_SUPPORT
static char *pingsvrs_resolvehosts(int opt, char *hostlist)
{
char *paramPtr, *paramPos;
@@ -1174,7 +1172,6 @@
return resolvhosts;
}
-#endif
static int pingsvrs_hosts(int opt, char *hostlist)
{
@@ -1211,7 +1208,7 @@
strcpy(pingsdiagstat, "pings_complete");
print_stats_and_exit(EXIT_SUCCESS);
}
-#endif
+
static int common_ping_main(int opt, char **argv)
{
char *str_s;
@@ -1238,7 +1235,6 @@
myid = (uint16_t) getpid();
-#ifdef ZCFG_SUPPORT
if(pingsvrs){
char *hosts = NULL;
char *resolvhosts = NULL;
@@ -1303,20 +1299,69 @@
}else
{
hostname = argv[optind];
-#ifdef ZCFG_SUPPORT
+
if(strstr(hostname, "zyxel_pings_start_")){
hostname += strlen("zyxel_pings_start_");
strcpy(pingsdiagstat, "pings_start");
}else{
strcpy(pingsdiagstat, "pings_host");
}
-#endif
+
common_ping(opt);
print_stats_and_exit(EXIT_SUCCESS);
}
+ /*return EXIT_SUCCESS;*/
+}
+
+#else //__zy_bsp__, withou ZCFG_SUPPORT >>>
+
+static int common_ping_main(int opt, char **argv)
+{
+ len_and_sockaddr *lsa;
+ char *str_s;
+
+ INIT_G();
+
+ /* exactly one argument needed; -v and -q don't mix; -c NUM, -t NUM, -w NUM, -W NUM */
+ opt_complementary = "=1:q--v:v--q:c+:t+:w+:W+";
+ opt |= getopt32(argv, OPT_STRING, &pingcount, &str_s, &opt_ttl, &deadline, &timeout, &str_I);
+ if (opt & OPT_s)
+ datalen = xatou16(str_s); // -s
+ if (opt & OPT_I) { // -I
+ if_index = if_nametoindex(str_I);
+ if (!if_index) {
+ /* TODO: I'm not sure it takes IPv6 unless in [XX:XX..] format */
+ source_lsa = xdotted2sockaddr(str_I, 0);
+ str_I = NULL; /* don't try to bind to device later */
+ }
+ }
+ myid = (uint16_t) getpid();
+ hostname = argv[optind];
+
+
+#if ENABLE_PING6
+ {
+ sa_family_t af = AF_UNSPEC;
+ if (opt & OPT_IPV4)
+ af = AF_INET;
+ if (opt & OPT_IPV6)
+ af = AF_INET6;
+ lsa = xhost_and_af2sockaddr(hostname, 0, af);
+ }
+#else
+ lsa = xhost_and_af2sockaddr(hostname, 0, AF_INET);
#endif
+
+ if (source_lsa && source_lsa->u.sa.sa_family != lsa->u.sa.sa_family)
+ /* leaking it here... */
+ source_lsa = NULL;
+
+ dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa);
+ ping(lsa);
+ print_stats_and_exit(EXIT_SUCCESS);
/*return EXIT_SUCCESS;*/
}
+#endif //__zy_bsp__, withou ZCFG_SUPPORT <<<
#endif /* FEATURE_FANCY_PING */
@@ -0,0 +1,58 @@
Index: busybox-1_20_1/networking/ntpd.c
===================================================================
--- busybox-1_20_1.orig/networking/ntpd.c 2012-05-28 08:48:55.000000000 +0800
+++ busybox-1_20_1/networking/ntpd.c 2018-12-27 19:01:12.460077267 +0800
@@ -1835,6 +1835,13 @@
goto bail;
}
+ /* Respond only to client and symmetric active packets */
+ if ((msg.m_status & MODE_MASK) != MODE_CLIENT
+ && (msg.m_status & MODE_MASK) != MODE_SYM_ACT
+ ) {
+ goto bail;
+ }
+
query_status = msg.m_status;
query_xmttime = msg.m_xmttime;
Index: busybox-1_20_1/testsuite/mdev.tests
===================================================================
--- busybox-1_20_1.orig/testsuite/mdev.tests 2012-05-28 08:48:55.000000000 +0800
+++ busybox-1_20_1/testsuite/mdev.tests 2018-12-27 19:08:08.878547354 +0800
@@ -11,7 +11,7 @@
# cut: remove size+date
FILTER_LS2="grep -v '^total ' | sed -e 's/, */,/g' -e 's/ */ /g' | cut -d' ' -f 1-4,9-"
-# testing "test name" "options" "expected result" "file input" "stdin"
+# testing "test name" "commands" "expected result" "file input" "stdin"
rm -rf mdev.testdir
mkdir mdev.testdir
@@ -127,6 +127,26 @@
SKIP=
# continuing to use directory structure from prev test
+rm -rf mdev.testdir/dev/*
+echo "sda 0:0 444 =disk/sd/a" >mdev.testdir/etc/mdev.conf
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME
+testing "mdev move rule '=bar/baz/fname'" \
+ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
+ ls -lnR mdev.testdir/dev | $FILTER_LS2" \
+"\
+mdev.testdir/dev:
+drwxr-xr-x 3 0 0 disk
+
+mdev.testdir/dev/disk:
+drwxr-xr-x 2 0 0 sd
+
+mdev.testdir/dev/disk/sd:
+br--r--r-- 1 0 0 a
+" \
+ "" ""
+SKIP=
+
+# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
# here we complicate things by having non-matching group 1 and using %0
echo "s([0-9])*d([a-z]+) 0:0 644 >sd/%2_%0" >mdev.testdir/etc/mdev.conf