create core package
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
--- tcp_wrappers_7.6/tcpd.c.bug11881 Thu Jul 27 15:39:27 2000
|
||||
+++ tcp_wrappers_7.6/tcpd.c Thu Jul 27 15:41:54 2000
|
||||
@@ -60,10 +60,10 @@
|
||||
*/
|
||||
|
||||
if (argv[0][0] == '/') {
|
||||
- strcpy(path, argv[0]);
|
||||
+ strncpy(path, argv[0], sizeof(path));
|
||||
argv[0] = strrchr(argv[0], '/') + 1;
|
||||
} else {
|
||||
- sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
|
||||
+ snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
--- tcp_wrappers_7.6/eval.c.bug11881 Thu Jul 27 15:39:53 2000
|
||||
+++ tcp_wrappers_7.6/eval.c Thu Jul 27 15:40:51 2000
|
||||
@@ -111,7 +111,7 @@
|
||||
return (hostinfo);
|
||||
#endif
|
||||
if (STR_NE(eval_user(request), unknown)) {
|
||||
- sprintf(both, "%s@%s", request->user, hostinfo);
|
||||
+ snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo);
|
||||
return (both);
|
||||
} else {
|
||||
return (hostinfo);
|
||||
@@ -128,7 +128,7 @@
|
||||
char *daemon = eval_daemon(request);
|
||||
|
||||
if (STR_NE(host, unknown)) {
|
||||
- sprintf(both, "%s@%s", daemon, host);
|
||||
+ snprintf(both, sizeof(both), "%s@%s", daemon, host);
|
||||
return (both);
|
||||
} else {
|
||||
return (daemon);
|
||||
@@ -0,0 +1,49 @@
|
||||
--- hosts_access.c Wed Feb 12 03:13:23 1997
|
||||
+++ hosts_access.c Wed Jul 19 08:37:02 2000
|
||||
@@ -240,6 +255,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
+/* hostfile_match - look up host patterns from file */
|
||||
+
|
||||
+static int hostfile_match(path, host)
|
||||
+char *path;
|
||||
+struct hosts_info *host;
|
||||
+{
|
||||
+ char tok[BUFSIZ];
|
||||
+ int match = NO;
|
||||
+ FILE *fp;
|
||||
+
|
||||
+ if ((fp = fopen(path, "r")) != 0) {
|
||||
+ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
|
||||
+ /* void */ ;
|
||||
+ fclose(fp);
|
||||
+ } else if (errno != ENOENT) {
|
||||
+ tcpd_warn("open %s: %m", path);
|
||||
+ }
|
||||
+ return (match);
|
||||
+}
|
||||
+
|
||||
/* host_match - match host name and/or address against pattern */
|
||||
|
||||
static int host_match(tok, host)
|
||||
@@ -267,6 +302,8 @@
|
||||
tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */
|
||||
return (NO);
|
||||
#endif
|
||||
+ } else if (tok[0] == '/') { /* /file hack */
|
||||
+ return (hostfile_match(tok, host));
|
||||
} else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
|
||||
char *name = eval_hostname(host);
|
||||
return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
|
||||
--- hosts_access.5 2003-08-03 19:09:56.000000000 +0000
|
||||
+++ hosts_access.5 2003-08-03 19:13:32.000000000 +0000
|
||||
@@ -91,0 +92,7 @@
|
||||
+.IP \(bu
|
||||
+A string that begins with a `/\' character is treated as a file
|
||||
+name. A host name or address is matched if it matches any host name
|
||||
+or address pattern listed in the named file. The file format is
|
||||
+zero or more lines with zero or more host name or address patterns
|
||||
+separated by whitespace. A file name pattern can be used anywhere
|
||||
+a host name or address pattern can be used.
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
--- /tmp/hosts_access.c 2003-08-03 22:18:00.000000000 +0000
|
||||
+++ hosts_access.c 2003-08-03 22:39:44.000000000 +0000
|
||||
@@ -289,6 +289,17 @@
|
||||
{
|
||||
int n;
|
||||
|
||||
+#ifndef DISABLE_WILDCARD_MATCHING
|
||||
+ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
|
||||
+ /* we must convert the both to lowercase as match_pattern_ylo is case-sensitive */
|
||||
+ for (n = 0; n < strlen(tok); n++)
|
||||
+ tok[n] = isupper(tok[n]) ? tolower(tok[n]) : tok[n];
|
||||
+ for (n = 0; n < strlen(string); n++)
|
||||
+ string[n] = isupper(string[n]) ? tolower(string[n]) : string[n];
|
||||
+ return (match_pattern_ylo(string,tok));
|
||||
+ } else
|
||||
+#endif
|
||||
+
|
||||
if (tok[0] == '.') { /* suffix */
|
||||
n = strlen(string) - strlen(tok);
|
||||
return (n > 0 && STR_EQ(tok, string + n));
|
||||
@@ -329,3 +340,72 @@
|
||||
}
|
||||
return ((addr & mask) == net);
|
||||
}
|
||||
+
|
||||
+#ifndef DISABLE_WILDCARD_MATCHING
|
||||
+/* Note: this feature has been adapted in a pretty straightforward way
|
||||
+ from Tatu Ylonen's last SSH version under free license by
|
||||
+ Pekka Savola <pekkas@netcore.fi>.
|
||||
+
|
||||
+ Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
+*/
|
||||
+
|
||||
+/* Returns true if the given string matches the pattern (which may contain
|
||||
+ ? and * as wildcards), and zero if it does not match. */
|
||||
+
|
||||
+int match_pattern_ylo(const char *s, const char *pattern)
|
||||
+{
|
||||
+ while (1)
|
||||
+ {
|
||||
+ /* If at end of pattern, accept if also at end of string. */
|
||||
+ if (!*pattern)
|
||||
+ return !*s;
|
||||
+
|
||||
+ /* Process '*'. */
|
||||
+ if (*pattern == '*')
|
||||
+ {
|
||||
+ /* Skip the asterisk. */
|
||||
+ pattern++;
|
||||
+
|
||||
+ /* If at end of pattern, accept immediately. */
|
||||
+ if (!*pattern)
|
||||
+ return 1;
|
||||
+
|
||||
+ /* If next character in pattern is known, optimize. */
|
||||
+ if (*pattern != '?' && *pattern != '*')
|
||||
+ {
|
||||
+ /* Look instances of the next character in pattern, and try
|
||||
+ to match starting from those. */
|
||||
+ for (; *s; s++)
|
||||
+ if (*s == *pattern &&
|
||||
+ match_pattern_ylo(s + 1, pattern + 1))
|
||||
+ return 1;
|
||||
+ /* Failed. */
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Move ahead one character at a time and try to match at each
|
||||
+ position. */
|
||||
+ for (; *s; s++)
|
||||
+ if (match_pattern_ylo(s, pattern))
|
||||
+ return 1;
|
||||
+ /* Failed. */
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* There must be at least one more character in the string. If we are
|
||||
+ at the end, fail. */
|
||||
+ if (!*s)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Check if the next character of the string is acceptable. */
|
||||
+ if (*pattern != '?' && *pattern != *s)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Move to the next character, both in string and in pattern. */
|
||||
+ s++;
|
||||
+ pattern++;
|
||||
+ }
|
||||
+ /*NOTREACHED*/
|
||||
+}
|
||||
+#endif /* DISABLE_WILDCARD_MATCHING */
|
||||
+
|
||||
@@ -0,0 +1,27 @@
|
||||
--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
|
||||
+++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
|
||||
@@ -52,7 +52,8 @@
|
||||
char *name;
|
||||
{
|
||||
char dot_name[MAXHOSTNAMELEN + 1];
|
||||
-
|
||||
+ struct hostent *hp;
|
||||
+
|
||||
/*
|
||||
* Don't append dots to unqualified names. Such names are likely to come
|
||||
* from local hosts files or from NIS.
|
||||
@@ -61,8 +62,12 @@
|
||||
if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
|
||||
return (gethostbyname(name));
|
||||
} else {
|
||||
- sprintf(dot_name, "%s.", name);
|
||||
- return (gethostbyname(dot_name));
|
||||
+ sprintf(dot_name, "%s.", name);
|
||||
+ hp = gethostbyname(dot_name);
|
||||
+ if (hp)
|
||||
+ return hp;
|
||||
+ else
|
||||
+ return (gethostbyname(name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
--- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100
|
||||
@@ -66,6 +66,7 @@
|
||||
|
||||
#define YES 1
|
||||
#define NO 0
|
||||
+#define ERR -1
|
||||
|
||||
/*
|
||||
* These variables are globally visible so that they can be redirected in
|
||||
@@ -106,7 +107,6 @@
|
||||
struct request_info *request;
|
||||
{
|
||||
int verdict;
|
||||
-
|
||||
/*
|
||||
* If the (daemon, client) pair is matched by an entry in the file
|
||||
* /etc/hosts.allow, access is granted. Otherwise, if the (daemon,
|
||||
@@ -129,9 +129,9 @@
|
||||
return (verdict == AC_PERMIT);
|
||||
if (table_match(hosts_allow_table, request))
|
||||
return (YES);
|
||||
- if (table_match(hosts_deny_table, request))
|
||||
- return (NO);
|
||||
- return (YES);
|
||||
+ if (table_match(hosts_deny_table, request) == NO)
|
||||
+ return (YES);
|
||||
+ return (NO);
|
||||
}
|
||||
|
||||
/* table_match - match table entries with (daemon, client) pair */
|
||||
@@ -175,6 +175,7 @@
|
||||
(void) fclose(fp);
|
||||
} else if (errno != ENOENT) {
|
||||
tcpd_warn("cannot open %s: %m", table);
|
||||
+ match = ERR;
|
||||
}
|
||||
if (match) {
|
||||
if (hosts_access_verbose > 1)
|
||||
@@ -0,0 +1,27 @@
|
||||
--- tcp-wrappers-7.6/percent_m.c
|
||||
+++ tcp-wrappers-7.6/percent_m.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <string.h>
|
||||
|
||||
extern int errno;
|
||||
-#ifndef SYS_ERRLIST_DEFINED
|
||||
+#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
#endif
|
||||
@@ -29,11 +29,15 @@
|
||||
|
||||
while (*bp = *cp)
|
||||
if (*cp == '%' && cp[1] == 'm') {
|
||||
+#ifdef HAVE_STRERROR
|
||||
+ strcpy(bp, strerror(errno));
|
||||
+#else
|
||||
if (errno < sys_nerr && errno > 0) {
|
||||
strcpy(bp, sys_errlist[errno]);
|
||||
} else {
|
||||
sprintf(bp, "Unknown error %d", errno);
|
||||
}
|
||||
+#endif
|
||||
bp += strlen(bp);
|
||||
cp += 2;
|
||||
} else {
|
||||
@@ -0,0 +1,12 @@
|
||||
diff -udrN tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6_modified/scaffold.c
|
||||
--- tcp_wrappers_7.6/scaffold.c 2004-04-20 23:35:41.971925008 +0000
|
||||
+++ tcp_wrappers_7.6_modified/scaffold.c 2004-04-20 23:44:28.553872384 +0000
|
||||
@@ -25,7 +25,7 @@
|
||||
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */
|
||||
#endif
|
||||
|
||||
-extern char *malloc();
|
||||
+
|
||||
|
||||
/* Application-specific. */
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
--- tcp_wrappers_7.6/options.c
|
||||
+++ tcp_wrappers_7.6/options.c
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
--- tcp_wrappers_7.6/safe_finger.c
|
||||
+++ tcp_wrappers_7.6/safe_finger.c
|
||||
@@ -20,6 +20,10 @@
|
||||
|
||||
/* System libraries */
|
||||
|
||||
+#include <unistd.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
@@ -27,7 +31,7 @@
|
||||
#include <ctype.h>
|
||||
#include <pwd.h>
|
||||
|
||||
-extern void exit();
|
||||
+int pipe_stdin(char **argv);
|
||||
|
||||
/* Local stuff */
|
||||
|
||||
--- tcp_wrappers_7.6/scaffold.c
|
||||
+++ tcp_wrappers_7.6/scaffold.c
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
--- tcp_wrappers_7.6/shell_cmd.c
|
||||
+++ tcp_wrappers_7.6/shell_cmd.c
|
||||
@@ -14,6 +14,10 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <signal.h>
|
||||
@@ -25,8 +25,6 @@
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
|
||||
-extern void exit();
|
||||
-
|
||||
/* Local stuff. */
|
||||
|
||||
#include "tcpd.h"
|
||||
--- tcp_wrappers_7.6/tcpdchk.c
|
||||
+++ tcp_wrappers_7.6/tcpdchk.c
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef INET6
|
||||
@@ -35,11 +36,6 @@
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
|
||||
-extern int errno;
|
||||
-extern void exit();
|
||||
-extern int optind;
|
||||
-extern char *optarg;
|
||||
-
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */
|
||||
#endif
|
||||
--- tcp_wrappers_7.6/clean_exit.c
|
||||
+++ tcp_wrappers_7.6/clean_exit.c
|
||||
@@ -13,8 +13,8 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
-
|
||||
-extern void exit();
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
#include "tcpd.h"
|
||||
|
||||
--- tcp_wrappers_7.6/hosts_access.c
|
||||
+++ tcp_wrappers_7.6/hosts_access.c
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef INT32_T
|
||||
typedef uint32_t u_int32_t;
|
||||
@@ -43,8 +44,7 @@
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
-extern char *fgets();
|
||||
-extern int errno;
|
||||
+int match_pattern_ylo(const char *s, const char *pattern);
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */
|
||||
--- tcp_wrappers_7.6/inetcf.c
|
||||
+++ tcp_wrappers_7.6/inetcf.c
|
||||
@@ -9,15 +9,14 @@
|
||||
static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
|
||||
#endif
|
||||
|
||||
+#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
-extern int errno;
|
||||
-extern void exit();
|
||||
-
|
||||
+#include "scaffold.h"
|
||||
#include "tcpd.h"
|
||||
#include "inetcf.h"
|
||||
|
||||
--- tcp_wrappers_7.6/percent_x.c
|
||||
+++ tcp_wrappers_7.6/percent_x.c
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
|
||||
-extern void exit();
|
||||
-
|
||||
/* Local stuff. */
|
||||
|
||||
#include "tcpd.h"
|
||||
--- tcp_wrappers_7.6/rfc931.c
|
||||
+++ tcp_wrappers_7.6/rfc931.c
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <sys/types.h>
|
||||
--- tcp_wrappers_7.6/tcpd.c
|
||||
+++ tcp_wrappers_7.6/tcpd.c
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
--- tcp_wrappers_7.6/tcpdmatch.c
|
||||
+++ tcp_wrappers_7.6/tcpdmatch.c
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
/* System libraries. */
|
||||
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -30,9 +32,6 @@
|
||||
#include <setjmp.h>
|
||||
#include <string.h>
|
||||
|
||||
-extern void exit();
|
||||
-extern int optind;
|
||||
-extern char *optarg;
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE (-1) /* XXX should be 0xffffffff */
|
||||
--- tcp_wrappers_7.6/update.c
|
||||
+++ tcp_wrappers_7.6/update.c
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
/* System libraries */
|
||||
|
||||
+#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <string.h>
|
||||
@@ -0,0 +1,332 @@
|
||||
diff -ur tcp_wrappers_7.6-orig/Makefile tcp_wrappers_7.6/Makefile
|
||||
--- tcp_wrappers_7.6-orig/Makefile 2005-09-24 02:43:14.000000000 +0300
|
||||
+++ tcp_wrappers_7.6/Makefile 2005-09-24 14:24:31.972087120 +0300
|
||||
@@ -91,31 +91,31 @@
|
||||
# This is good for many BSD+SYSV hybrids with NIS (formerly YP).
|
||||
generic aix osf alpha dynix:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# Ditto, with vsyslog
|
||||
sunos4:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP VSYSLOG= TLI= all
|
||||
|
||||
# Generic with resolver library.
|
||||
generic-resolver:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS=-lresolv RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ LIBS=-lresolv RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# The NeXT loader needs "-m" or it barfs on redefined library functions.
|
||||
next:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS=-m RANLIB=ranlib ARFLAGS=rv AUX_OBJ=environ.o \
|
||||
+ LIBS=-m RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# SunOS for the 386 was frozen at release 4.0.x.
|
||||
sunos40:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ="setenv.o strcasecmp.o" \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP VSYSLOG= TLI= all
|
||||
|
||||
# Ultrix is like aix, next, etc., but has miscd and setenv().
|
||||
@@ -127,61 +127,61 @@
|
||||
# This works on EP/IX 1.4.3 and will likely work on Mips (reggers@julian.uwo.ca)
|
||||
epix:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=environ.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all
|
||||
|
||||
# Freebsd and linux by default have no NIS.
|
||||
386bsd netbsd bsdos:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
|
||||
|
||||
freebsd:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
|
||||
|
||||
linux:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
|
||||
|
||||
# This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
|
||||
hpux hpux8 hpux9 hpux10:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=echo ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ LIBS= RANLIB=echo ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# ConvexOS-10.x with UltraNet support (ukkonen@csc.fi).
|
||||
convex-ultranet:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS=-lulsock RANLIB=ranlib ARFLAGS=rv AUX_OBJ=environ.o \
|
||||
+ LIBS=-lulsock RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# Generic support for the Dynix/PTX version of TLI.
|
||||
ptx-generic:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -linet -lnsl" RANLIB=echo ARFLAGS=rv \
|
||||
- AUX_OBJ="setenv.o strcasecmp.o ptx.o" NETGROUP= TLI=-DPTX all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# With UDP support optimized for PTX 2.x (timw@sequent.com).
|
||||
ptx-2.x:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -linet -lnsl" RANLIB=echo ARFLAGS=rv \
|
||||
- AUX_OBJ="setenv.o strcasecmp.o tli-sequent.o" NETGROUP= \
|
||||
+ AUX_OBJ= \
|
||||
TLI=-DTLI_SEQUENT all
|
||||
|
||||
# IRIX 4.0.x has a special ar(1) flag.
|
||||
irix4:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS="-lc -lsun" RANLIB=echo ARFLAGS=rvs AUX_OBJ=setenv.o \
|
||||
+ LIBS="-lc -lsun" RANLIB=echo ARFLAGS=rvs AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# IRIX 5.2 is SYSV4 with several broken things (such as -lsocket -lnsl).
|
||||
irix5:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS=-lsun RANLIB=echo ARFLAGS=rv VSYSLOG= \
|
||||
- NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI= all
|
||||
+ NETGROUP=-DNETGROUP AUX_OBJ= \
|
||||
|
||||
# IRIX 6.2 (tucker@math.unc.edu). Must find a better value than 200000.
|
||||
irix6:
|
||||
@@ -193,101 +193,101 @@
|
||||
sunos5:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \
|
||||
- NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
|
||||
+ NETGROUP=-DNETGROUP AUX_OBJ= \
|
||||
BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all
|
||||
|
||||
# Generic SYSV40
|
||||
esix sysv4:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI all
|
||||
+ NETGROUP=-DNETGROUP AUX_OBJ= \
|
||||
|
||||
# DG/UX 5.4.1 and 5.4.2 have an unusual inet_addr() interface.
|
||||
dgux:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS=-lnsl RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
|
||||
+ NETGROUP=-DNETGROUP AUX_OBJ= \
|
||||
BUGS="$(BUGS) -DINET_ADDR_BUG" all
|
||||
|
||||
dgux543:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS=-lnsl RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI all
|
||||
+ NETGROUP=-DNETGROUP AUX_OBJ= \
|
||||
|
||||
# NCR UNIX 02.02.01 and 02.03.00 (Alex Chircop, msu@unimt.mt)
|
||||
ncrsvr4:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lresolv -lnsl -lsocket" RANLIB=echo ARFLAGS=rv \
|
||||
- AUX_OBJ="setenv.o strcasecmp.o" NETGROUP= TLI=-DTLI \
|
||||
+ AUX_OBJ= \
|
||||
EXTRA_CFLAGS="" FROM_OBJ=ncr.o all
|
||||
|
||||
# Tandem SYSV4 (eqawas@hedgehog.ac.cowan.edu.au)
|
||||
tandem:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP= AUX_OBJ="setenv.o strcasecmp.o" TLI=-DTLI all
|
||||
+ NETGROUP= AUX_OBJ= \
|
||||
|
||||
# Amdahl UTS 2.1.5 (Richard.Richmond@bridge.bst.bls.com)
|
||||
uts215:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket" RANLIB=echo \
|
||||
- ARFLAGS=rv AUX_OBJ=setenv.o NETGROUP=-DNO_NETGROUP TLI= all
|
||||
+ ARFLAGS=rv AUX_OBJ= \
|
||||
|
||||
# UXP/DS System V.4 clone (vic@uida0.uida.es).
|
||||
uxp:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-L/usr/ucblib -lsocket -lnsl -lucb" \
|
||||
RANLIB=echo ARFLAGS=rv NETGROUP=-DNETGROUP \
|
||||
- AUX_OBJ=setenv.o TLI="-DTLI -DDRS_XTI" all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# DELL System V.4 Issue 2.2 using gcc (kim@tac.nyc.ny.us, jurban@norden1.com)
|
||||
dell-gcc:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl" RANLIB=ranlib ARFLAGS=rv CC=gcc \
|
||||
- AUX_OBJ="setenv.o strcasecmp.o" TLI=-DTLI all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# SCO 3.2v4.1 no frills (jedwards@sol1.solinet.net).
|
||||
sco:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl_s" RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP= AUX_OBJ=setenv.o TLI= all
|
||||
+ NETGROUP= AUX_OBJ= \
|
||||
|
||||
# SCO OpenDesktop 2.0, release 3.2 (peter@midnight.com). Please simplify.
|
||||
sco-od2:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lrpcsvc -lrpc -lyp -lrpc -lrpcsvc -lsocket" \
|
||||
- RANLIB=echo ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ RANLIB=echo ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= all
|
||||
|
||||
# SCO 3.2v4.2 with TCP/IP 1.2.1 (Eduard.Vopicka@vse.cz). Please simplify.
|
||||
sco-nis:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lyp -lrpc -lsocket -lyp -lc_s -lc" \
|
||||
- RANLIB=echo ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ RANLIB=echo ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= EXTRA_CFLAGS="-nointl -DNO_NETGRENT" all
|
||||
|
||||
# SCO 3.2v5.0.0 OpenServer 5 (bob@odt.handy.com, bill@razorlogic.com)
|
||||
sco-os5:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lrpcsvc -lsocket" RANLIB=echo ARFLAGS=rv VSYSLOG= \
|
||||
- AUX_OBJ=setenv.o NETGROUP=-DNETGROUP TLI= all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# sinix 5.42 setjmp workaround (szrzs023@ub3.ub.uni-kiel.de)
|
||||
sinix:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl -L/usr/ccs/lib -lc -L/usr/ucblib -lucb" \
|
||||
- RANLIB=echo ARFLAGS=rv AUX_OBJ=setenv.o TLI=-DTLI all
|
||||
+ RANLIB=echo ARFLAGS=rv AUX_OBJ= \
|
||||
|
||||
# Domain SR10.4. Build under bsd, run under either sysv3 or bsd43.
|
||||
apollo:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= SYSTYPE="-A run,any -A sys,any" all
|
||||
|
||||
# Pyramid OSx 5.1, using the BSD universe.
|
||||
pyramid:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ="environ.o vfprintf.o" \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
STRINGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
|
||||
NETGROUP="-DNETGROUP -DUSE_GETDOMAIN" TLI= all
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
mips:
|
||||
@echo "Warning: some definitions may be wrong."
|
||||
make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=environ.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP=-DNETGROUP TLI= SYSTYPE="-sysname bsd43" all
|
||||
|
||||
# Cray (tested with UNICOS 7.0.4).
|
||||
@@ -303,60 +303,60 @@
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS=-lnet RANLIB=echo ARFLAGS=rv \
|
||||
EXTRA_CFLAGS=-DINADDR_NONE="\"((unsigned long) -1)\"" \
|
||||
- AUX_OBJ="setenv.o strcasecmp.o" NETGROUP= TLI= all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# Unicos 8.x, Cray-YMP (Bruce Kelly).
|
||||
unicos8:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS= RANLIB=echo AR=bld ARFLAGS=rv \
|
||||
- AUX_OBJ= NETGROUP= TLI= all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# Power_UNIX 2.1.1 (amantel@lerc.nasa.gov)
|
||||
power_unix_211:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lnsl -lsocket -lgen -lresolv" RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP= AUX_OBJ=setenv.o TLI=-DTLI BUGS="$(BUGS)" all
|
||||
+ NETGROUP= AUX_OBJ= \
|
||||
|
||||
# ISC (fc@all.net)
|
||||
isc:
|
||||
make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-linet -lnsl_s -ldbm" RANLIB=echo ARFLAGS=rv \
|
||||
- AUX_OBJ="setenv.o strcasecmp.o" EXTRA_CFLAGS="-DENOTCONN=ENAVAIL" \
|
||||
+ AUX_OBJ= \
|
||||
NETGROUP= TLI= all
|
||||
|
||||
# Interactive UNIX R3.2 version 4.0 (Bobby D. Wright).
|
||||
iunix:
|
||||
make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-linet -lnsl_s -ldbm" RANLIB=echo ARFLAGS=rv \
|
||||
- AUX_OBJ=environ.o strcasecmp.o NETGROUP= TLI= all
|
||||
+ AUX_OBJ= \
|
||||
|
||||
# RTU 6.0 on a Masscomp 5400 (ben@piglet.cr.usgs.gov). When using the
|
||||
# advanced installation, increment argv before actually looking at it.
|
||||
rtu:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=environ.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP= TLI= all
|
||||
|
||||
# Unixware sans NIS (mc@telebase.com). Compiler dislikes strcasecmp.c.
|
||||
unixware1:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl -lc -L/usr/ucblib -lucb" RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP=$(NETGROUP) AUX_OBJ=environ.o TLI=-DTLI all
|
||||
+ NETGROUP=$(NETGROUP) AUX_OBJ= \
|
||||
|
||||
unixware2:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl -lgen -lc -L/usr/ucblib -lucb" RANLIB=echo \
|
||||
- ARFLAGS=rv NETGROUP=$(NETGROUP) AUX_OBJ=environ.o TLI=-DTLI all
|
||||
+ ARFLAGS=rv NETGROUP=$(NETGROUP) AUX_OBJ= \
|
||||
|
||||
u6000:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv \
|
||||
- NETGROUP=-DNETGROUP AUX_OBJ="setenv.o strcasecmp.o" TLI=-DTLI all
|
||||
+ NETGROUP=-DNETGROUP AUX_OBJ= \
|
||||
|
||||
# MachTen
|
||||
machten:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=environ.o \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
NETGROUP= TLI= all
|
||||
|
||||
###############################################################
|
||||
@@ -391,9 +391,9 @@
|
||||
# the ones provided with this source distribution. The environ.c module
|
||||
# implements setenv(), getenv(), and putenv().
|
||||
|
||||
-AUX_OBJ= setenv.o
|
||||
-#AUX_OBJ= environ.o
|
||||
-#AUX_OBJ= environ.o strcasecmp.o
|
||||
+AUX_OBJ= \
|
||||
+#AUX_OBJ= \
|
||||
+#AUX_OBJ= \
|
||||
|
||||
# Uncomment the following if your C library does not provide the
|
||||
# strchr/strrchr/memcmp routines, but comes with index/rindex/bcmp.
|
||||
@@ -659,7 +659,7 @@
|
||||
SHELL = /bin/sh
|
||||
.c.o:; $(CC) $(CFLAGS) -c $*.c
|
||||
|
||||
-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
|
||||
+CFLAGS = ${PARDUS_CFLAGS} -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
|
||||
$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
|
||||
-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
|
||||
-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
|
||||
@@ -0,0 +1,20 @@
|
||||
--- tcp_wrappers_7.6-orig/hosts.allow.example 2005-09-25 13:40:59.000000000 +0300
|
||||
+++ tcp_wrappers_7.6/hosts.allow.example 2005-09-25 13:39:46.000000000 +0300
|
||||
@@ -0,0 +1,17 @@
|
||||
+# For more information, please see the hosts.allow(5) manpage
|
||||
+
|
||||
+# Rule format:
|
||||
+# daemon : client list
|
||||
+# The value for 'daemon' is determined by the name of the binary.
|
||||
+# OpenSSH runs as 'sshd' so you would use 'sshd' for 'daemon'.
|
||||
+# Client list can be a list of ip's or hostnames.
|
||||
+
|
||||
+# Allow only sshd connections from ips matching 192.168.0.*
|
||||
+#sshd: 192.168.0.
|
||||
+
|
||||
+# Only allow sendmail connections from the localhost
|
||||
+#sendmail: localhost
|
||||
+
|
||||
+# Allow everyone from foobar.edu to access everything except for
|
||||
+# the terminalserver
|
||||
+#ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
|
||||
@@ -0,0 +1,7 @@
|
||||
# hosts.allow:
|
||||
# This file describes the names of the hosts which are allowed to use
|
||||
# the local INET services and tcp-wrappers aware programs, as decided by the '/usr/sbin/tcpd' server.
|
||||
#
|
||||
# Tcp-wrappers aware progs: Rpcbind, OpenSSH, vsftpd, nfs-utils (mountd), ClamAV
|
||||
# PS: NFS uses rpcbind
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# hosts.deny:
|
||||
# This file describes the names of the hosts which are *not* allowed to use
|
||||
# the local INET services and tcp-wrappers aware programs, as decided by the '/usr/sbin/tcpd' server.
|
||||
#
|
||||
# Tcp-wrappers aware programs: Rpcbind, OpenSSH, Vsftpd, nfs-utils (mountd), ClamAV
|
||||
# PS: NFS uses rpcbind
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
diff -ruNp tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
|
||||
--- tcp_wrappers_7.6.orig/hosts_access.c 2007-01-08 01:31:32.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/hosts_access.c 2007-01-08 01:31:08.000000000 +0100
|
||||
@@ -232,6 +232,36 @@ int (*match_fn) ();
|
||||
return (NO);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * daemon_or_port_match - match server information: if the server endpoint
|
||||
+ * pattern is a port number, match against port number of connection;
|
||||
+ * otherwise match against daemon executable name
|
||||
+ */
|
||||
+
|
||||
+static int daemon_or_port_match(char *tok, struct request_info *request) {
|
||||
+ unsigned int port, sin_port;
|
||||
+ char junk;
|
||||
+
|
||||
+ /* daemon name */
|
||||
+ if (sscanf(tok, "%u%c", &port, &junk) != 1 || port > 65535)
|
||||
+ return (string_match(tok, eval_daemon(request)));
|
||||
+
|
||||
+ /* port number */
|
||||
+ if (!request->server->sin)
|
||||
+ return (NO);
|
||||
+
|
||||
+#ifdef INET6
|
||||
+ sin_port = ntohs(((struct sockaddr_in *)request->server->sin)->sin_port);
|
||||
+#else
|
||||
+ sin_port = ntohs(request->server->sin->sin_port);
|
||||
+#endif
|
||||
+
|
||||
+ if (port == sin_port)
|
||||
+ return (YES);
|
||||
+ else
|
||||
+ return (NO);
|
||||
+}
|
||||
+
|
||||
/* server_match - match server information */
|
||||
|
||||
static int server_match(tok, request)
|
||||
@@ -241,9 +271,9 @@ struct request_info *request;
|
||||
char *host;
|
||||
|
||||
if ((host = split_at(tok + 1, '@')) == 0) { /* plain daemon */
|
||||
- return (string_match(tok, eval_daemon(request)));
|
||||
+ return (daemon_or_port_match(tok, request));
|
||||
} else { /* daemon@host */
|
||||
- return (string_match(tok, eval_daemon(request))
|
||||
+ return (daemon_or_port_match(tok, request)
|
||||
&& host_match(host, request->server));
|
||||
}
|
||||
}
|
||||
diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
|
||||
--- tcp_wrappers_7.6.orig/hosts_access.5 2007-01-08 01:31:32.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/hosts_access.5 2007-01-08 01:30:18.000000000 +0100
|
||||
@@ -51,7 +51,7 @@ being optional:
|
||||
daemon_list : client_list [ : shell_command ]
|
||||
.PP
|
||||
\fIdaemon_list\fR is a list of one or more daemon process names
|
||||
-(argv[0] values) or wildcards (see below).
|
||||
+(argv[0] values) or server port numbers or wildcards (see below).
|
||||
.PP
|
||||
\fIclient_list\fR is a list
|
||||
of one or more host names, host addresses, patterns or wildcards (see
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,86 @@
|
||||
--- Makefile 1997-03-21 18:27:21.000000000 +0000
|
||||
+++ Makefile 2003-07-27 20:13:53.000000000 +0000
|
||||
@@ -143,8 +143,8 @@
|
||||
|
||||
linux:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
+ NETGROUP= TLI= EXTRA_CFLAGS="$(PARDUS_OPT) -DSYS_ERRLIST_DEFINED -DBROKEN_SO_LINGER" all
|
||||
|
||||
# This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
|
||||
hpux hpux8 hpux9 hpux10:
|
||||
@@ -663,6 +663,7 @@
|
||||
$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
|
||||
-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
|
||||
-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
|
||||
+ -DPIC -D_REENTRANT -fPIC -DHAVE_STRERROR \
|
||||
$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
|
||||
$(VSYSLOG) $(HOSTNAME)
|
||||
|
||||
--- Makefile 1997-03-21 18:27:21.000000000 +0000
|
||||
+++ Makefile 2002-12-16 14:02:38.000000000 +0000
|
||||
@@ -44,7 +44,7 @@
|
||||
#REAL_DAEMON_DIR=/usr/etc
|
||||
#
|
||||
# SysV.4 Solaris 2.x OSF AIX
|
||||
-#REAL_DAEMON_DIR=/usr/sbin
|
||||
+REAL_DAEMON_DIR=/usr/sbin
|
||||
#
|
||||
# BSD 4.4
|
||||
#REAL_DAEMON_DIR=/usr/libexec
|
||||
@@ -472,7 +474,7 @@
|
||||
# If your system supports vsyslog(), comment out the following definition.
|
||||
# If in doubt leave it in, it won't harm.
|
||||
|
||||
-VSYSLOG = -Dvsyslog=myvsyslog
|
||||
+#VSYSLOG = -Dvsyslog=myvsyslog
|
||||
|
||||
# End of the system dependencies.
|
||||
#################################
|
||||
@@ -491,7 +493,7 @@
|
||||
# Uncomment the next definition to turn on the language extensions
|
||||
# (examples: allow, deny, banners, twist and spawn).
|
||||
#
|
||||
-#STYLE = -DPROCESS_OPTIONS # Enable language extensions.
|
||||
+STYLE = -DPROCESS_OPTIONS # Enable language extensions.
|
||||
|
||||
################################################################
|
||||
# Optional: Changing the default disposition of logfile records
|
||||
@@ -514,7 +516,7 @@
|
||||
#
|
||||
# The LOG_XXX names below are taken from the /usr/include/syslog.h file.
|
||||
|
||||
-FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
|
||||
+FACILITY= LOG_AUTHPRIV # LOG_MAIL is what most sendmail daemons use
|
||||
|
||||
# The syslog priority at which successful connections are logged.
|
||||
|
||||
@@ -531,7 +533,7 @@
|
||||
# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken
|
||||
# from /etc/hosts or from NIS maps. It does work with DNS through NIS.
|
||||
#
|
||||
-# DOT= -DAPPEND_DOT
|
||||
+DOT= -DAPPEND_DOT
|
||||
|
||||
##################################################
|
||||
# Optional: Always attempt remote username lookups
|
||||
@@ -551,7 +553,7 @@
|
||||
# still do selective username lookups as documented in the hosts_access.5
|
||||
# and hosts_options.5 manual pages (`nroff -man' format).
|
||||
#
|
||||
-#AUTH = -DALWAYS_RFC931
|
||||
+AUTH = -DALWAYS_RFC931
|
||||
#
|
||||
# The default username lookup timeout is 10 seconds. This may not be long
|
||||
# enough for slow hosts or networks, but is enough to irritate PC users.
|
||||
@@ -610,7 +612,7 @@
|
||||
# Paranoid mode implies hostname lookup. In order to disable hostname
|
||||
# lookups altogether, see the next section.
|
||||
|
||||
-PARANOID= -DPARANOID
|
||||
+#PARANOID= -DPARANOID
|
||||
|
||||
########################################
|
||||
# Optional: turning off hostname lookups
|
||||
@@ -0,0 +1,241 @@
|
||||
--- tcp_wrappers_7.6/tcpd.h.shared 2003-02-10 20:12:26.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/tcpd.h 2003-02-10 20:12:26.000000000 +0100
|
||||
@@ -4,6 +4,25 @@
|
||||
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
|
||||
*/
|
||||
|
||||
+#ifndef _TCPWRAPPERS_TCPD_H
|
||||
+#define _TCPWRAPPERS_TCPD_H
|
||||
+
|
||||
+/* someone else may have defined this */
|
||||
+#undef __P
|
||||
+
|
||||
+/* use prototypes if we have an ANSI C compiler or are using C++ */
|
||||
+#if defined(__STDC__) || defined(__cplusplus)
|
||||
+#define __P(args) args
|
||||
+#else
|
||||
+#define __P(args) ()
|
||||
+#endif
|
||||
+
|
||||
+/* Need definitions of struct sockaddr_in and FILE. */
|
||||
+#include <netinet/in.h>
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+__BEGIN_DECLS
|
||||
+
|
||||
/* Structure to describe one communications endpoint. */
|
||||
|
||||
#define STRING_LENGTH 128 /* hosts, users, processes */
|
||||
@@ -29,10 +48,10 @@
|
||||
char pid[10]; /* access via eval_pid(request) */
|
||||
struct host_info client[1]; /* client endpoint info */
|
||||
struct host_info server[1]; /* server endpoint info */
|
||||
- void (*sink) (); /* datagram sink function or 0 */
|
||||
- void (*hostname) (); /* address to printable hostname */
|
||||
- void (*hostaddr) (); /* address to printable address */
|
||||
- void (*cleanup) (); /* cleanup function or 0 */
|
||||
+ void (*sink) __P((int)); /* datagram sink function or 0 */
|
||||
+ void (*hostname) __P((struct host_info *)); /* address to printable hostname */
|
||||
+ void (*hostaddr) __P((struct host_info *)); /* address to printable address */
|
||||
+ void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
|
||||
struct netconfig *config; /* netdir handle */
|
||||
};
|
||||
|
||||
@@ -65,25 +84,34 @@
|
||||
/* Global functions. */
|
||||
|
||||
#if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
|
||||
-extern void fromhost(); /* get/validate client host info */
|
||||
+extern void fromhost __P((struct request_info *)); /* get/validate client host info */
|
||||
#else
|
||||
#define fromhost sock_host /* no TLI support needed */
|
||||
#endif
|
||||
|
||||
-extern int hosts_access(); /* access control */
|
||||
-extern void shell_cmd(); /* execute shell command */
|
||||
-extern char *percent_x(); /* do %<char> expansion */
|
||||
-extern void rfc931(); /* client name from RFC 931 daemon */
|
||||
-extern void clean_exit(); /* clean up and exit */
|
||||
-extern void refuse(); /* clean up and exit */
|
||||
-extern char *xgets(); /* fgets() on steroids */
|
||||
-extern char *split_at(); /* strchr() and split */
|
||||
-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
|
||||
+extern void shell_cmd __P((char *)); /* execute shell command */
|
||||
+extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
|
||||
+#ifdef INET6
|
||||
+extern void rfc931 __P((struct sockaddr *, struct sockaddr *, char *)); /* client name from RFC 931 daemon */
|
||||
+#else
|
||||
+extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
|
||||
+#endif
|
||||
+extern void clean_exit __P((struct request_info *)); /* clean up and exit */
|
||||
+extern void refuse __P((struct request_info *)); /* clean up and exit */
|
||||
+extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
|
||||
+extern char *split_at __P((char *, int)); /* strchr() and split */
|
||||
+extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
|
||||
|
||||
/* Global variables. */
|
||||
|
||||
+#ifdef HAVE_WEAKSYMS
|
||||
+extern int allow_severity __attribute__ ((weak)); /* for connection logging */
|
||||
+extern int deny_severity __attribute__ ((weak)); /* for connection logging */
|
||||
+#else
|
||||
extern int allow_severity; /* for connection logging */
|
||||
extern int deny_severity; /* for connection logging */
|
||||
+#endif
|
||||
+
|
||||
extern char *hosts_allow_table; /* for verification mode redirection */
|
||||
extern char *hosts_deny_table; /* for verification mode redirection */
|
||||
extern int hosts_access_verbose; /* for verbose matching mode */
|
||||
@@ -96,9 +124,14 @@
|
||||
*/
|
||||
|
||||
#ifdef __STDC__
|
||||
+extern int hosts_access(struct request_info *request);
|
||||
+extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
|
||||
+ char *client_user);
|
||||
extern struct request_info *request_init(struct request_info *,...);
|
||||
extern struct request_info *request_set(struct request_info *,...);
|
||||
#else
|
||||
+extern int hosts_access();
|
||||
+extern int hosts_ctl();
|
||||
extern struct request_info *request_init(); /* initialize request */
|
||||
extern struct request_info *request_set(); /* update request structure */
|
||||
#endif
|
||||
@@ -121,27 +154,31 @@
|
||||
* host_info structures serve as caches for the lookup results.
|
||||
*/
|
||||
|
||||
-extern char *eval_user(); /* client user */
|
||||
-extern char *eval_hostname(); /* printable hostname */
|
||||
-extern char *eval_hostaddr(); /* printable host address */
|
||||
-extern char *eval_hostinfo(); /* host name or address */
|
||||
-extern char *eval_client(); /* whatever is available */
|
||||
-extern char *eval_server(); /* whatever is available */
|
||||
+extern char *eval_user __P((struct request_info *)); /* client user */
|
||||
+extern char *eval_hostname __P((struct host_info *)); /* printable hostname */
|
||||
+extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */
|
||||
+extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */
|
||||
+extern char *eval_client __P((struct request_info *)); /* whatever is available */
|
||||
+extern char *eval_server __P((struct request_info *)); /* whatever is available */
|
||||
#define eval_daemon(r) ((r)->daemon) /* daemon process name */
|
||||
#define eval_pid(r) ((r)->pid) /* process id */
|
||||
|
||||
/* Socket-specific methods, including DNS hostname lookups. */
|
||||
|
||||
-extern void sock_host(); /* look up endpoint addresses */
|
||||
-extern void sock_hostname(); /* translate address to hostname */
|
||||
-extern void sock_hostaddr(); /* address to printable address */
|
||||
+/* look up endpoint addresses */
|
||||
+extern void sock_host __P((struct request_info *));
|
||||
+/* translate address to hostname */
|
||||
+extern void sock_hostname __P((struct host_info *));
|
||||
+/* address to printable address */
|
||||
+extern void sock_hostaddr __P((struct host_info *));
|
||||
+
|
||||
#define sock_methods(r) \
|
||||
{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
|
||||
|
||||
/* The System V Transport-Level Interface (TLI) interface. */
|
||||
|
||||
#if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
|
||||
-extern void tli_host(); /* look up endpoint addresses etc. */
|
||||
+extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -182,7 +219,7 @@
|
||||
* behavior.
|
||||
*/
|
||||
|
||||
-extern void process_options(); /* execute options */
|
||||
+extern void process_options __P((char *, struct request_info *)); /* execute options */
|
||||
extern int dry_run; /* verification flag */
|
||||
|
||||
/* Bug workarounds. */
|
||||
@@ -221,3 +258,7 @@
|
||||
#define strtok my_strtok
|
||||
extern char *my_strtok();
|
||||
#endif
|
||||
+
|
||||
+__END_DECLS
|
||||
+
|
||||
+#endif /* tcpd.h */
|
||||
--- tcp_wrappers_7.6/scaffold.c.shared 2003-02-10 20:12:26.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/scaffold.c 2003-02-10 20:12:26.000000000 +0100
|
||||
@@ -237,10 +237,17 @@
|
||||
|
||||
/* ARGSUSED */
|
||||
|
||||
-void rfc931(request)
|
||||
-struct request_info *request;
|
||||
+void rfc931(rmt_sin, our_sin, dest)
|
||||
+#ifndef INET6
|
||||
+struct sockaddr_in *rmt_sin;
|
||||
+struct sockaddr_in *our_sin;
|
||||
+#else
|
||||
+struct sockaddr *rmt_sin;
|
||||
+struct sockaddr *our_sin;
|
||||
+#endif
|
||||
+char *dest;
|
||||
{
|
||||
- strcpy(request->user, unknown);
|
||||
+ strcpy(dest, unknown);
|
||||
}
|
||||
|
||||
/* check_path - examine accessibility */
|
||||
--- /dev/null 2003-01-30 11:24:37.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/weak_symbols.c 2003-02-10 20:12:26.000000000 +0100
|
||||
@@ -0,0 +1,11 @@
|
||||
+ /*
|
||||
+ * @(#) weak_symbols.h 1.5 99/12/29 23:50
|
||||
+ *
|
||||
+ * Author: Anthony Towns <ajt@debian.org>
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_WEAKSYMS
|
||||
+#include <syslog.h>
|
||||
+int deny_severity = LOG_WARNING;
|
||||
+int allow_severity = SEVERITY;
|
||||
+#endif
|
||||
--- tcp_wrappers_7.6/Makefile.shared 2003-02-10 20:12:26.000000000 +0100
|
||||
+++ tcp_wrappers_7.6/Makefile 2003-02-10 20:14:05.000000000 +0100
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
linux:
|
||||
@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
|
||||
- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
|
||||
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
|
||||
NETGROUP= TLI= EXTRA_CFLAGS="$(PARDUS_OPT) -DSYS_ERRLIST_DEFINED -DBROKEN_SO_LINGER" all
|
||||
|
||||
# This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
|
||||
@@ -686,8 +686,9 @@
|
||||
scaffold.h tcpdmatch.8 README.NIS
|
||||
|
||||
LIB = libwrap.a
|
||||
+SHLIB = libwrap.so
|
||||
|
||||
-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
|
||||
+all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(SHLIB)
|
||||
|
||||
# Invalidate all object files when the compiler options (CFLAGS) have changed.
|
||||
|
||||
@@ -704,6 +705,12 @@
|
||||
$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
|
||||
-$(RANLIB) $(LIB)
|
||||
|
||||
+$(SHLIB): $(LIB_OBJ)
|
||||
+ gcc -shared -fPIC -Wl,-soname -Wl,$(SHLIB).$(MAJOR) \
|
||||
+ -o $(SHLIB).$(MAJOR).$(MINOR).$(REL) $^ $(LIBS)
|
||||
+ ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB).$(MAJOR)
|
||||
+ ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB)
|
||||
+
|
||||
tcpd: tcpd.o $(LIB)
|
||||
$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
|
||||
|
||||
@@ -886,5 +893,6 @@
|
||||
update.o: mystdarg.h
|
||||
update.o: tcpd.h
|
||||
vfprintf.o: cflags
|
||||
+weak_symbols.o: tcpd.h
|
||||
workarounds.o: cflags
|
||||
workarounds.o: tcpd.h
|
||||
@@ -0,0 +1,35 @@
|
||||
--- tcp_wrappers_7.6/Makefile.ldflags 2004-03-05 14:47:36.438315648 +0100
|
||||
+++ tcp_wrappers_7.6/Makefile 2004-03-05 14:50:01.438272304 +0100
|
||||
@@ -732,26 +732,26 @@
|
||||
ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB)
|
||||
|
||||
tcpd: tcpd.o $(LIB)
|
||||
- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ tcpd.o $(LDFLAGS) $(LIB) $(LIBS)
|
||||
|
||||
miscd: miscd.o $(LIB)
|
||||
- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ miscd.o $(LDFLAGS) $(LIB) $(LIBS)
|
||||
|
||||
safe_finger: safe_finger.o $(LIB)
|
||||
- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ safe_finger.o $(LDFLAGS) $(LIB) $(LIBS)
|
||||
|
||||
TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
|
||||
|
||||
tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
|
||||
- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LDFLAGS) $(LIB) $(LIBS)
|
||||
|
||||
try-from: try-from.o fakelog.o $(LIB)
|
||||
- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LDFLAGS) $(LIB) $(LIBS)
|
||||
|
||||
TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
|
||||
|
||||
tcpdchk: $(TCPDCHK_OBJ) $(LIB)
|
||||
- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LDFLAGS) $(LIB) $(LIBS)
|
||||
|
||||
shar: $(KIT)
|
||||
@shar $(KIT)
|
||||
Reference in New Issue
Block a user