aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2002-05-27 08:10:24 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2002-05-27 08:10:24 +0000
commit2061e8711118a3df7012b9517de10c052b873407 (patch)
treebd91e7432994f354f0d2f4a03c43978d771aecec
parent6db5f8a79ec0a22ceae686e7a5470a3046a36841 (diff)
Notes
-rw-r--r--contrib/telnet/telnetd/sys_term.c8
-rw-r--r--crypto/telnet/telnetd/sys_term.c8
-rw-r--r--libexec/telnetd/sys_term.c8
3 files changed, 24 insertions, 0 deletions
diff --git a/contrib/telnet/telnetd/sys_term.c b/contrib/telnet/telnetd/sys_term.c
index 419f4fbe2e07..1e832e3f3862 100644
--- a/contrib/telnet/telnetd/sys_term.c
+++ b/contrib/telnet/telnetd/sys_term.c
@@ -1317,8 +1317,16 @@ 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);
diff --git a/crypto/telnet/telnetd/sys_term.c b/crypto/telnet/telnetd/sys_term.c
index 419f4fbe2e07..1e832e3f3862 100644
--- a/crypto/telnet/telnetd/sys_term.c
+++ b/crypto/telnet/telnetd/sys_term.c
@@ -1317,8 +1317,16 @@ 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);
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index 089b0dbf39d1..17686b366bac 100644
--- a/libexec/telnetd/sys_term.c
+++ b/libexec/telnetd/sys_term.c
@@ -1170,8 +1170,16 @@ 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);