]> granicus.if.org Git - cronie/log
cronie
7 years agoRelease new version 1.5.1 cronie-1.5.1
Tomas Mraz [Thu, 23 Jun 2016 17:24:12 +0000 (19:24 +0200)]
Release new version 1.5.1

7 years agoRemove unneeded obsolete SELinux include.
Tomas Mraz [Thu, 23 Jun 2016 17:23:31 +0000 (19:23 +0200)]
Remove unneeded obsolete SELinux include.

7 years agoRemove unneeded obsolete SELinux includes.
Tomas Mraz [Thu, 23 Jun 2016 17:14:52 +0000 (19:14 +0200)]
Remove unneeded obsolete SELinux includes.

7 years agoRename timeval time to tv so time function can be used.
Tomas Mraz [Thu, 23 Jun 2016 17:13:46 +0000 (19:13 +0200)]
Rename timeval time to tv so time function can be used.

7 years agoFix longstanding race condition on crontab modification.
Tomas Mraz [Thu, 23 Jun 2016 15:59:41 +0000 (17:59 +0200)]
Fix longstanding race condition on crontab modification.

If crontab is modified twice at the same second the crond reads it
which means the timestamp will not change, the latest content will
never be read.

7 years agoFix misleading comment in pam configuration file.
Tomas Mraz [Fri, 10 Jun 2016 07:56:03 +0000 (09:56 +0200)]
Fix misleading comment in pam configuration file.

8 years agoanacron: use mkstemp() instead of tempnam()
Tomas Mraz [Fri, 13 May 2016 13:26:46 +0000 (15:26 +0200)]
anacron: use mkstemp() instead of tempnam()

Although the use of tempnam() seemed to be safeguarded
better to not use it at all.

8 years agoanacron: Drop potentially unsafe umask setting.
Tomas Mraz [Fri, 13 May 2016 12:40:45 +0000 (14:40 +0200)]
anacron: Drop potentially unsafe umask setting.

8 years agoanacron: Do not try to mail to empty address.
Tomas Mraz [Fri, 13 May 2016 12:19:09 +0000 (14:19 +0200)]
anacron: Do not try to mail to empty address.

8 years agoClarify the crontab(1) documentation.
Tomas Mraz [Mon, 25 Apr 2016 12:53:06 +0000 (14:53 +0200)]
Clarify the crontab(1) documentation.

8 years agoRemove hardcoded "system_u" SELinux user
Gary Tierney [Fri, 22 Apr 2016 23:33:20 +0000 (00:33 +0100)]
Remove hardcoded "system_u" SELinux user

This gets rid of the hardcoded reference to the ref-policy system_u user
and instead relies on the user that cronie is currently running as.

8 years agoClarify return value.
Tomas Mraz [Mon, 25 Apr 2016 09:13:12 +0000 (11:13 +0200)]
Clarify return value.

8 years agoCorrect instructions for disabling Anacron.
Tomas Mraz [Tue, 15 Mar 2016 07:59:59 +0000 (08:59 +0100)]
Correct instructions for disabling Anacron.

8 years agoMan page syntax fixes
Ville Skyttä [Sat, 7 Nov 2015 09:25:28 +0000 (11:25 +0200)]
Man page syntax fixes

8 years agoInherit PATH from the crond environment if -P option is used.
Robert Byrnes [Thu, 5 Nov 2015 13:38:13 +0000 (14:38 +0100)]
Inherit PATH from the crond environment if -P option is used.

8 years agoIn crontab command use a temporary filename that is ignored by crond.
Tomas Mraz [Mon, 13 Jul 2015 09:19:55 +0000 (11:19 +0200)]
In crontab command use a temporary filename that is ignored by crond.

9 years agoAdd *.patch and *.orig to .gitignore
Tomas Mraz [Thu, 28 May 2015 14:24:17 +0000 (16:24 +0200)]
Add *.patch and *.orig to .gitignore

9 years agoAdd compile to .gitignore.
Tomas Mraz [Thu, 28 May 2015 14:23:28 +0000 (16:23 +0200)]
Add compile to .gitignore.

9 years agoRelease new version 1.5.0 cronie1.5.0
Tomas Mraz [Thu, 28 May 2015 14:19:41 +0000 (16:19 +0200)]
Release new version 1.5.0

- properly create dist tarball even with anacron and PAM disabled

9 years agoMerge tag 'cronie1.4.12'
Tomas Mraz [Thu, 28 May 2015 13:46:45 +0000 (15:46 +0200)]
Merge tag 'cronie1.4.12'

9 years agoPass the job environment also when executing the sendmail.
Tomas Mraz [Thu, 28 May 2015 11:02:16 +0000 (13:02 +0200)]
Pass the job environment also when executing the sendmail.

9 years agodatabase.c: Use POSIX NAME_MAX instead of BSD MAXNAMLEN
Felix Janda [Sat, 31 Jan 2015 17:49:11 +0000 (18:49 +0100)]
database.c: Use POSIX NAME_MAX instead of BSD MAXNAMLEN

fixes compilation with musl libc

9 years agoPrevent adding duplicate orphans on reload.
Tomas Mraz [Tue, 21 Apr 2015 13:15:46 +0000 (15:15 +0200)]
Prevent adding duplicate orphans on reload.

9 years agoDo not overwrite the last zero-byte.
Tomas Mraz [Thu, 5 Feb 2015 15:29:49 +0000 (16:29 +0100)]
Do not overwrite the last zero-byte.

9 years agoLog the crond shutdown.
Tomas Mraz [Tue, 3 Feb 2015 11:25:15 +0000 (12:25 +0100)]
Log the crond shutdown.

9 years agoNo need to call strcmp on already matched variables.
Tomas Mraz [Wed, 28 Jan 2015 17:01:18 +0000 (18:01 +0100)]
No need to call strcmp on already matched variables.

9 years agoUse unbiased random number for RANDOM_DELAY.
Tomas Mraz [Wed, 28 Jan 2015 16:50:36 +0000 (17:50 +0100)]
Use unbiased random number for RANDOM_DELAY.

- also fix possible division by 0

9 years agoCall PAM only when it makes sense.
Tomas Mraz [Wed, 28 Jan 2015 16:36:51 +0000 (17:36 +0100)]
Call PAM only when it makes sense.

- do not check PAM in crontab when uid is 0
- do not call PAM at all in crond for system cron jobs that are
  run as uid 0

9 years agoFix broken test for match_rx() failure.
Tomas Mraz [Wed, 28 Jan 2015 16:31:06 +0000 (17:31 +0100)]
Fix broken test for match_rx() failure.

9 years agoProperly check the existence of the user at the time the job is run.
Tomas Mraz [Tue, 4 Nov 2014 16:53:04 +0000 (17:53 +0100)]
Properly check the existence of the user at the time the job is run.

And do not ignore jobs for users that were not existing at database
reload.

9 years agoNew release 1.4.12. cronie1.4.12
Marcela Mašláňová [Wed, 17 Sep 2014 13:00:40 +0000 (15:00 +0200)]
New release 1.4.12.

COPYING also contains COPYING.anacron, because COPYING should contain all used licenses.

9 years agoServices must be running before starting crond, otherwise many jobs is not running...
Marcela Mašláňová [Wed, 17 Sep 2014 11:46:26 +0000 (13:46 +0200)]
Services must be running before starting crond, otherwise many jobs is not running properly for no obvious reason.

nss-user-lookup.target should help when people are authenticated through nss/sssd.

Based on: https://bugzilla.redhat.com/show_bug.cgi?id=1067236

9 years agoMore logging when getpwnam fails.
Marcela Mašláňová [Wed, 30 Jul 2014 08:18:06 +0000 (10:18 +0200)]
More logging when getpwnam fails.

Based on: rhbz#1123984

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
9 years agoBSD doesn't define environ in unistd.h. Also cronie didn't have option
Marcela Mašláňová [Fri, 25 Jul 2014 15:03:04 +0000 (17:03 +0200)]
BSD doesn't define environ in unistd.h. Also cronie didn't have option
for enabling BSD specifics.

Based on: naota@gentoo.org

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
9 years agoAdd missing brackets into anacron readtab.
Marcela Mašláňová [Fri, 25 Jul 2014 15:02:45 +0000 (17:02 +0200)]
Add missing brackets into anacron readtab.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
9 years agoInclude missing header for signal handlers.
Marcela Mašláňová [Fri, 25 Jul 2014 15:02:05 +0000 (17:02 +0200)]
Include missing header for signal handlers.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
9 years agoMissing reload definition in unit file was added.
Marcela Mašláňová [Fri, 4 Jul 2014 13:20:37 +0000 (15:20 +0200)]
Missing reload definition in unit file was added.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
10 years agoMerge branch 'master' of ssh://git.fedorahosted.org/git/cronie
Marcela Mašláňová [Wed, 30 Apr 2014 12:30:53 +0000 (14:30 +0200)]
Merge branch 'master' of ssh://git.fedorahosted.org/git/cronie

10 years agoClose all unwanted open file descriptors before executing commands and mail.
Tomas Mraz [Tue, 29 Apr 2014 12:08:25 +0000 (14:08 +0200)]
Close all unwanted open file descriptors before executing commands and mail.

There might be file descriptors open by things like pam_systemd that
we do not want to keep open for the child process.

Original idea by: Jakub Jelen <jjelen@redhat.com>

10 years agocrond installs a signal hander for SIGINT & SIGTERM which removes the pid file and...
Martin Poole [Mon, 31 Mar 2014 16:02:30 +0000 (18:02 +0200)]
crond installs a signal hander for SIGINT & SIGTERM which removes the pid file and exits. This handler is not reset for individual forked sub-processes which results in the condition that if the child receives SIGINT or SIGTERM the pid file is erroneously removed.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
10 years agoAnacron does not correctly check configuration parameters
Marcela Mašláňová [Fri, 14 Feb 2014 11:11:05 +0000 (12:11 +0100)]
Anacron does not correctly check configuration parameters

for validity and can segfault on certain data types. The return code from the
match_rx calls in readtab.c are not being checked correctly. Bugfix let
to segfaults in downstreams on non intel architectures. All options in
anacrontab should be now working correctly.

Based on patch from: Martin Poole

10 years agoRemove syslog.target according to Fedora and systemd guidelines.
Marcela Mašláňová [Mon, 20 Jan 2014 08:48:11 +0000 (09:48 +0100)]
Remove syslog.target according to Fedora and systemd guidelines.

https://fedorahosted.org/fpc/ticket/177#comment:2

Thanks to: Ville Skyttä

10 years ago[PATCH] Fix anacron.8 UTF-8 encoding.
Ville Skyttä [Fri, 17 Jan 2014 13:00:17 +0000 (14:00 +0100)]
[PATCH] Fix anacron.8 UTF-8 encoding.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
10 years agoSpelling fixes.
Ville Skyta [Wed, 18 Dec 2013 15:26:24 +0000 (16:26 +0100)]
Spelling fixes.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
10 years agostrncmp() size fixes.
Ville Skytta [Wed, 18 Dec 2013 15:14:54 +0000 (16:14 +0100)]
strncmp() size fixes.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
10 years agoAnacron does not correctly check configuration parameters for validity and can segfau...
Martin Poole [Wed, 18 Dec 2013 13:53:36 +0000 (14:53 +0100)]
Anacron does not correctly check configuration parameters for validity and can segfault on certain data types. The return code from the match_rx calls in readtab.c are not being checked correctly.

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
10 years agocrond -n must change pam setting.
Marcela Mašláňová [Thu, 26 Sep 2013 11:44:46 +0000 (13:44 +0200)]
crond -n must change pam setting.

10 years agoNon-root user can't read configuration. Init file will fail with proper error message.
Marcela Mašláňová [Thu, 12 Sep 2013 08:33:19 +0000 (10:33 +0200)]
Non-root user can't read configuration. Init file will fail with proper error message.

rhbz#1006869

10 years agoMerge branch 'master' of ssh://git.fedorahosted.org/git/cronie
Marcela Mašláňová [Thu, 29 Aug 2013 14:30:21 +0000 (16:30 +0200)]
Merge branch 'master' of ssh://git.fedorahosted.org/git/cronie

10 years agoFix cronie-common.h file not being found correctly in out of tree build.
Saul Wold [Mon, 26 Aug 2013 09:18:27 +0000 (11:18 +0200)]
Fix cronie-common.h file not being found correctly in out of tree build.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
10 years agoPull PAM environment variables also from session modules.
Tomas Mraz [Fri, 16 Aug 2013 16:05:55 +0000 (18:05 +0200)]
Pull PAM environment variables also from session modules.

- also fix memory leak of environment returned by pam_getenvlist()

10 years agoKillMode in systemd unit file will enable to finish jobs executed by cron. Even if...
Marcela Mašláňová [Tue, 13 Aug 2013 10:31:56 +0000 (12:31 +0200)]
KillMode in systemd unit file will enable to finish jobs executed by cron. Even if cron dies, jobs should continue.

Based on: https://bugzilla.redhat.com/show_bug.cgi?id=919290

10 years agoFcntl locking has different semantics than flock. Prefer flock.
Tomas Mraz [Fri, 9 Aug 2013 12:57:57 +0000 (14:57 +0200)]
Fcntl locking has different semantics than flock. Prefer flock.

10 years agoRelease 1.4.11 cronie1.4.11
Marcela Mašláňová [Thu, 18 Jul 2013 13:23:40 +0000 (15:23 +0200)]
Release 1.4.11

10 years agoLog failures in load_user().
Tomas Mraz [Tue, 11 Jun 2013 17:53:59 +0000 (19:53 +0200)]
Log failures in load_user().

10 years agoAdd support for RANDOM_DELAY of jobs.
Tomas Mraz [Tue, 11 Jun 2013 16:58:20 +0000 (18:58 +0200)]
Add support for RANDOM_DELAY of jobs.

10 years agoFixed bug introduced by previous commit and simplified error handling.
Tomas Mraz [Tue, 11 Jun 2013 15:35:46 +0000 (17:35 +0200)]
Fixed bug introduced by previous commit and simplified error handling.

10 years agoCopy some variables from the crond process environment.
Tomas Mraz [Fri, 7 Jun 2013 15:37:32 +0000 (17:37 +0200)]
Copy some variables from the crond process environment.

Also cleanup error handling in load_env().

10 years agosetenv takes 3 arguments
Tomas Mraz [Thu, 6 Jun 2013 18:14:23 +0000 (20:14 +0200)]
setenv takes 3 arguments

10 years agoDo not use putenv with string literal.
Tomas Mraz [Thu, 6 Jun 2013 18:13:26 +0000 (20:13 +0200)]
Do not use putenv with string literal.

11 years agoMake From field in mails from crond RFC compliant.
Tomas Mraz [Thu, 25 Apr 2013 09:02:03 +0000 (11:02 +0200)]
Make From field in mails from crond RFC compliant.

11 years agocron: clarify usage() print out
Sami Kerola [Sun, 30 Dec 2012 00:02:37 +0000 (00:02 +0000)]
cron: clarify usage() print out

The -n option needs argument, which was missing from the usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoanacron: fix shadow declarations
Sami Kerola [Sat, 29 Dec 2012 16:51:03 +0000 (16:51 +0000)]
anacron: fix shadow declarations

Change global variables to have more specific name.  This will make
warnings about shadowing to go away, and may result to a little more
readable code.

log.c:74:35: warning: declaration of 'args' shadows a global declaration [-Wshadow]
global.h:97:15: warning: shadowed declaration is here [-Wshadow]

Reference: http://web.archiveorange.com/archive/v/N6p0RpcfZsIBsaU8B2sE#72jDywyk8NZ3i9g
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agosmatch scan: fix various warningss found using smatch
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'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoMention systemctl command in man page of crond. Based on rhbz#891160.
Marcela Mašláňová [Wed, 2 Jan 2013 12:18:59 +0000 (13:18 +0100)]
Mention systemctl command in man page of crond. Based on rhbz#891160.

11 years agocontrib: remove bashisms
Sami Kerola [Thu, 20 Dec 2012 20:34:11 +0000 (20:34 +0000)]
contrib: remove bashisms

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: corrections to FSF license files, and postal address
Sami Kerola [Thu, 20 Dec 2012 20:34:10 +0000 (20:34 +0000)]
docs: corrections to FSF license files, and postal address

The COPYING and file is replaced by files from GNU web site.

http://www.gnu.org/licenses/gpl-2.0.txt

Postal addresses to FSF in other files are updated to match with the
address in license files.

References: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoinit script: remove bashisms
Sami Kerola [Sun, 2 Dec 2012 00:04:21 +0000 (00:04 +0000)]
init script: remove bashisms

References: https://sourceforge.net/projects/checkbaskisms/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoanacron: make function declarations to be ansi compliant
Sami Kerola [Sat, 1 Dec 2012 23:44:29 +0000 (23:44 +0000)]
anacron: make function declarations to be ansi compliant

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoanacron: remove numeric exit and file descriptor values
Sami Kerola [Sat, 1 Dec 2012 22:43:55 +0000 (22:43 +0000)]
anacron: remove numeric exit and file descriptor values

Use symbolic values from standard header instead.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoanacron: clean up usage() output
Sami Kerola [Sat, 1 Dec 2012 19:13:49 +0000 (19:13 +0000)]
anacron: clean up usage() output

Inform in usage which options will need arguments, and add reference to
manual page.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoanacron: set end job message string to be constant
Sami Kerola [Sat, 1 Dec 2012 18:45:38 +0000 (18:45 +0000)]
anacron: set end job message string to be constant

runjob.c:308:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoanacron: add function attributes
Sami Kerola [Sat, 1 Dec 2012 18:18:02 +0000 (18:18 +0000)]
anacron: add function attributes

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocompile: add function attributes
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.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocompile: fix signed and unsigned warnings
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]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocrond: make usage easier to read
Sami Kerola [Tue, 27 Nov 2012 21:30:16 +0000 (21:30 +0000)]
crond: make usage easier to read

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocrontab: make usage easier to read
Sami Kerola [Tue, 27 Nov 2012 21:17:47 +0000 (21:17 +0000)]
crontab: make usage easier to read

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoNew release 1.4.10. cronie1.4.10
Marcela Mašláňová [Tue, 27 Nov 2012 09:35:28 +0000 (10:35 +0100)]
New release 1.4.10.

11 years agoCondtionalize pam functions.
Marcela Mašláňová [Tue, 27 Nov 2012 09:23:41 +0000 (10:23 +0100)]
Condtionalize pam functions.

11 years agoDrop duplicate -lselinux -laudit.
Tomas Mraz [Tue, 27 Nov 2012 09:01:10 +0000 (10:01 +0100)]
Drop duplicate -lselinux -laudit.

11 years agoFix missing includes for selinux and other types.
Tomas Mraz [Tue, 27 Nov 2012 08:50:49 +0000 (09:50 +0100)]
Fix missing includes for selinux and other types.

11 years agoFix some issues introduced in
Marcela Mašláňová [Tue, 27 Nov 2012 07:37:08 +0000 (08:37 +0100)]
Fix some issues introduced in
c58b1d9 Documentation improvements based on Michael Lass suggestions.

* give -m an own line in manpage
* don't explain -P twice
* correct description of -P to what it actually does

Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
11 years agoFix const usage in crontab.
Tomas Mraz [Mon, 26 Nov 2012 16:44:09 +0000 (17:44 +0100)]
Fix const usage in crontab.

11 years agodocs: anacron fix out dated information about open file limits
Sami Kerola [Thu, 22 Nov 2012 23:18:09 +0000 (23:18 +0000)]
docs: anacron fix out dated information about open file limits

For quite a while open files limit has defaulted to 1024, but rather than
informing what might be the number user should inspect value from own
time.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: fix reference to other manual
Sami Kerola [Thu, 22 Nov 2012 23:05:05 +0000 (23:05 +0000)]
docs: fix reference to other manual

There is no crontabs(4).  For user it makes most sense to look
crontab(1).

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodocs: fix various groff issues
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.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agobuild-sys: make ./configure to seach vi path
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.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodebuging: make Debug macro look like function
Sami Kerola [Sat, 24 Nov 2012 20:06:13 +0000 (20:06 +0000)]
debuging: make Debug macro look like function

This will make indent(1) program not to think it is a clause.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agodeclarations: fix shadow declarations
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]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoincludes: make inclusions clean
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.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoFix up also the const in comment.
Tomas Mraz [Mon, 26 Nov 2012 16:16:30 +0000 (17:16 +0100)]
Fix up also the const in comment.

11 years agovariables: use const where ever possible
Sami Kerola [Sat, 24 Nov 2012 11:18:31 +0000 (11:18 +0000)]
variables: use const where ever possible

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agobuild-sys: reduce selinux and pam compiling scope when possible
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]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocompliancy: do not mix declarations and code
Sami Kerola [Sat, 24 Nov 2012 10:51:18 +0000 (10:51 +0000)]
compliancy: do not mix declarations and code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoclean up: reduce variable passing when they are not used
Sami Kerola [Sat, 24 Nov 2012 10:48:18 +0000 (10:48 +0000)]
clean up: reduce variable passing when they are not used

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoassingments: remove initialization if value is never used
Sami Kerola [Sat, 24 Nov 2012 10:45:14 +0000 (10:45 +0000)]
assingments: remove initialization if value is never used

The next operation with these variables will overwrite the values set at
init.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agocompliancy: use memset() rather than bzero()
Sami Kerola [Sat, 24 Nov 2012 10:35:08 +0000 (10:35 +0000)]
compliancy: use memset() rather than bzero()

Reference: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap03.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agobuild-sys: make clean needs to remove cron-paths.h
Sami Kerola [Sat, 24 Nov 2012 10:29:04 +0000 (10:29 +0000)]
build-sys: make clean needs to remove cron-paths.h

The file is generated at build time.  This change is needed to make
distcheck work without an error.

[...]
ERROR: files left in build directory after distclean:
./src/cron-paths.h

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agobuild-sys: add autotools helper script
Sami Kerola [Sat, 24 Nov 2012 10:18:54 +0000 (10:18 +0000)]
build-sys: add autotools helper script

The script will help building when source code is checked out from git.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
11 years agoDo not log that syslog will be used instead of sendmail if explicitly requested.
Tomas Mraz [Mon, 26 Nov 2012 14:23:00 +0000 (15:23 +0100)]
Do not log that syslog will be used instead of sendmail if explicitly requested.