Date: Wed, 13 Jan 2010 18:37:42 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r202212 - head/contrib/telnet/telnetd Message-ID: <201001131837.o0DIbgen089407@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Wed Jan 13 18:37:42 2010 New Revision: 202212 URL: http://svn.freebsd.org/changeset/base/202212 Log: 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. Modified: head/contrib/telnet/telnetd/sys_term.c head/contrib/telnet/telnetd/telnetd.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Wed Jan 13 18:32:31 2010 (r202211) +++ head/contrib/telnet/telnetd/sys_term.c Wed Jan 13 18:37:42 2010 (r202212) @@ -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); } Modified: head/contrib/telnet/telnetd/telnetd.c ============================================================================== --- head/contrib/telnet/telnetd/telnetd.c Wed Jan 13 18:32:31 2010 (r202211) +++ head/contrib/telnet/telnetd/telnetd.c Wed Jan 13 18:37:42 2010 (r202212) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include <libutil.h> #include <paths.h> #include <termcap.h> -#include <utmp.h> #include <arpa/inet.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001131837.o0DIbgen089407>