mcst-linux-kernel/patches-2024.06.26/ucspi-tcp-0.88/0000-init.add.patch

326 lines
9.6 KiB
Diff

diff -ruaN ucspi-tcp-0.88/auto_home.c my_ucspi-tcp-0.88/auto_home.c
--- ucspi-tcp-0.88/auto_home.c 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/auto_home.c 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1,3 @@
+char auto_home[] = "\
+\057\165\163\162\
+";
diff -ruaN ucspi-tcp-0.88/chkshsgr.c my_ucspi-tcp-0.88/chkshsgr.c
--- ucspi-tcp-0.88/chkshsgr.c 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/chkshsgr.c 2024-04-23 16:03:09.211077507 +0300
@@ -1,8 +1,11 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <grp.h>
#include "exit.h"
main()
{
- short x[4];
+ gid_t x[4];
x[0] = x[1] = 0;
if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
diff -ruaN ucspi-tcp-0.88/commands.h my_ucspi-tcp-0.88/commands.h
--- ucspi-tcp-0.88/commands.h 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/commands.h 2024-04-23 16:03:09.211077507 +0300
@@ -3,7 +3,7 @@
struct commands {
char *verb;
- void (*action)(char *);
+ void (*action)();
void (*flush)(void);
} ;
diff -ruaN ucspi-tcp-0.88/conf-home my_ucspi-tcp-0.88/conf-home
--- ucspi-tcp-0.88/conf-home 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/conf-home 2024-04-23 16:03:09.211077507 +0300
@@ -1,4 +1,4 @@
-/usr/local
+/usr
This is the ucspi-tcp home directory. Programs will be installed in
.../bin.
diff -ruaN ucspi-tcp-0.88/error.h my_ucspi-tcp-0.88/error.h
--- ucspi-tcp-0.88/error.h 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/error.h 2024-04-23 16:03:09.211077507 +0300
@@ -1,7 +1,8 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+/*extern int errno;*/
+#include <errno.h>
extern int error_intr;
extern int error_nomem;
diff -ruaN ucspi-tcp-0.88/find-systype.sh my_ucspi-tcp-0.88/find-systype.sh
--- ucspi-tcp-0.88/find-systype.sh 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/find-systype.sh 2024-04-23 16:03:09.211077507 +0300
@@ -14,6 +14,9 @@
# and i386-486 (486s do have more instructions, you know) as well as i386.
# the idea here is to include ALL useful available information.
+echo "linux-2.6.5-:elbrus-:-:-:-"
+exit 0;
+
exec 2>/dev/null
sys="`uname -s | tr '/:[A-Z]' '..[a-z]'`"
diff -ruaN ucspi-tcp-0.88/fork.h my_ucspi-tcp-0.88/fork.h
--- ucspi-tcp-0.88/fork.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/fork.h 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1,9 @@
+#ifndef FORK_H
+#define FORK_H
+
+/* sysdep: +vfork */
+
+extern int fork();
+extern int vfork();
+
+#endif
diff -ruaN ucspi-tcp-0.88/hassgact.h my_ucspi-tcp-0.88/hassgact.h
--- ucspi-tcp-0.88/hassgact.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/hassgact.h 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1,2 @@
+/* sysdep: +sigaction */
+#define HASSIGACTION 1
diff -ruaN ucspi-tcp-0.88/hassgprm.h my_ucspi-tcp-0.88/hassgprm.h
--- ucspi-tcp-0.88/hassgprm.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/hassgprm.h 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1,2 @@
+/* sysdep: +sigprocmask */
+#define HASSIGPROCMASK 1
diff -ruaN ucspi-tcp-0.88/hasshsgr.h my_ucspi-tcp-0.88/hasshsgr.h
--- ucspi-tcp-0.88/hasshsgr.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/hasshsgr.h 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1 @@
+/* sysdep: -shortsetgroups */
diff -ruaN ucspi-tcp-0.88/haswaitp.h my_ucspi-tcp-0.88/haswaitp.h
--- ucspi-tcp-0.88/haswaitp.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/haswaitp.h 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1,2 @@
+/* sysdep: +waitpid */
+#define HASWAITPID 1
diff -ruaN ucspi-tcp-0.88/iopause.h my_ucspi-tcp-0.88/iopause.h
--- ucspi-tcp-0.88/iopause.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/iopause.h 2024-04-23 16:03:09.207077415 +0300
@@ -0,0 +1,19 @@
+#ifndef IOPAUSE_H
+#define IOPAUSE_H
+
+/* sysdep: -poll */
+
+typedef struct {
+ int fd;
+ short events;
+ short revents;
+} iopause_fd;
+
+#define IOPAUSE_READ 1
+#define IOPAUSE_WRITE 4
+
+#include "taia.h"
+
+extern void iopause(iopause_fd *,unsigned int,struct taia *,struct taia *);
+
+#endif
diff -ruaN ucspi-tcp-0.88/Makefile my_ucspi-tcp-0.88/Makefile
--- ucspi-tcp-0.88/Makefile 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/Makefile 2024-04-23 16:05:51.106778980 +0300
@@ -1,5 +1,6 @@
# Don't edit Makefile! Use conf-* for configuration.
+PREFIX=/usr
SHELL=/bin/sh
default: it
@@ -38,7 +39,9 @@
auto_home.c: \
auto-str conf-home
- ./auto-str auto_home `head -1 conf-home` > auto_home.c
+ printf 'char auto_home[] = "\\\n\\057\\165\\163\\162\\\n";\n' > auto_home.c
+
+# ./auto-str auto_home `head -1 conf-home` > auto_home.c
auto_home.o: \
compile auto_home.c
@@ -158,8 +161,8 @@
compile: \
warn-auto.sh conf-cc
- ( cat warn-auto.sh; \
- echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \
+ (printf "$(CC) -c ";\
+ printf '$${1+"$$@"}\n' \
) > compile
chmod 755 compile
@@ -328,8 +331,8 @@
hasshsgr.h: \
choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 chkshsgr \
warn-shsgr
- ./chkshsgr || ( cat warn-shsgr; exit 1 )
./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
+# returns 0 ./chkshsgr || ( cat warn-shsgr; exit 1 )
haswaitp.h: \
choose compile load trywaitp.c haswaitp.h1 haswaitp.h2
@@ -346,9 +349,15 @@
> http@
chmod 755 http@
-install: \
-load install.o hier.o auto_home.o unix.a byte.a
- ./load install hier.o auto_home.o unix.a byte.a
+install:
+ mkdir -p ${PREFIX}/bin
+ cp tcpserver tcprules tcprulescheck argv0 recordio tcpclient who@ date@ finger@ http@ \
+ tcpcat mconnect mconnect-io addcr delcr fixcrio rblsmtpd ${PREFIX}/bin
+
+
+
+#load install.o hier.o auto_home.o unix.a byte.a
+# ./load install hier.o auto_home.o unix.a byte.a
install.o: \
compile install.c buffer.h strerr.h error.h open.h readwrite.h exit.h
@@ -379,13 +388,13 @@
./compile ip4_scan.c
it: \
-prog install instcheck
+prog instcheck
load: \
warn-auto.sh conf-ld
( cat warn-auto.sh; \
echo 'main="$$1"; shift'; \
- echo exec "`head -1 conf-ld`" \
+ echo exec $(CC) \
'-o "$$main" "$$main".o $${1+"$$@"}' \
) > load
chmod 755 load
@@ -395,7 +404,7 @@
( cat warn-auto.sh; \
echo 'main="$$1"; shift'; \
echo 'rm -f "$$main"'; \
- echo 'ar cr "$$main" $${1+"$$@"}'; \
+ echo '$(AR) cr "$$main" $${1+"$$@"}'; \
case "`cat systype`" in \
sunos-5.*) ;; \
unix_sv*) ;; \
@@ -404,7 +413,7 @@
dgux-*) ;; \
hp-ux-*) ;; \
sco*) ;; \
- *) echo 'ranlib "$$main"' ;; \
+ *) echo '$(RANLIB) "$$main"' ;; \
esac \
) > makelib
chmod 755 makelib
@@ -835,3 +844,5 @@
| sed s}HOME}"`head -1 conf-home`"}g \
> who@
chmod 755 who@
+
+.PHONY: compile install
diff -ruaN ucspi-tcp-0.88/select.h my_ucspi-tcp-0.88/select.h
--- ucspi-tcp-0.88/select.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/select.h 2024-04-23 16:03:09.211077507 +0300
@@ -0,0 +1,11 @@
+#ifndef SELECT_H
+#define SELECT_H
+
+/* sysdep: +sysselect */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/select.h>
+extern int select();
+
+#endif
diff -ruaN ucspi-tcp-0.88/socket_accept.c my_ucspi-tcp-0.88/socket_accept.c
--- ucspi-tcp-0.88/socket_accept.c 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/socket_accept.c 2024-04-23 16:03:09.211077507 +0300
@@ -8,7 +8,7 @@
int socket_accept4(int s,char ip[4],uint16 *port)
{
struct sockaddr_in sa;
- int dummy = sizeof sa;
+ socklen_t dummy = sizeof sa;
int fd;
fd = accept(s,(struct sockaddr *) &sa,&dummy);
diff -ruaN ucspi-tcp-0.88/socket_conn.c my_ucspi-tcp-0.88/socket_conn.c
--- ucspi-tcp-0.88/socket_conn.c 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/socket_conn.c 2024-04-23 16:03:09.211077507 +0300
@@ -21,7 +21,7 @@
int socket_connected(int s)
{
struct sockaddr_in sa;
- int dummy;
+ socklen_t dummy;
char ch;
dummy = sizeof sa;
diff -ruaN ucspi-tcp-0.88/socket_local.c my_ucspi-tcp-0.88/socket_local.c
--- ucspi-tcp-0.88/socket_local.c 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/socket_local.c 2024-04-23 16:03:09.211077507 +0300
@@ -8,7 +8,7 @@
int socket_local4(int s,char ip[4],uint16 *port)
{
struct sockaddr_in sa;
- int dummy = sizeof sa;
+ socklen_t dummy = sizeof sa;
if (getsockname(s,(struct sockaddr *) &sa,&dummy) == -1) return -1;
byte_copy(ip,4,(char *) &sa.sin_addr);
diff -ruaN ucspi-tcp-0.88/socket_remote.c my_ucspi-tcp-0.88/socket_remote.c
--- ucspi-tcp-0.88/socket_remote.c 2000-03-18 18:18:42.000000000 +0300
+++ my_ucspi-tcp-0.88/socket_remote.c 2024-04-23 16:03:09.231077964 +0300
@@ -8,7 +8,7 @@
int socket_remote4(int s,char ip[4],uint16 *port)
{
struct sockaddr_in sa;
- int dummy = sizeof sa;
+ socklen_t dummy = sizeof sa;
if (getpeername(s,(struct sockaddr *) &sa,&dummy) == -1) return -1;
byte_copy(ip,4,(char *) &sa.sin_addr);
diff -ruaN ucspi-tcp-0.88/systype my_ucspi-tcp-0.88/systype
--- ucspi-tcp-0.88/systype 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/systype 2024-04-23 16:03:09.211077507 +0300
@@ -0,0 +1 @@
+linux-2.6.5-:elbrus-:-:-:-
diff -ruaN ucspi-tcp-0.88/uint32.h my_ucspi-tcp-0.88/uint32.h
--- ucspi-tcp-0.88/uint32.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/uint32.h 2024-04-23 16:03:09.211077507 +0300
@@ -0,0 +1,11 @@
+#ifndef UINT32_H
+#define UINT32_H
+
+typedef unsigned int uint32;
+
+extern void uint32_pack(char *,uint32);
+extern void uint32_pack_big(char *,uint32);
+extern void uint32_unpack(char *,uint32 *);
+extern void uint32_unpack_big(char *,uint32 *);
+
+#endif
diff -ruaN ucspi-tcp-0.88/uint64.h my_ucspi-tcp-0.88/uint64.h
--- ucspi-tcp-0.88/uint64.h 1970-01-01 03:00:00.000000000 +0300
+++ my_ucspi-tcp-0.88/uint64.h 2024-04-23 16:03:09.211077507 +0300
@@ -0,0 +1,8 @@
+#ifndef UINT64_H
+#define UINT64_H
+
+/* sysdep: -ulong64 */
+
+typedef unsigned long long uint64;
+
+#endif