Sami Kerola [Sat, 29 Dec 2012 16:19:15 +0000 (16:19 +0000)]
smatch scan: fix various warningss found using smatch
entry.c:396 load_entry() info: redundant null check on e->pwd calling free()
entry.c:398 load_entry() info: redundant null check on e->cmd calling free()
/usr/include/bits/fcntl.h:48:10: warning: preprocessor token O_NOFOLLOW redefined
macros.h:136:9: this was the original definition
security.c:98:44: warning: non-ANSI function declaration of function 'cron_restore_default_security_context'
crontab.c:439:29: warning: non-ANSI function declaration of function 'tmp_path'
Sami Kerola [Sat, 1 Dec 2012 17:35:40 +0000 (17:35 +0000)]
compile: add function attributes
Some of the argument values are not in use, and few functions does not
return. Informing which will make few warning messages disapper, and
compiler to generate better binary.
Sami Kerola [Sat, 1 Dec 2012 17:02:08 +0000 (17:02 +0000)]
compile: fix signed and unsigned warnings
cron.c:100:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
cron.c:108:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
cron.c:125:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Sami Kerola [Thu, 22 Nov 2012 22:58:48 +0000 (22:58 +0000)]
docs: fix various groff issues
* Add spaces after dots (English spacing).
* Remove use of inline emphasis where possible.
* Use mail and url macros.
* Wrap long and join short lines.
* Remove end of line white spaces.
Sami Kerola [Sat, 24 Nov 2012 21:53:13 +0000 (21:53 +0000)]
build-sys: make ./configure to seach vi path
Using "/usr/ucb/vi" as defaut fallback EDITOR is not going to work on
most of distributions where this package is installed. That said it
might work somewhere, so searching the vi editor at configure time is the
sensible thing to do, if user does not want to define the default.
Sami Kerola [Sat, 24 Nov 2012 19:09:38 +0000 (19:09 +0000)]
declarations: fix shadow declarations
user.c:68:7: warning: declaration of 'save_errno' shadows a previous local [-Wshadow]
user.c:64:14: warning: shadowed declaration is here [-Wshadow]
do_command.c:559:9: warning: declaration of 'pid' shadows a previous local [-Wshadow]
do_command.c:91:8: warning: shadowed declaration is here [-Wshadow]
Sami Kerola [Sat, 24 Nov 2012 11:43:35 +0000 (11:43 +0000)]
includes: make inclusions clean
This change makes files to include what they need, instead of having
generic inclusion headers which will include everything to everywhere.
Also the local headers havee ifndef & define protection, which makes them
to be save to include in any file, without one having to think in which
order the inclusions happen at compile time.
Sami Kerola [Sat, 24 Nov 2012 10:57:58 +0000 (10:57 +0000)]
build-sys: reduce selinux and pam compiling scope when possible
This will fix following warnings, and makes compiled program to contain
less unnecessary references.
crontab.c:60:14: warning: 'selinux_context' defined but not used [-Wunused-variable]
security.c:188:12: warning: 'cron_open_pam_session' defined but not used [-Wunused-function]
security.c:250:12: warning: 'cron_authorize_context' defined but not used [-Wunused-function]
security.c:283:12: warning: 'cron_authorize_range' defined but not used [-Wunused-function]
Tom Jones [Thu, 11 Oct 2012 12:00:56 +0000 (14:00 +0200)]
The sysadmin may want to arrange for the PATH to be correct in the
environment from which cron is launched. This new option tells
cron to not overwrite this path for itself or for the child cron
jobs.
Tim Landscheidt [Wed, 6 Jun 2012 15:14:06 +0000 (17:14 +0200)]
Previously, crond exited in the signal handler for SIGINT and SIGTERM.
Thus, the Inotify close code in main() was never reached. This commit
introduces a got_sigintterm variable that is set when SIGINT or SIGTERM
are received and leads to a clean exit of the main loop.
* src/cron.c: Rename quit() to sigintterm_handler(). Add got_sigintterm
variable and set it on SIGINT and SIGTERM. Shorten sleep and exit main
loop on got_sigintterm.
Tim Landscheidt [Wed, 6 Jun 2012 14:49:26 +0000 (16:49 +0200)]
9th bit is overwritten.
Hour bit fields have 24 bits (0..23, 3 bytes). bit_nclear() however in this case is called to clear bits 0..24! Thus, it overwrites the first bit of the following struct member (dom). This is not problematic for normal use as dom is set after hour as are all other fields.
The last field, dow, uses 8 bits so 9 are cleared. This could be the MIN_STAR bit of flags, but as flags is an int, there is probably a padding byte in between; at least I couldn't trigger it to be unset. So this could probably only cause problems on 8-bit systems.
This unit file is used in Fedora. The systemd-user-sessions.service guarantees
everything, what is needed for log in of users, is already running
(ypbind, sssd, ldap, ...).
Cron writes job output to syslog incorrectly. When cron is invoked in a way to print job output to syslog, it does print only the first character of the output. Author: Vitezslav Cizek