diff options
author | Mark Johnston <markj@FreeBSD.org> | 2019-01-23 20:02:17 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2019-01-23 20:02:17 +0000 |
commit | 27ed53c3117c6d937c9f55e94a2354345a42a604 (patch) | |
tree | 31475634e0b07784f5128f8632283e51fb5e6c65 /usr.bin/write | |
parent | 862203935e6d4da6065778136de19f276e9abb03 (diff) | |
download | src-test-27ed53c3117c6d937c9f55e94a2354345a42a604.tar.gz src-test-27ed53c3117c6d937c9f55e94a2354345a42a604.zip |
Remove extraneous setutxent() calls in write(1).
We already call setutxent() once during initialization. Furthermore,
the subsequent calls occur after the process has entered capability
mode, so they fail, and attempts to fetch database entries fail as
a result.
PR: 235096
Submitted by: fullermd@over-yonder.net
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=343354
Diffstat (limited to 'usr.bin/write')
-rw-r--r-- | usr.bin/write/write.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c index 2febe3b423026..06cae97d9fc95 100644 --- a/usr.bin/write/write.c +++ b/usr.bin/write/write.c @@ -204,7 +204,6 @@ utmp_chk(char *user, char *tty) struct utmpx lu, *u; strncpy(lu.ut_line, tty, sizeof lu.ut_line); - setutxent(); while ((u = getutxline(&lu)) != NULL) if (u->ut_type == USER_PROCESS && strcmp(user, u->ut_user) == 0) { @@ -237,7 +236,6 @@ search_utmp(int devfd, char *user, char *tty, char *mytty, uid_t myuid) bestatime = 0; user_is_me = 0; - setutxent(); while ((u = getutxent()) != NULL) if (u->ut_type == USER_PROCESS && strcmp(user, u->ut_user) == 0) { |