Commit graph

9 commits

Author SHA1 Message Date
Petar Kapris 9869a3657d Remove unnecessary local refernce to time()
At the start of the check_idle() function, there is an unnecessary local
declaration of time(2), which is already declared at the start of the
program. It has been removed.
2020-11-25 17:20:58 +01:00
Petar Kapris 261b0c5084 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.
2020-11-25 11:29:17 +01:00
kappa 24e4896584 Fix alarm bell symbols
There are three string literals in the code where rather than having the
usual \a escape sequence to represent an alert character, the literal
character was inserted, this makes it impractical to edit the lines in
most text editors. So they have been replaced with the more typical
escape sequence.
2020-11-25 11:29:17 +01:00
kappa 1ed5ce8edf Change indentation style to modified K&R
The entire source code of timeoutd.c has been passed through GNU indent,
in order to amend the inconsistencies, it uses the K&R C style, but
modified, so that tabs are replaced with 4 spaces, close to what a lot
of the code was already using. (Blasphemy, i know) Also the maximum line
length is 100 chars, apart from long strings, which don't get cut as a
result.
2020-11-25 11:29:17 +01:00
kappa 848c784e7f Delete trailing whitespaces
Several lines in the code either have whitespace where tabs are
expected, the converse, or trailing whitespace before a newline. All
of these have been removed or replaced.
2020-11-25 11:29:11 +01:00
kappa d03d713004 Clean up lines that cause warning messages in GCC
There are several lines in the code which cause GCC to warn the user
about undefined behaviour. Most of these are potential buffer overflow
problems. Which come from either overwriting a buffer which may be too
small for a given input, or writing to, or from, a string not guaranteed
to be null-terminated, such as any of the char[] fields in a utmp
struct. Almost all come from an improper usage of strcmp or strncmp or
similar.
2020-11-24 23:46:14 +01:00
Shawn Willden 45a9836343 Fixed local X session handling
An X.org (or perhaps kernel?) change sometime around 7.04
broke timeoutd.  This fixes it.
2009-01-04 23:12:25 -07:00
Peter Eisentraut 642d4c9ea8 Imported Debian patch 1.5-10.1 2009-01-04 23:11:59 -07:00
Shawn Willden 6236f92ec8 Imported Upstream version 1.5 2009-01-04 23:11:58 -07:00