Add a list of programs which are not in /etc/inetd.conf but use libwrap
on their own (currently just /usr/sbin/sendmail). Also, mark all programs in inetd as wrapped even without tcpd being called, since NetBSD inetd wraps all programs.
This commit is contained in:
parent
fbb40475d5
commit
7e5ed09d92
|
@ -21,6 +21,19 @@ extern void exit();
|
||||||
#include "tcpd.h"
|
#include "tcpd.h"
|
||||||
#include "inetcf.h"
|
#include "inetcf.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Programs that use libwrap directly are not in inetd.conf, and so must
|
||||||
|
* be added here in a similar format. (We pretend we found them in
|
||||||
|
* /etc/inetd.conf.) Each one is a set of three strings that correspond
|
||||||
|
* to fields in /etc/inetd.conf:
|
||||||
|
* protocol (field 3), path (field 6), arg0 (field 7)
|
||||||
|
* The last entry should be a NULL.
|
||||||
|
*/
|
||||||
|
char *uses_libwrap[] = {
|
||||||
|
"tcp", "/usr/sbin/sendmail", "sendmail",
|
||||||
|
(char *) NULL
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Network configuration files may live in unusual places. Here are some
|
* Network configuration files may live in unusual places. Here are some
|
||||||
* guesses. Shorter names follow longer ones.
|
* guesses. Shorter names follow longer ones.
|
||||||
|
@ -59,6 +72,7 @@ char *conf;
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
char **wrapped;
|
||||||
char *service;
|
char *service;
|
||||||
char *protocol;
|
char *protocol;
|
||||||
char *user;
|
char *user;
|
||||||
|
@ -94,6 +108,15 @@ char *conf;
|
||||||
check_path(conf, &st);
|
check_path(conf, &st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process the list of programs that use libwrap directly.
|
||||||
|
*/
|
||||||
|
wrapped = uses_libwrap;
|
||||||
|
while (*wrapped != NULL) {
|
||||||
|
inet_chk(wrapped[0], wrapped[1], wrapped[2], "");
|
||||||
|
wrapped += 3;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process the file. After the 7.0 wrapper release it became clear that
|
* Process the file. After the 7.0 wrapper release it became clear that
|
||||||
* there are many more inetd.conf formats than the 8 systems that I had
|
* there are many more inetd.conf formats than the 8 systems that I had
|
||||||
|
@ -263,6 +286,10 @@ char *arg1;
|
||||||
if (wrap_status == WR_YES && STR_EQ(protocol, "rpc/tcp"))
|
if (wrap_status == WR_YES && STR_EQ(protocol, "rpc/tcp"))
|
||||||
tcpd_warn("%s: cannot wrap rpc/tcp services", tcpd_proc_name);
|
tcpd_warn("%s: cannot wrap rpc/tcp services", tcpd_proc_name);
|
||||||
|
|
||||||
|
/* NetBSD inetd wraps all programs */
|
||||||
|
if (! STR_EQ(protocol, "rpc/tcp"))
|
||||||
|
wrap_status = WR_YES;
|
||||||
|
|
||||||
inet_set(tcpd_proc_name, wrap_status);
|
inet_set(tcpd_proc_name, wrap_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue