Fix "no * expansion for USERS field in config" bug
There were two lines in the check_idle() function, which were meant to test if a given user has been found in a given line of the configuration file. Rather than using the chkmatch function, to test for a match, and any potential expansions, these two lines, comprising an if statement, simply checked if the USER pattern matched the given username as a string, or if it was simply a *. This means that if a function was checking the user kappa, it would match him for the USERS field "kappa" or "*", but not "ka*", this is not the behaviour documented in the timeouts(5) manpage, which explicitly states the expansion for the USERS field in the config, will be done in the exact same way as the TTYS field.
This commit is contained in:
parent
24e4896584
commit
261b0c5084
|
@ -1003,9 +1003,8 @@ void check_idle()
|
||||||
if (!config[0])
|
if (!config[0])
|
||||||
return; /* no entries in config */
|
return; /* no entries in config */
|
||||||
while (config[++aktconfigline] && aktconfigline >= 0)
|
while (config[++aktconfigline] && aktconfigline >= 0)
|
||||||
if (strcmp(config[aktconfigline]->users, user) == 0
|
if (chkmatch(user, config[aktconfigline]->users)) {
|
||||||
|| config[aktconfigline]->users[0] == '*') {
|
aktconfigline = -2; /* we found user in config, so he/they has/have restrictions */
|
||||||
aktconfigline = -2; /* we found user or * in config, so he/they has/have restrictions */
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue