From be15d1fc769378330fd8861cee7cbdf3aadea98d Mon Sep 17 00:00:00 2001 From: Petar Kapris Date: Sun, 20 Dec 2020 11:14:24 +0100 Subject: [PATCH] Replace tty variable in chk_timeout The tty variable is a char pointer equal to dev, it's pointee does not change during the function, nor does the pointer itself change, it's always simply equal to the argument dev, therefore, this pointer is, ... pointless (ba dum tss!) --- timeoutd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/timeoutd.c b/timeoutd.c index e24f371..ce9f598 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -740,7 +740,6 @@ int session; char ttymatch = 0; char usermatch = 0; char groupmatch = 0; - char *tty = dev; char **p; int disc; @@ -757,13 +756,13 @@ int session; } #ifdef DEBUG - syslog(LOG_DEBUG, "Checking user %s group %s tty %s.", user, gr->gr_name, tty); + syslog(LOG_DEBUG, "Checking user %s group %s tty %s.", user, gr->gr_name, dev); #endif /* Check to see if current user matches any entry based on tty/user/group */ while (config[configline]) { timematch = chktimes(config[configline]->times); - ttymatch = chkmatch(tty, config[configline]->ttys); + ttymatch = chkmatch(dev, config[configline]->ttys); usermatch = chkmatch(user, config[configline]->users); groupmatch = chkmatch(gr->gr_name, config[configline]->groups); /* If the primary group doesn't match this entry, check secondaries */