mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 09:02:44 +00:00
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.
This commit is contained in:
parent
2957240805
commit
c2fd39cb4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=202212
@ -1303,24 +1303,7 @@ scrub_env(void)
|
|||||||
void
|
void
|
||||||
cleanup(int sig __unused)
|
cleanup(int sig __unused)
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
sigset_t mask;
|
|
||||||
|
|
||||||
p = line + sizeof(_PATH_DEV) - 1;
|
(void) shutdown(net, SHUT_RDWR);
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <libutil.h>
|
#include <libutil.h>
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <termcap.h>
|
#include <termcap.h>
|
||||||
#include <utmp.h>
|
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user