summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-29Return exec exit code when condition is reachedHEADmasterAaron Ball
2019-12-29Simplify logic for assembly of lastlogin file pathAaron Ball
2019-12-29Simple updates to log messages and logicAaron Ball
Error messages now output to stderr. Also updated logic to default to updating the lastlogin file outside of the logic tree, since the logic tree returned early on each failure state.
2019-12-29Replace hardcoded seconds in day with macroAaron Ball
2019-12-29Replace days_to_seconds function with macroAaron Ball
This function was a [huge] waste of processing power and complexity. Replaced with a macro for easier readability of code, since 86400 (the number of seconds in 24 hours) isn't immediately obvious what it is. Now it is referenced by the macro SECONDS_IN_DAY.
2019-12-29Replace get_lastlogin with fread_longAaron Ball
The operation provided by get_lastlogin was very generic and could be simplified and reduced to a simple file reader that returns a long value rather than copying into a buffer by reference.
2019-12-29Update Makefile with ccopts and fix debugAaron Ball
CCOPTS now turn on all warnings, optimize, and set standard to gnu99.
2019-12-29Simplify get user home codeAaron Ball
Previously there was a function for this (get_user_home: *sigh*). Now we just check if the getenv for HOME returns a null pointer and save double copying into a buffer.
2019-12-29Update usage textAaron Ball
Also renames get_help() to usage() and add -h,--help switch to the output.
2019-12-29Update copywrite to 2019 and new emailAaron Ball
2015-08-17Fixed bug introduced by previous commitAaron Ball
2015-08-17Added sanity check for bios clock errorsAaron Ball
When bios clock resets to 1979, terminus reads that, determines the threshold has not been exceeded (because it's a negative number since lastlogin obviously ahead of 1979), and writes the new lastlogin time, which is in 1979. If ntp then updates the clock, the user hasn't logged in in over 35 years, likely exceeding their set threshold. This puts in a sanity check to ensure the difference between lastlogin and now is a positive number. If the difference exceeds -1 day, terminus exits since the system clock is evidently unreliable.
2015-07-03Implemented reset and help switchesAaron Ball
In the event the threshold was exceeded, terminus would (and should) not reset the lastlogin file. However if the user did not intend for the threshold to be exceeded (eg: vacation), there was no way to reset the timer. This implements the -r,--reset flags for resetting the lastlogin file. Also moved the helptext into its own function and expanded it a bit. To implement the new switches, implemented basic argument parser as well. Consequently, implemented -h,--help flags.
2015-06-27Removed ctoi functionAaron Ball
Oops. Forgot to remove this when switching to atoi. Also removed math.h include.
2015-06-27Fixed function comment syntaxAaron Ball
2015-06-27Added gplv3 license header and license fileAaron Ball
2015-06-27Added initial README.mdAaron Ball
2015-06-27Initial commit of terminus source codeAaron Ball
This version is fully working, though it is still lacking in some functionality.

Generated by cgit