summaryrefslogtreecommitdiffstats
path: root/contrib/telnet
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-01-13 18:37:42 +0000
committered <ed@FreeBSD.org>2010-01-13 18:37:42 +0000
commitbd3422d93eddc1f484fd38473c90e9551c58c647 (patch)
tree603108a08c4df667b4c5efc123da054c87fffead /contrib/telnet
parente846918be8ea79d3ca09a77e4fd6e850856f0b81 (diff)
downloadFreeBSD-src-bd3422d93eddc1f484fd38473c90e9551c58c647.zip
FreeBSD-src-bd3422d93eddc1f484fd38473c90e9551c58c647.tar.gz
Let telnetd build without utmp and logwtmp(3).
Just like rlogind, there is no need to change the ownership of the terminal during shutdown anymore. Also don't call logwtmp, because the login(1)/PAM is responsible for doing this. Also use SHUT_RDWR instead of 2.
Diffstat (limited to 'contrib/telnet')
-rw-r--r--contrib/telnet/telnetd/sys_term.c19
-rw-r--r--contrib/telnet/telnetd/telnetd.c1
2 files changed, 1 insertions, 19 deletions
diff --git a/contrib/telnet/telnetd/sys_term.c b/contrib/telnet/telnetd/sys_term.c
index 498c342..a7b0075 100644
--- a/contrib/telnet/telnetd/sys_term.c
+++ b/contrib/telnet/telnetd/sys_term.c
@@ -1303,24 +1303,7 @@ scrub_env(void)
void
cleanup(int sig __unused)
{
- char *p;
- sigset_t mask;
- p = line + sizeof(_PATH_DEV) - 1;
- /*
- * Block all signals before clearing the utmp entry. We don't want to
- * be called again after calling logout() and then not add the wtmp
- * entry because of not finding the corresponding entry in utmp.
- */
- sigfillset(&mask);
- sigprocmask(SIG_SETMASK, &mask, NULL);
- if (logout(p))
- logwtmp(p, "", "");
- (void)chmod(line, 0666);
- (void)chown(line, 0, 0);
- *p = 'p';
- (void)chmod(line, 0666);
- (void)chown(line, 0, 0);
- (void) shutdown(net, 2);
+ (void) shutdown(net, SHUT_RDWR);
_exit(1);
}
diff --git a/contrib/telnet/telnetd/telnetd.c b/contrib/telnet/telnetd/telnetd.c
index ad1e459..7833a6b 100644
--- a/contrib/telnet/telnetd/telnetd.c
+++ b/contrib/telnet/telnetd/telnetd.c
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <libutil.h>
#include <paths.h>
#include <termcap.h>
-#include <utmp.h>
#include <arpa/inet.h>
OpenPOWER on IntegriCloud