git: talkd: Find users in more than one talk request.

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Jan 15 16:46:35 PST 2021


commit c420de58e07cf2a4714e37098cab149c715362ff
Author: Dan Cross <cross at gajendra.net>
Date:   Wed Jan 13 23:55:47 2021 +0000

    talkd: Find users in more than one talk request.
    
    talkd was written to use `utmpentry` from `who`, which
    caches the results of read the `utmpx` file.  However,
    talkd is usually invoked from inetd `wait` mode; it's
    possible that a user might login after `talkd` starts;
    with the cached utmpx data, one can't `talk` to that
    user.
    
    Further, consumption of the utmp data nulls it out for
    subsequent requests.  The result is that the first talk
    succeeds, but subsequent requests fail.
    
    The fix is to avoid using the `utmpentry` machinery,
    and just read `utmp` directly every time we need to.
    
    Signed-off-by: Dan Cross <cross at gajendra.net>

Summary of changes:
 libexec/talkd/Makefile  |  5 ++--
 libexec/talkd/extern.h  |  2 +-
 libexec/talkd/process.c | 65 ++++++++++++++++++++++++++-----------------------
 3 files changed, 38 insertions(+), 34 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c420de58e07cf2a4714e37098cab149c715362ff


-- 
DragonFly BSD source repository


More information about the Commits mailing list