Compare commits

..

No commits in common. "0de9c5e2863eff18d5b117cc7b4fd486c71c22e1" and "38f79ab6a48738ab621680474f535ecb817df58d" have entirely different histories.

68 changed files with 2593 additions and 2281 deletions

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

104
ChangeLog
View File

@ -1,107 +1,3 @@
2019-10-31 Tomas Mraz <tmraz@fedoraproject.org>
* Release new version 1.5.5
2019-10-31 Tomas Mraz <tmraz@fedoraproject.org>
* Avoid warning for strncat.
2019-10-29 Christian Kastner <ckk@kvr.at>
* crontab.1: Various fixes and improvements
2019-10-30 Christian Kastner <ckk@kvr.at>
* crontab: fsync to check for full disk
2019-10-30 Christian Kastner <ckk@kvr.at>
* crontab: Add Y/N to retry prompt
2019-10-30 Christian Kastner <ckk@kvr.at>
* entries: Explicitly validate upper ranges and steps
2019-10-29 Christian Kastner <ckk@kvr.at>
* crond: report missing newline before EOF
2019-09-09 Christian Hesse <mail@eworm.de>
* do not log carriage return
2019-08-22 sgerwk <sgerwk@aol.com>
* skip directories when given as crontabs
2019-07-22 Stephane Blondon <stephane.blondon@gmail.com>
* crontab -l colors comment lines in a different color
2019-07-09 sgerwk <sgerwk@aol.com>
* fix compile instruction: configure is generated by autogen.sh
2019-07-08 Tomas Mraz <tmraz@fedoraproject.org>
* getdtablesize() can return very high values in containers
2019-05-11 John Horne <jayaich@users.noreply.github.com>
* Power supply name not detected correctly.
2019-05-07 Tomas Mraz <tmraz@fedoraproject.org>
* Revert "Avoid creating pid files when crond doesn't fork"
2019-04-15 Tomas Mraz <tmraz@fedoraproject.org>
* anacron: fix types in comparisons
2019-03-31 Sami Kerola <kerolasa@iki.fi>
* mics: stop using plain integer as NULL pointer
2019-03-31 Sami Kerola <kerolasa@iki.fi>
* cron: fix type in comparison
2019-03-31 Sami Kerola <kerolasa@iki.fi>
* cron: fix variable shadowing
2019-03-31 Sami Kerola <kerolasa@iki.fi>
* cron: mark signal number arguments in signal handlers unused
2019-04-08 Tomáš Mráz <t8m@users.noreply.github.com>
* Update readme.md with recent releases
2019-04-08 Tomas Mraz <tmraz@fedoraproject.org>
* Move allowed() and related function to security.c
2019-03-31 Sami Kerola <kerolasa@iki.fi>
* build-sys: enable anacron by default
2019-03-31 Sami Kerola <kerolasa@iki.fi>
* build-sys: use none-recursive build
2019-04-02 sgerwk <sgerwk@aol.com>
* cronnext: optionally select jobs by substring
2019-03-18 Tomas Mraz <tmraz@fedoraproject.org>
* crond: Do not abort loading crontab prematurely in case of error
2019-03-18 Tomas Mraz <tmraz@fedoraproject.org>
* Release new version 1.5.4
2019-03-18 Tomas Mraz <tmraz@fedoraproject.org> 2019-03-18 Tomas Mraz <tmraz@fedoraproject.org>
* crond: Fix regression from last release * crond: Fix regression from last release

View File

@ -6,9 +6,6 @@ Run the usual autotools combination of:
make make
make install make install
If no "configure" script is present, generate it by:
./autogen.sh
The executable files will be installed in /usr/local/* by default. The executable files will be installed in /usr/local/* by default.
Configure Options Configure Options

View File

@ -1,18 +1,9 @@
AM_CFLAGS = -I$(top_srcdir) SUBDIRS = src man anacron
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
bin_PROGRAMS =
common_nodist =
sbin_PROGRAMS =
dist_noinst_HEADERS = \ dist_noinst_HEADERS = \
cronie_common.h cronie_common.h
EXTRA_DIST += \ EXTRA_DIST = \
README.anacron \
COPYING.anacron \
cronie.init \ cronie.init \
crond.sysconfig \ crond.sysconfig \
contrib/anacrontab \ contrib/anacrontab \
@ -28,7 +19,3 @@ dist_pam_DATA = pam/crond
else else
EXTRA_DIST += pam/crond EXTRA_DIST += pam/crond
endif endif
include anacron/Makemodule.am
include man/Makemodule.am
include src/Makemodule.am

File diff suppressed because it is too large Load Diff

14
NEWS
View File

@ -1,24 +1,10 @@
cronie NEWS -- history of user-visible changes. cronie NEWS -- history of user-visible changes.
Release 1.5.5
* Explicitly validate upper end of range and step to disallow entries
such as: 1-234/5678 * * * * ....
* crond: Report missing newline before EOF in syslog so the line is not
completely silently ignored.
* crontab -l colors comment lines in a different color.
* crond: Revert "Avoid creating pid files when crond doesn't fork".
* anacron is built by default.
* Use non-recursive build.
* cronnext: Allow to optionally select jobs by substring.
Release 1.5.4 Release 1.5.4
* crond: Fix regression from previous release. Only first job from a crontab * crond: Fix regression from previous release. Only first job from a crontab
was being run. was being run.
Release 1.5.3 Release 1.5.3
* Fix CVE-2019-9704 and CVE-2019-9705 to avoid local DoS of the crond. * Fix CVE-2019-9704 and CVE-2019-9705 to avoid local DoS of the crond.
* crontab: Make crontab without arguments fail. * crontab: Make crontab without arguments fail.
* crond: In PAM configuration include system-auth instead of password-auth. * crond: In PAM configuration include system-auth instead of password-auth.

22
README
View File

@ -1,13 +1,11 @@
Cronie contains the standard UNIX daemon crond that runs specified programs at 17. January 2008 mmaslano (at) redhat (dot) com
scheduled times and related tools. The source is based on the original vixie-cron Rename the fork on cronie. The source code could be found here:
and has security and configuration enhancements like the ability to use pam and http://mmaslano.fedorapeople.org/cronie/ or git archive here:
SELinux. git://git.fedorahosted.org/git/cronie.git
And why cronie? See http://www.urbandictionary.com/define.php?term=cronie 3. October 2007 mmaslano (at) redhat (dot) com
This is a clone of 'original' vixie-cron. It was used in Red Hat|Fedora
Contact system and patched for a long time. Now was made clone tagged with
------- version 4.2.
Changes are mainly in git commit messages, some older changes could be
Mailing list: `cronie-devel AT lists.fedorahosted DOT org` found in spec changelog (contrib/vixie-cron.spec).
Bug reports and pull requests can be filled at the Github site.

View File

@ -1,142 +0,0 @@
What is Anacron ?
-----------------
Anacron is a periodic command scheduler. It executes commands at
intervals specified in days. Unlike cron, it does not assume that the
system is running continuously. It can therefore be used to control
the execution of daily, weekly and monthly jobs (or anything with a
period of n days), on systems that don't run 24 hours a day. When
installed and configured properly, Anacron will make sure that the
commands are run at the specified intervals as closely as
machine-uptime permits.
Every time Anacron is run, it reads a configuration file that
specifies the jobs Anacron controls, and their periods in days. If a
job wasn't executed in the last n days, where n is the period of that
job, Anacron executes it. Anacron then records the date in a special
timestamp file that it keeps for each job, so it can know when to run
it again. When all the executed commands terminate, Anacron exits.
It is recommended to run Anacron from the system boot-scripts.
This way the jobs "whose time has come" will be run shortly after the
machine boots. A delay can be specified for each job so that the
machine isn't overloaded at boot time.
In addition to running Anacron from the boot-scripts, it is also
recommended to schedule it as a daily cron-job (usually at an early
morning hour), so that if the machine is kept running for a night,
jobs for the next day will still be executed.
Why this may be useful ?
------------------------
Most Unix-like systems have daily, weekly and monthly scripts that
take care of various "housekeeping chores" such as log-rotation,
updating the "locate" and "man" databases, etc. Daily scripts are
usually scheduled as cron-jobs to execute around 1-7 AM. Weekly
scripts are scheduled to run on Sundays. On machines that are turned
off for the night or for the weekend, these scripts rarely get run.
Anacron solves this problem. These jobs can simply be scheduled as
Anacron-jobs with periods of 1, 7 and a special target called @monthly.
What Anacron is not ?
---------------------
Anacron is not an attempt to make cron redundant. It cannot
currently be used to schedule commands at intervals smaller than days.
It also does not guarantee that the commands will be executed at any
specific day or hour.
It isn't a full-time daemon. It has to be executed from boot
scripts, from cron-jobs, or explicitly.
For more details, see the anacron(8) manpage.
Requirements
------------
- A Linux system. (maybe other *NIX systems)
- A functioning syslog daemon.
- A functioning /usr/lib/sendmail command. (all MTAs should have
that).
Compilation and Installation
----------------------------
- Untar the source package.
- Check the Makefile. Edit as required.
- Check the top of "global.h". You may want to change the syslog
facility and priorities, and the path to your MTA's sendmail
compatible command (/usr/lib/sendmail).
- cd to the directory.
- Type "make".
You can safely ignore warnings of the form: "*.d: No such file or
directory"
- Become root. Type "make install".
Setup
-----
1. Locate your system's daily, weekly and monthly cron-jobs.
See your cron documentation for more details.
2. Decide which of these jobs should be controlled by Anacron.
Remember that Anacron does not guarantee execution at any specific
day of the month, day of the week, or time of day. Jobs for which
the timing is critical should probably not be controlled by
Anacron.
3. Comment these jobs out of their crontab files. (You may have to
use the "crontab" command for this. See the cron documentation.)
4. Put them in /etc/anacrontab. Note that the format is not the same
as the crontab entries. See the anacrontab(5) manpage. Here's an
example from a typical Debian system:
-----Cut
# /etc/anacrontab example
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# format: period delay job-identifier command
1 5 cron.daily run-parts /etc/cron.daily
7 10 cron.weekly run-parts /etc/cron.weekly
@monthly 15 cron.monthly run-parts /etc/cron.monthly
-----Cut
5. Put the command "anacron -s" somewhere in your boot-scripts.
Make sure that syslogd is started before this command.
6. Schedule the command "anacron -s" as a daily cron-job (preferably
at some early morning hour). This will make sure that jobs are run
when the systems is left running for a night.
That's it.
It is a good idea to check what your daily, weekly and monthly scripts
actually do, and disable any parts that may be irrelevant for your
system.
Credits
-------
Anacron was originally conceived and implemented by Christian Schwarz
<schwarz@monet.m.isar.de>.
The current implementation is a complete rewrite by Itai Tzur
<itzur@actcom.co.il>.
Current code base maintained by Sean 'Shaleh' Perry <shaleh@(debian.org|valinux.com)>.

View File

@ -1,7 +0,0 @@
/* This file has been automatically generated. Do not edit. */
#ifndef _ANACRON_PATHS_H_
#define _ANACRON_PATHS_H_
#define ANACRON_SPOOL_DIR "/usr/local/var/spool/anacron"
#define ANACRONTAB "/usr/local/etc/anacrontab"
#endif /* _ANACRON_PATHS_H_ */

View File

@ -1,28 +1,23 @@
# Makefile.am - two binaries crond and crontab # Makefile.am - two binaries crond and crontab
if ANACRON if ANACRON
sbin_PROGRAMS += anacron/anacron sbin_PROGRAMS = anacron
anacron_anacron_SOURCES = \ endif
anacron-paths.h \
anacron/global.h \
anacron/gregor.c \
anacron/gregor.h \
anacron/lock.c \
anacron/log.c \
anacron/main.c \
anacron/matchrx.c \
anacron/matchrx.h \
anacron/readtab.c \
anacron/runjob.c
common_nodist += anacron-paths.h
nodist_anacron_anacron_SOURCES = $(common_nodist)
BUILT_SOURCES += $(common_nodist)
anacron_anacron_LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT) anacron_SOURCES = \
gregor.c lock.c log.c main.c matchrx.c readtab.c runjob.c \
$(common_src)
common_src = global.h gregor.h matchrx.h
common_nodist = anacron-paths.h
nodist_anacron_SOURCES = $(common_nodist)
BUILT_SOURCES = $(common_nodist)
AM_CFLAGS = -I$(top_srcdir)
LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
# This header contains all the paths. # This header contains all the paths.
# If they are configurable, they are declared in configure script. # If they are configurable, they are declared in configure script.
# Depends on this Makefile, because it uses make variables. # Depends on this Makefile, because it uses make variables.
CLEANFILES += anacron-paths.h
anacron-paths.h: Makefile anacron-paths.h: Makefile
@echo 'creating $@' @echo 'creating $@'
@sed >$@ 's/ *\\$$//' <<\END #\ @sed >$@ 's/ *\\$$//' <<\END #\
@ -34,4 +29,3 @@ anacron-paths.h: Makefile
#define ANACRONTAB "$(ANACRONTAB)" \ #define ANACRONTAB "$(ANACRONTAB)" \
#endif /* _ANACRON_PATHS_H_ */ \ #endif /* _ANACRON_PATHS_H_ */ \
END END
endif

647
anacron/Makefile.in Normal file
View File

@ -0,0 +1,647 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ANACRON_TRUE@sbin_PROGRAMS = anacron$(EXEEXT)
subdir = anacron
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)"
PROGRAMS = $(sbin_PROGRAMS)
am__objects_1 =
am_anacron_OBJECTS = gregor.$(OBJEXT) lock.$(OBJEXT) log.$(OBJEXT) \
main.$(OBJEXT) matchrx.$(OBJEXT) readtab.$(OBJEXT) \
runjob.$(OBJEXT) $(am__objects_1)
nodist_anacron_OBJECTS = $(am__objects_1)
anacron_OBJECTS = $(am_anacron_OBJECTS) $(nodist_anacron_OBJECTS)
anacron_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
anacron_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/gregor.Po ./$(DEPDIR)/lock.Po \
./$(DEPDIR)/log.Po ./$(DEPDIR)/main.Po ./$(DEPDIR)/matchrx.Po \
./$(DEPDIR)/readtab.Po ./$(DEPDIR)/runjob.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(anacron_SOURCES) $(nodist_anacron_SOURCES)
DIST_SOURCES = $(anacron_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ANACRONTAB = @ANACRONTAB@
ANACRON_SPOOL_DIR = @ANACRON_SPOOL_DIR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DAEMON_GROUPNAME = @DAEMON_GROUPNAME@
DAEMON_USERNAME = @DAEMON_USERNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBAUDIT = @LIBAUDIT@
LIBOBJS = @LIBOBJS@
LIBPAM = @LIBPAM@
LIBS = @LIBS@
LIBSELINUX = @LIBSELINUX@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPOOL_DIR = @SPOOL_DIR@
STRIP = @STRIP@
SYSCRONTAB = @SYSCRONTAB@
SYS_CROND_DIR = @SYS_CROND_DIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
editor_defined = @editor_defined@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
anacron_SOURCES = \
gregor.c lock.c log.c main.c matchrx.c readtab.c runjob.c \
$(common_src)
common_src = global.h gregor.h matchrx.h
common_nodist = anacron-paths.h
nodist_anacron_SOURCES = $(common_nodist)
BUILT_SOURCES = $(common_nodist)
AM_CFLAGS = -I$(top_srcdir)
LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu anacron/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu anacron/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
} \
; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
anacron$(EXEEXT): $(anacron_OBJECTS) $(anacron_DEPENDENCIES) $(EXTRA_anacron_DEPENDENCIES)
@rm -f anacron$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(anacron_OBJECTS) $(anacron_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gregor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matchrx.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readtab.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runjob.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/gregor.Po
-rm -f ./$(DEPDIR)/lock.Po
-rm -f ./$(DEPDIR)/log.Po
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/matchrx.Po
-rm -f ./$(DEPDIR)/readtab.Po
-rm -f ./$(DEPDIR)/runjob.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-sbinPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/gregor.Po
-rm -f ./$(DEPDIR)/lock.Po
-rm -f ./$(DEPDIR)/log.Po
-rm -f ./$(DEPDIR)/main.Po
-rm -f ./$(DEPDIR)/matchrx.Po
-rm -f ./$(DEPDIR)/readtab.Po
-rm -f ./$(DEPDIR)/runjob.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-sbinPROGRAMS
.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-sbinPROGRAMS cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-sbinPROGRAMS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-sbinPROGRAMS
.PRECIOUS: Makefile
# This header contains all the paths.
# If they are configurable, they are declared in configure script.
# Depends on this Makefile, because it uses make variables.
anacron-paths.h: Makefile
@echo 'creating $@'
@sed >$@ 's/ *\\$$//' <<\END #\
/* This file has been automatically generated. Do not edit. */ \
\
#ifndef _ANACRON_PATHS_H_ \
#define _ANACRON_PATHS_H_ \
#define ANACRON_SPOOL_DIR "$(ANACRON_SPOOL_DIR)" \
#define ANACRONTAB "$(ANACRONTAB)" \
#endif /* _ANACRON_PATHS_H_ */ \
END
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -79,12 +79,7 @@ make_msg(const char *fmt, va_list args)
/* There's some confusion in the documentation about what vsnprintf /* There's some confusion in the documentation about what vsnprintf
* returns when the buffer overflows. Hmmm... */ * returns when the buffer overflows. Hmmm... */
len = vsnprintf(msg, sizeof(msg), fmt, args); len = vsnprintf(msg, sizeof(msg), fmt, args);
if (len < 0) { if (len >= sizeof(msg) - 1)
strncpy(msg, "(vsnprintf failed)", sizeof(msg));
msg[sizeof(msg) - 1] = '\0';
return;
}
if ((size_t) len >= sizeof(msg) - 1)
strcpy(msg + sizeof(msg) - sizeof(truncated), truncated); strcpy(msg + sizeof(msg) - sizeof(truncated), truncated);
} }

View File

@ -42,13 +42,11 @@ match_rx(const char *rx, char *string, unsigned int n_sub, /* char **substrings
* This is not the most efficient, or elegant way of doing this. * This is not the most efficient, or elegant way of doing this.
*/ */
{ {
int r; int r, n;
unsigned int n;
regex_t crx; regex_t crx;
va_list va; va_list va;
char **substring; char **substring;
regmatch_t *sub_offsets; regmatch_t *sub_offsets;
sub_offsets = malloc(sizeof(regmatch_t) * (n_sub + 1)); sub_offsets = malloc(sizeof(regmatch_t) * (n_sub + 1));
if (sub_offsets == NULL) if (sub_offsets == NULL)
return -1; return -1;

View File

@ -53,9 +53,7 @@ temp_file(job_rec *jr)
dir = P_tmpdir; dir = P_tmpdir;
len = snprintf(template, sizeof(template), "%s/$anacronXXXXXX", dir); len = snprintf(template, sizeof(template), "%s/$anacronXXXXXX", dir);
if (len < 0) if (len >= sizeof(template))
die_e("snprintf failed");
else if ((size_t) len >= sizeof(template))
die_e("TMPDIR too long"); die_e("TMPDIR too long");
fdout = mkstemp(template); fdout = mkstemp(template);

29
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for cronie 1.5.5. # Generated by GNU Autoconf 2.69 for cronie 1.5.4.
# #
# Report bugs to <mmaslano@redhat.com,tmraz@fedoraproject.org>. # Report bugs to <mmaslano@redhat.com,tmraz@fedoraproject.org>.
# #
@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='cronie' PACKAGE_NAME='cronie'
PACKAGE_TARNAME='cronie' PACKAGE_TARNAME='cronie'
PACKAGE_VERSION='1.5.5' PACKAGE_VERSION='1.5.4'
PACKAGE_STRING='cronie 1.5.5' PACKAGE_STRING='cronie 1.5.4'
PACKAGE_BUGREPORT='mmaslano@redhat.com,tmraz@fedoraproject.org' PACKAGE_BUGREPORT='mmaslano@redhat.com,tmraz@fedoraproject.org'
PACKAGE_URL='' PACKAGE_URL=''
@ -1307,7 +1307,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures cronie 1.5.5 to adapt to many kinds of systems. \`configure' configures cronie 1.5.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1377,7 +1377,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of cronie 1.5.5:";; short | recursive ) echo "Configuration of cronie 1.5.4:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1396,7 +1396,7 @@ CRONIE_HELP_STRING(--enable-relro,Build cronie with relro flag)
BSD_STRING(--enable-bsd,Build cronie with BSD specific parts) BSD_STRING(--enable-bsd,Build cronie with BSD specific parts)
--enable-pam Alias for --with-pam --enable-pam Alias for --with-pam
--enable-syscrontab Build cronie with system crontab enabled. --enable-syscrontab Build cronie with system crontab enabled.
--disable-anacron Do not build anacron. --enable-anacron Build also anacron.
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -1497,7 +1497,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
cronie configure 1.5.5 cronie configure 1.5.4
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -1977,7 +1977,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by cronie $as_me 1.5.5, which was It was created by cronie $as_me 1.5.4, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -2844,7 +2844,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='cronie' PACKAGE='cronie'
VERSION='1.5.5' VERSION='1.5.4'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -5400,8 +5400,6 @@ fi
# Check whether --enable-anacron was given. # Check whether --enable-anacron was given.
if test "${enable_anacron+set}" = set; then : if test "${enable_anacron+set}" = set; then :
enableval=$enable_anacron; enableval=$enable_anacron;
else
enable_anacron=yes
fi fi
if test "$enable_anacron" = yes; then if test "$enable_anacron" = yes; then
@ -5425,7 +5423,7 @@ if test "$ANACRONTAB" = ""; then
fi fi
ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile anacron/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@ -5965,7 +5963,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by cronie $as_me 1.5.5, which was This file was extended by cronie $as_me 1.5.4, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -6031,7 +6029,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
cronie config.status 1.5.5 cronie config.status 1.5.4
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"
@ -6163,6 +6161,9 @@ do
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
"anacron/Makefile") CONFIG_FILES="$CONFIG_FILES anacron/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac esac

View File

@ -1,8 +1,8 @@
AC_INIT([cronie],[1.5.5],[mmaslano@redhat.com,tmraz@fedoraproject.org]) AC_INIT([cronie],[1.5.4],[mmaslano@redhat.com,tmraz@fedoraproject.org])
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
AC_PREREQ(2.60) AC_PREREQ(2.60)
AM_INIT_AUTOMAKE([subdir-objects]) AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
[AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
@ -253,13 +253,13 @@ CRONIE_CONF_VAR([SYSCRONTAB], [the current working directory of the running daem
CRONIE_CONF_VAR([SYS_CROND_DIR], [the current working directory of the running daemon], [${sysconfdir}/cron.d]) CRONIE_CONF_VAR([SYS_CROND_DIR], [the current working directory of the running daemon], [${sysconfdir}/cron.d])
CRONIE_CONF_VAR([SPOOL_DIR], [the directory where all the user cron tabs reside], [${localstatedir}/spool/cron]) CRONIE_CONF_VAR([SPOOL_DIR], [the directory where all the user cron tabs reside], [${localstatedir}/spool/cron])
AC_ARG_ENABLE([anacron], [AS_HELP_STRING([--disable-anacron], [Do not build anacron.])], [], [enable_anacron=yes]) AC_ARG_ENABLE([anacron], [AS_HELP_STRING([--enable-anacron], [Build also anacron.])])
AM_CONDITIONAL([ANACRON], [test "$enable_anacron" = yes]) AM_CONDITIONAL([ANACRON], [test "$enable_anacron" = yes])
if test "$enable_anacron" != no; then if test "$enable_anacron" != no; then
ANACRON_CONF_VAR([ANACRON_SPOOL_DIR],[The path for anacron locks.],[${localstatedir}/spool/anacron]) ANACRON_CONF_VAR([ANACRON_SPOOL_DIR],[The path for anacron locks.],[${localstatedir}/spool/anacron])
ANACRON_CONF_VAR([ANACRONTAB],[The anacron table for regular jobs.],[${sysconfdir}/anacrontab]) ANACRON_CONF_VAR([ANACRONTAB],[The anacron table for regular jobs.],[${sysconfdir}/anacrontab])
fi fi
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile src/Makefile man/Makefile anacron/Makefile])
AC_OUTPUT AC_OUTPUT

View File

@ -9,7 +9,7 @@ fi
# Do not run jobs when on battery power # Do not run jobs when on battery power
online=1 online=1
for psupply in AC ADP{0..9} ; do for psupply in AC ADP0 ; do
sysfile="/sys/class/power_supply/$psupply/online" sysfile="/sys/class/power_supply/$psupply/online"
if [ -f $sysfile ] ; then if [ -f $sysfile ] ; then

View File

@ -13,4 +13,4 @@ cron is patched), so be sure to read the manpages.
cronie installs a file /etc/cron.deny (empty), thereby enabling all users to cronie installs a file /etc/cron.deny (empty), thereby enabling all users to
use the crontab(1) command by default. use the crontab(1) command by default.
-- Christian Kastner <ckk@debian.org> Sun, 20 Mar 2011 01:27:55 +0100 -- Christian Kastner <debian@kvr.at> Sun, 20 Mar 2011 01:27:55 +0100

88
debian/changelog vendored
View File

@ -1,90 +1,8 @@
cronie (1.5.5-3) experimental; urgency=medium cronie (1.5.4-1) UNRELEASED; urgency=medium
* Add Hurd-workaround-for-PATH_MAX.patch (Closes: #638048) * Bump
* Fix spelling error in previous changelog entry
-- Christian Kastner <ckk@debian.org> Tue, 05 Nov 2019 08:04:37 +0100 -- Mario Fetka <mario.fetka@gmail.com> Tue, 06 Aug 2019 18:29:32 +0200
cronie (1.5.5-2) experimental; urgency=medium
* Don't build /usr/sbin/anacron
/usr/sbin/anacron is still provided by src:anacron.
Thanks, Andreas Beckmann, for catching this! (Closes: #944024)
-- Christian Kastner <ckk@debian.org> Sun, 03 Nov 2019 11:12:33 +0100
cronie (1.5.5-1) experimental; urgency=medium
* New upstream version 1.5.5
* Drop patches (included upstream):
- crond-report-missing-newline-before-EOF.patch
- crontab-Add-Y-N-to-retry-prompt.patch
- crontab-fsync-to-check-for-full-disk.patch
- crontab.1-Various-fixes-and-improvements.patch
- entries-Explicitly-validate-upper-ranges-and-steps.patch
* Refresh patches
- debian/patches/Manpage-and-typo-fixes.patch
- debian/patches/Rename-PAM-service-to-cronie.patch
+ Split out Unbundle-upstream-PAM-config.patch from this one
-- Christian Kastner <ckk@debian.org> Thu, 31 Oct 2019 22:20:05 +0100
cronie (1.5.4-final-2) experimental; urgency=medium
* build: Set default EDITOR to /usr/bin/sensible-editor
* d/patches (added):
- crond-report-missing-newline-before-EOF.patch
- entries-Explicitly-validate-upper-ranges-and-steps.patch
- crontab.1-Various-fixes-and-improvements.patch
- crontab-Add-Y-N-to-retry-prompt.patch
- crontab-fsync-to-check-for-full-disk.patch
-- Christian Kastner <ckk@debian.org> Wed, 30 Oct 2019 21:12:01 +0100
cronie (1.5.4-final-1) experimental; urgency=medium
* New upstream release. (Closes: #697811, #783856)
[ Andreas Henriksson ]
* debian/watch: update for cronie move to github
* Modify patches to apply against new upstream release
* Add debian/gbp.conf
* Adjust and ship the cronie.service file
* Use debian/clean to remove src/cron-paths.h
* Fix lintian warning about not using default-mta
* Fix typo in patch tagging meta-header
[ Christian Kastner ]
* d/control:
- Switch Build-Depends from debhelper to debhelper-compat
- Bump debhelper compatibility level to 12
- Bump Standards-Version to 4.4.1 (no changes needed)
- Remove now obsolete d/compat file
- Set Rules-Requires-Root: no
We don't need (fake)root for building the package.
- Point Homepage to GitHub
- Set Vcs-* URLs for Salsa
- Mark package cronie as Multi-Arch: foreign
- Add Pre-Depends: ${misc:Pre-Depends} to binary package
As recommended by lintian's skip-systemd-native-flag-missing-pre-depends
* d/cronie.default: Add new daemon flag "-P"
* d/rules:
- Add hardening flags
- Stop passing actions to dh_installinit
This has been obsoleted by dependency-based booting in Wheezy, see
https://lists.debian.org/debian-devel/2013/05/msg01109.html
- Use DEB_HOST_ARCH_OS from /usr/share/dpkg/architecture.mk
- Proper passing of CFLAGS through DEB_CFLAGS_MAINT_APPEND
* d/copyright:
- Fix syntax errors
- Switch URL to official policy URL
- Point Source to GitHub
fedorahosted.org has been retired
- Bump copyrights
* d/clean: Remove generated files for (non-enabled) anacron build
* Sync maintscripts with src:cron
-- Christian Kastner <ckk@debian.org> Mon, 28 Oct 2019 19:35:38 +0100
cronie (1.4.8-1~exp1) experimental; urgency=low cronie (1.4.8-1~exp1) experimental; urgency=low

2
debian/clean vendored
View File

@ -1,2 +0,0 @@
src/cron-paths.h
anacron/anacron-paths.h

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

20
debian/control vendored
View File

@ -1,23 +1,20 @@
Source: cronie Source: cronie
Section: admin Section: admin
Priority: optional Priority: optional
Maintainer: Christian Kastner <ckk@debian.org> Maintainer: Christian Kastner <debian@kvr.at>
Build-Depends: Build-Depends:
debhelper-compat (= 12), debhelper (>= 7.2.3~),
dh-autoreconf,
libpam0g-dev, libpam0g-dev,
libselinux1-dev [linux-any], libselinux1-dev [linux-any],
libaudit-dev [linux-any] libaudit-dev [linux-any]
Rules-Requires-Root: no Standards-Version: 3.9.2
Standards-Version: 4.4.1 Homepage: https://fedorahosted.org/cronie/
Homepage: https://github.com/cronie-crond/cronie Vcs-Git: git://scm.kvr.at/git/pkg-cronie.git
Vcs-Git: https://salsa.debian.org/debian/cronie.git Vcs-Browser: http://scm.kvr.at/git/?p=pkg-cronie.git;a=summary
Vcs-Browser: https://salsa.debian.org/debian/cronie
Package: cronie Package: cronie
Architecture: any Architecture: any
Multi-Arch: foreign
Pre-Depends:
${misc:Pre-Depends},
Depends: Depends:
${shlibs:Depends}, ${shlibs:Depends},
${misc:Depends}, ${misc:Depends},
@ -25,7 +22,7 @@ Depends:
lsb-base (>= 3.0-6), lsb-base (>= 3.0-6),
libpam-runtime (>= 1.0.1-11) libpam-runtime (>= 1.0.1-11)
Recommends: Recommends:
default-mta | mail-transport-agent exim4 | mail-transport-agent
Suggests: Suggests:
anacron (>= 2.0-1) anacron (>= 2.0-1)
Provides: cron-daemon, cron Provides: cron-daemon, cron
@ -41,3 +38,4 @@ Description: Process Scheduling Daemon
. .
cronie is fully compatible with ISC cron (Debian's standard job scheduler), cronie is fully compatible with ISC cron (Debian's standard job scheduler),
and can be used as a drop-in replacement for it. and can be used as a drop-in replacement for it.

19
debian/copyright vendored
View File

@ -1,22 +1,22 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=173
Upstream-Name: cronie Upstream-Name: cronie
Upstream-Contact: Marcela Mašláňová <mmaslano@redhat.com> Upstream-Contact: Marcela Mašláňová <mmaslano@redhat.com>
Source: https://github.com/cronie-crond/cronie Source: https://fedorahosted.org/releases/c/r/cronie/
Files: * Files: *
Copyright: 1988,1989,1990,1993,1994, The Regents of the University of California Copyright: 1988,1990,1993,1994, Paul Vixie
1997,2000, Internet Software Consortium, Inc. 1997,2000, Internet Software Consortium, Inc.
2004, Internet Systems Consortium, Inc. ("ISC") 2004, Internet Systems Consortium, Inc. ("ISC")
1997-2019, Red Hat, Inc. 1997-2011, Red Hat, Inc.
2000,2002, Todd C. Miller 2000,2002, Todd C. Miller
2010, Colin Dean 2010, Colin Dean
License: ISC License: ISC
Files: src/popen.c Files: popen.c
Copyright: 1989,1993,1994,2005, The Regents of the University of California Copyright: 1989,1993,1994,2005, The Regents of the University of California
License: BSD-2-clause License: BSD-2-clause
Files: src/bitstring.h Files: bitstring.h
Copyright: 1989,1993,2003, The Regents of the University of California Copyright: 1989,1993,2003, The Regents of the University of California
License: BSD-3-clause License: BSD-3-clause
@ -24,16 +24,15 @@ Files: anacron/*
Copyright: 1998, Itai Tzur <itzur@actcom.co.il> Copyright: 1998, Itai Tzur <itzur@actcom.co.il>
1999, Sean 'Shaleh' Perry <shaleh@debian.org> 1999, Sean 'Shaleh' Perry <shaleh@debian.org>
2004, Pascal Hakim <pasc@redellipse.net> 2004, Pascal Hakim <pasc@redellipse.net>
2009-2019, Red Hat, Inc. 2009-2011, Red Hat, Inc.
License: GPL-2+ License: GPL-2+
Files: debian/* Files: debian/*
Copyright: 2010-2019, Christian Kastner <ckk@debian.org> 2010-2011, Christian Kastner <debian@kvr.at>
2018, Andreas Henriksson <andreas@fatal.se>
License: GPL-3+ License: GPL-3+
Files: debian/patches/* Files: debian/patches/*
Copyright: 2019, Christian Kastner <ckk@debian.org> Copyright: 2011, Christian Kastner <debian@kvr.at>
License: ISC License: ISC
License: ISC License: ISC

View File

@ -6,7 +6,6 @@
# #
# -m <cmd> shell command to use for sending mail instead of sendmail(8) # -m <cmd> shell command to use for sending mail instead of sendmail(8)
# -p lift some restrictions on user crontabs (owner, mode, type) # -p lift some restrictions on user crontabs (owner, mode, type)
# -P Don't set PATH; instead, inherit it from the environment
# -c enable clustering support # -c enable clustering support
# -s send job output to syslog instead of mail # -s send job output to syslog instead of mail
# #

2
debian/cronie.init vendored
View File

@ -11,7 +11,7 @@
# to the user. # to the user.
### END INIT INFO ### END INIT INFO
# Author: Christian Kastner <ckk@debian.org> # Author: Christian Kastner <debian@kvr.at>
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="time-based job scheduler" DESC="time-based job scheduler"

View File

@ -1,65 +0,0 @@
#!/bin/sh
set -e
# Analogous to Debian's ISC cron postinst script (for compatibility reasons)
crondir="/var/spool/cron"
action="$1"
if [ "$action" != configure ]
then
exit 0
fi
# Make sure group "crontab" exists (needed for running SGID)
getent group crontab > /dev/null 2>&1 || addgroup --system crontab
# Make crontab(1) SGID
if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null
then
dpkg-statoverride --update --add root crontab 2755 /usr/bin/crontab
fi
# Adjust permissions for spool dir
# Can't use dpkg-statoverride for this because it doesn't cooperate nicely
# with cron alternatives such as bcron
if [ -d $crondir/crontabs ]
then
# This must be in sync with misc.c:check_spool_dir()
chown root:crontab $crondir/crontabs
chmod 1730 $crondir/crontabs
cd $crondir/crontabs
set +e
# Iterate over each entry in the spool directory, perform some sanity
# checks (see CVE-2017-9525), and chown/chgroup the crontabs
for tab_name in *
do
[ "$tab_name" = "*" ] && continue
tab_links=`stat -c '%h' "$tab_name"`
tab_owner=`stat -c '%U' "$tab_name"`
if [ ! -f "$tab_name" ]
then
echo "Warning: $tab_name is not a regular file!"
continue
elif [ "$tab_links" -ne 1 ]
then
echo "Warning: $tab_name has more than one hard link!"
continue
elif [ "$tab_owner" != "$tab_name" ]
then
echo "Warning: $tab_name name differs from owner $tab_owner!"
continue
fi
chown "$tab_owner:crontab" "$tab_name"
chmod 600 "$tab_name"
done
set -e
fi
#DEBHELPER#
exit 0

11
debian/cronie.postrm vendored
View File

@ -1,11 +0,0 @@
#!/bin/sh
set -e
if [ "$1" = "purge" ]
then
rm -f /etc/cron.allow /etc/cron.deny
fi
#DEBHELPER#
exit 0

View File

10
debian/gbp.conf vendored
View File

@ -1,10 +0,0 @@
[DEFAULT]
pristine-tar = True
debian-branch = debian/master
upstream-branch = upstream/latest
[buildpackage]
sign-tags = True
[pq]
patch-numbers = False

View File

@ -0,0 +1,39 @@
From: Christian Kastner <debian@kvr.at>
Date: Thu, 28 Jul 2011 11:01:03 +0200
Subject: Unbundle anacron
Upstream has integrated anacron into cronie. Debian has its own package, so
we unbundle it (mostly by removing references to it).
Forwarded: not-needed
Last-Update: 2011-07-28
---
man/cron.8 | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
Index: cronie/man/cron.8
===================================================================
--- cronie.orig/man/cron.8 2019-08-06 18:47:39.324000000 +0200
+++ cronie/man/cron.8 2019-08-06 18:47:39.324000000 +0200
@@ -56,8 +56,7 @@
The found crontabs are loaded into the memory.
.I Cron
also searches for
-.I /etc/anacrontab
-and any files in the
+any files in the
.I /etc/cron.d
directory, which have a different format (see
.BR crontab (5)).
@@ -94,9 +93,9 @@
system crontab. Nowadays the file is empty by default. Originally it
was usually used to run daily, weekly, monthly jobs. By default these
jobs are now run through anacron which reads
-.IR /etc/anacrontab
+.IR /etc/crontab
configuration file. See
-.BR anacrontab (5)
+.BR crontab (5)
for more details.
.TP
.IR /etc/cron.d/

View File

@ -0,0 +1,41 @@
From: Christian Kastner <debian@kvr.at>
Date: Thu, 28 Jul 2011 11:11:45 +0200
Subject: Rename PAM service to cronie
Upstream uses "crond"; we switch to "cron" to avoid confusion with Debian's ISC
cron (it uses "cron" but that might change).
Forwaded: not-needed
Last-Update: 2011-07-28
---
Makefile.am | 5 -----
src/security.c | 2 +-
2 files changed, 1 insertions(+), 6 deletions(-)
Index: cronie/Makefile.am
===================================================================
--- cronie.orig/Makefile.am 2019-08-06 18:53:14.280000000 +0200
+++ cronie/Makefile.am 2019-08-06 18:54:00.684000000 +0200
@@ -13,9 +13,3 @@
contrib/cronie.systemd \
anacron/ChangeLog.anacron
-if PAM
-pamdir = $(sysconfdir)/pam.d
-dist_pam_DATA = pam/crond
-else
-EXTRA_DIST += pam/crond
-endif
Index: cronie/src/security.c
===================================================================
--- cronie.orig/src/security.c 2019-08-06 18:53:14.280000000 +0200
+++ cronie/src/security.c 2019-08-06 18:53:43.064000000 +0200
@@ -195,7 +195,7 @@
int cron_start_pam(struct passwd *pw) {
int retcode = 0;
- retcode = pam_start("crond", pw->pw_name, &conv, &pamh);
+ retcode = pam_start("cronie", pw->pw_name, &conv, &pamh);
PAM_FAIL_CHECK;
retcode = pam_set_item(pamh, PAM_TTY, "cron");
PAM_FAIL_CHECK;

View File

@ -1,4 +1,4 @@
From: Christian Kastner <ckk@kvr.at> From: Christian Kastner <debian@kvr.at>
Date: Sun, 7 Aug 2011 19:48:09 +0200 Date: Sun, 7 Aug 2011 19:48:09 +0200
Subject: Extend support for kFreeBSD and GNU HURD Subject: Extend support for kFreeBSD and GNU HURD
@ -8,15 +8,15 @@ to do so
Forwarded: no Forwarded: no
Last-Update: 2011-08-07 Last-Update: 2011-08-07
--- ---
src/entry.c | 2 +- src/entry.c | 2 +-
src/pathnames.h | 2 +- src/pathnames.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-) 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/entry.c b/src/entry.c Index: cronie/src/entry.c
index e3a3b1d..1de1bd0 100644 ===================================================================
--- a/src/entry.c --- cronie.orig/src/entry.c 2019-08-06 18:57:12.824000000 +0200
+++ b/src/entry.c +++ cronie/src/entry.c 2019-08-06 18:57:12.812000000 +0200
@@ -379,7 +379,7 @@ entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw, @@ -379,7 +379,7 @@
} }
else else
log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0); log_it("CRON", getpid(), "ERROR", "can't set LOGNAME", 0);
@ -25,10 +25,10 @@ index e3a3b1d..1de1bd0 100644
if (glue_strings(envstr, sizeof envstr, "USER", pw->pw_name, '=')) { if (glue_strings(envstr, sizeof envstr, "USER", pw->pw_name, '=')) {
if ((tenvp = env_set(e->envp, envstr)) == NULL) { if ((tenvp = env_set(e->envp, envstr)) == NULL) {
ecode = e_memory; ecode = e_memory;
diff --git a/src/pathnames.h b/src/pathnames.h Index: cronie/src/pathnames.h
index 1d716be..f8c53fe 100644 ===================================================================
--- a/src/pathnames.h --- cronie.orig/src/pathnames.h 2019-08-06 18:57:12.824000000 +0200
+++ b/src/pathnames.h +++ cronie/src/pathnames.h 2019-08-06 18:57:12.812000000 +0200
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
#ifndef _PATHNAMES_H_ #ifndef _PATHNAMES_H_
#define _PATHNAMES_H_ #define _PATHNAMES_H_

View File

@ -1,81 +0,0 @@
From: Christian Kastner <ckk@kvr.at>
Date: Thu, 28 Jul 2011 11:15:01 +0200
Subject: Debian-specific paths and features
Use Debian-specific paths and features. For example, the spool dir differs from
upstream, and we always build to use syslog.
Forwarded: not-needed
Last-Update: 2011-07-28
---
man/cron.8 | 15 ++-------------
man/crontab.1 | 2 +-
man/crontab.5 | 2 +-
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/man/cron.8 b/man/cron.8
index 48f3bdb..e6a3f31 100644
--- a/man/cron.8
+++ b/man/cron.8
@@ -41,7 +41,7 @@ is automatically started at boot time.
.PP
.I Cron
searches
-.I /var/spool/cron
+.I /var/spool/cron/crontabs
for crontab files which are named after user accounts;
together with the system crontab
.IR /etc/crontab ,
@@ -88,7 +88,7 @@ for more details.
.IR /etc/cron.d/
directory that contains system cronjobs stored for different users.
.TP
-.IR /var/spool/cron
+.IR /var/spool/cron/crontabs
directory that contains user crontables created by the
.BR crontab (1)
command.
@@ -178,17 +178,6 @@ This option allows you to set debug flags.
.TP
.B "\-V"
Print version and exit.
-.SH SIGNALS
-When the
-.I SIGHUP
-is received, the
-.I Cron
-daemon will close and reopen its log file. This proves to be useful in
-scripts which rotate and age log files. Naturally, this is not relevant
-if
-.I Cron
-was built to use
-.IR syslog (3).
.SH CLUSTERING SUPPORT
In this version of
.IR Cron
diff --git a/man/crontab.1 b/man/crontab.1
index 3c448f6..16f6af0 100644
--- a/man/crontab.1
+++ b/man/crontab.1
@@ -63,7 +63,7 @@ you can define more crontabs for each range. For more information, see
In this version of
.IR Cron
it is possible to use a network-mounted shared
-.I /var/spool/cron
+.I /var/spool/cron/crontabs
across a cluster of hosts and specify that only one of the hosts should
run the crontab jobs in the particular directory at any one time. You
may also use
diff --git a/man/crontab.5 b/man/crontab.5
index cb27d23..2fd1fe7 100644
--- a/man/crontab.5
+++ b/man/crontab.5
@@ -295,7 +295,7 @@ MLS_LEVEL=SystemHigh
.SH FILES
.I /etc/crontab
main system crontab file.
-.I /var/spool/cron/
+.I /var/spool/cron/crontabs
a directory for storing crontabs defined by users.
.I /etc/cron.d/
a directory for storing system crontabs.

View File

@ -1,29 +0,0 @@
From: Christian Kastner <ckk@kvr.at>
Date: Tue, 5 Nov 2019 07:52:09 +0100
Subject: Hurd workaround for PATH_MAX
PATH_MAX is not defined on GNU Hurd, which is legal according to POSIX.
https://www.gnu.org/software/hurd/hurd/porting/guidelines.html
Bug-Debian: https://bugs.debian.org/638048
---
src/macros.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/macros.h b/src/macros.h
index cba5fb2..67402db 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -43,6 +43,11 @@
#define DEBUGGING FALSE
#endif
+/* Gnu Hurd has no limit on pathnames */
+#if !defined PATH_MAX && defined __GNU__
+#define PATH_MAX 4096
+#endif
+
#define INIT_PID 1 /* parent of orphans */
#define READ_PIPE 0 /* which end of a pipe pair do you read? */
#define WRITE_PIPE 1 /* or write to? */

View File

@ -1,141 +0,0 @@
From: Christian Kastner <ckk@kvr.at>
Date: Thu, 28 Jul 2011 11:07:40 +0200
Subject: Manpage and typo fixes
Correct some errors or clarify sections in the manpages; fix some typos
---
man/cron.8 | 43 ++++++++++++++++---------------------------
man/crontab.1 | 2 +-
man/crontab.5 | 2 +-
src/cron.c | 2 +-
4 files changed, 19 insertions(+), 30 deletions(-)
diff --git a/man/cron.8 b/man/cron.8
index 184c0bf..48f3bdb 100644
--- a/man/cron.8
+++ b/man/cron.8
@@ -37,23 +37,15 @@ crond \- daemon to execute scheduled commands
.B -V
.SH DESCRIPTION
.I Cron
-is started from
-.I /etc/rc.d/init.d
-or
-.I /etc/init.d
-when classical sysvinit scripts are used. In case systemd is enabled, then unit file is installed into
-.I /lib/systemd/system/crond.service
-and daemon is started by
-.I systemctl start crond.service
-command. It returns immediately, thus, there is no need to need to start it with
-the '&' parameter.
+is automatically started at boot time.
.PP
.I Cron
searches
.I /var/spool/cron
-for crontab files which are named after accounts in
-.I /etc/passwd;
-The found crontabs are loaded into the memory.
+for crontab files which are named after user accounts;
+together with the system crontab
+.IR /etc/crontab ,
+the found crontabs are loaded into the memory.
.I Cron
also searches for
any files in the
@@ -71,12 +63,11 @@ also be sent to syslog by using the
option.
.PP
There are two ways how changes in crontables are checked. The first
-method is checking the modtime of a file. The second method is using the
-inotify support. Using of inotify is logged in the
-.I /var/log/cron
-log after the daemon is started. The inotify support checks for changes
-in all crontables and accesses the hard disk only when a change is
-detected.
+method is checking the modtime of a file. The second method
+is using inotify support, which is only available on Linux.
+When the daemon uses inotify, it logs this fact to syslog on startup.
+The inotify support checks for changes in all crontables and accesses the
+hard disk only when a change is detected.
.PP
When using the modtime option,
.I Cron
@@ -99,13 +90,8 @@ directory that contains system cronjobs stored for different users.
.TP
.IR /var/spool/cron
directory that contains user crontables created by the
-.IR crontab
-command.
-.PP
-Note that the
.BR crontab (1)
-command updates the modtime of the spool directory whenever it changes a
-crontab.
+command.
.PP
.SS Daylight Saving Time and other time changes
Local time changes of less than three hours, such as those caused by the
@@ -153,7 +139,6 @@ This command must accept a fully formatted mail message (with headers) on
standard input and send it as a mail message to the recipients specified
in the mail headers. Specifying the string
.I "off"
-(i.e., crond -m off)
will disable the sending of mail.
.TP
.B "\-n"
@@ -164,10 +149,14 @@ must not enable
.I pam_loginuid.so
module.
.TP
+.B "\-i"
+Disables inotify support (if present)
+.TP
.B "\-p"
Allows
.I Cron
-to accept any user set crontables.
+to accept any user set crontables (read: lift owner, type and mode
+restrictions)
.TP
.B "\-P"
Don't set PATH. PATH is instead inherited from the environment.
diff --git a/man/crontab.1 b/man/crontab.1
index 47b0b8f..3c448f6 100644
--- a/man/crontab.1
+++ b/man/crontab.1
@@ -104,7 +104,7 @@ or modify system cron jobs in the
.IR /etc/cron.d/
directory.
.PP
-The temporary directory can be set in an environment variable. If it is
+The temporary directory can be set using the environment variable $TMPDIR. If it is
not set by the user, the
.I /tmp
directory is used.
diff --git a/man/crontab.5 b/man/crontab.5
index fe716fc..cb27d23 100644
--- a/man/crontab.5
+++ b/man/crontab.5
@@ -248,7 +248,7 @@ CRON_TZ=Japan
# run at 2:15pm on the first of every month -- output mailed to paul
15 14 1 * * $HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe
-0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
+0 22 * * 1-5 mail \-s "It's 10pm" joe%Joe,%%Where are your kids?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
5 4 * * sun echo "run at 5 after 4 every sunday"
.fi
diff --git a/src/cron.c b/src/cron.c
index 7eabfe9..59fb840 100644
--- a/src/cron.c
+++ b/src/cron.c
@@ -182,7 +182,7 @@ static void usage(void) {
fprintf(stderr, "\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -h print this message \n");
- fprintf(stderr, " -i deamon runs without inotify support\n");
+ fprintf(stderr, " -i daemon runs without inotify support\n");
fprintf(stderr, " -m <comm> off, or specify preferred client for sending mails\n");
fprintf(stderr, " -n run in foreground\n");
fprintf(stderr, " -p permit any crontab\n");

View File

@ -1,26 +0,0 @@
From: Christian Kastner <ckk@kvr.at>
Date: Thu, 28 Jul 2011 11:11:45 +0200
Subject: Rename PAM service to cronie
Upstream uses "crond"; we switch to "cron" to avoid confusion with Debian's ISC
cron (it uses "cron" but that might change).
Forwarded: not-needed
Last-Update: 2011-07-28
---
src/security.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security.c b/src/security.c
index d4d768e..8fd0642 100644
--- a/src/security.c
+++ b/src/security.c
@@ -195,7 +195,7 @@ int cron_set_job_security_context(entry *e, user *u ATTRIBUTE_UNUSED,
int cron_start_pam(struct passwd *pw) {
int retcode = 0;
- retcode = pam_start("crond", pw->pw_name, &conv, &pamh);
+ retcode = pam_start("cronie", pw->pw_name, &conv, &pamh);
PAM_FAIL_CHECK;
retcode = pam_set_item(pamh, PAM_TTY, "cron");
PAM_FAIL_CHECK;

View File

@ -1,42 +0,0 @@
From: Christian Kastner <ckk@kvr.at>
Date: Thu, 28 Jul 2011 11:01:03 +0200
Subject: Unbundle anacron
Upstream has integrated anacron into cronie. Debian has its own package, so
we unbundle it (mostly by removing references to it).
Forwarded: not-needed
Last-Update: 2011-07-28
---
man/cron.8 | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/man/cron.8 b/man/cron.8
index 435f7cc..184c0bf 100644
--- a/man/cron.8
+++ b/man/cron.8
@@ -56,8 +56,7 @@ for crontab files which are named after accounts in
The found crontabs are loaded into the memory.
.I Cron
also searches for
-.I /etc/anacrontab
-and any files in the
+any files in the
.I /etc/cron.d
directory, which have a different format (see
.BR crontab (5)).
@@ -91,12 +90,8 @@ used when inotify can not be initialized.
checks these files and directories:
.TP
.IR /etc/crontab
-system crontab. Nowadays the file is empty by default. Originally it
-was usually used to run daily, weekly, monthly jobs. By default these
-jobs are now run through anacron which reads
-.IR /etc/anacrontab
-configuration file. See
-.BR anacrontab (5)
+system crontab, usually used to run daily, weekly, monthly jobs. See
+.BR crontab (5)
for more details.
.TP
.IR /etc/cron.d/

View File

@ -1,29 +0,0 @@
From: Christian Kastner <ckk@kvr.at>
Date: Thu, 31 Oct 2019 22:16:13 +0100
Subject: Unbundle upstream PAM config
We supply our own PAM config, tailored to the Debian setup.
Last-Update: 2019-10-31
---
Makefile.am | 7 -------
1 file changed, 7 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 8b95e6e..054558e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,13 +22,6 @@ EXTRA_DIST += \
contrib/cronie.systemd \
anacron/ChangeLog.anacron
-if PAM
-pamdir = $(sysconfdir)/pam.d
-dist_pam_DATA = pam/crond
-else
-EXTRA_DIST += pam/crond
-endif
-
include anacron/Makemodule.am
include man/Makemodule.am
include src/Makemodule.am

View File

@ -1,29 +0,0 @@
From: Andreas Henriksson <andreas@fatal.se>
Date: Mon, 28 Oct 2019 19:33:53 +0100
Subject: Adjust the cronie.service file for debian use
Use default file instead of sysconfig, as shipped by this
package (debian/cronie.default) and also modify the variable
on ExecStart line as for what is used in the shipped default
file.
Forwarded: not-needed
---
contrib/cronie.systemd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/cronie.systemd b/contrib/cronie.systemd
index 19f2a98..fd5a466 100644
--- a/contrib/cronie.systemd
+++ b/contrib/cronie.systemd
@@ -3,8 +3,8 @@ Description=Command Scheduler
After=auditd.service nss-user-lookup.target systemd-user-sessions.service time-sync.target ypbind.service autofs.service
[Service]
-EnvironmentFile=/etc/sysconfig/crond
-ExecStart=/usr/sbin/crond -n $CRONDARGS
+EnvironmentFile=/etc/default/cronie
+ExecStart=/usr/sbin/crond -n $DAEMON_ARGS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure

11
debian/patches/series vendored
View File

@ -1,8 +1,3 @@
Unbundle-anacron.patch 0001-Unbundle-anacron.patch
Manpage-and-typo-fixes.patch 0003-Rename-PAM-service-to-cronie.patch
Rename-PAM-service-to-cronie.patch 0005-Extend-support-for-kFreeBSD-and-GNU-HURD.patch
Unbundle-upstream-PAM-config.patch
Debian-specific-paths-and-features.patch
Extend-support-for-kFreeBSD-and-GNU-HURD.patch
cronie-service-debianization.patch
Hurd-workaround-for-PATH_MAX.patch

37
debian/postinst vendored Normal file
View File

@ -0,0 +1,37 @@
#!/bin/sh
set -e
# Analogous to Debian's ISC cron postinst script (for compatibility reasons)
tabsdir="/var/spool/cron/crontabs"
# Make sure group "crontab" exists (needed for running SGID)
getent group crontab > /dev/null 2>&1 || addgroup --system crontab
# Make crontab(1) SGID
if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null
then
dpkg-statoverride --update --add root crontab 2755 /usr/bin/crontab
fi
# Adjust permissions for spool dir
# Can't use dpkg-statoverride for this because it doesn't cooperate nicely
# with cron alternatives such as bcron
if [ -d $tabsdir ] ; then
chown root:crontab $tabsdir
# This must be in sync with misc.c:check_spool_dir()
chmod 1730 $tabsdir
cd $tabsdir
if [ -n "`ls -A $tabsdir`" ]
then
for tabname in *
do
chown $tabname:crontab $tabname && chmod 600 $tabname || continue
done
fi
fi
#DEBHELPER#
exit 0

6
debian/prerm vendored Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -e
#DEBHELPER#
exit 0

48
debian/rules vendored
View File

@ -3,32 +3,21 @@
# Uncomment this to turn on verbose mode. # Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1 #export DH_VERBOSE=1
# For DEB_HOST_ARCH_OS
include /usr/share/dpkg/architecture.mk
# Add build flags # Add build flags
export DEB_CFLAGS_MAINT_APPEND = -Wall CFLAGS += -Wall
# Add hardening flags
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Build the config options string # Build the config options string
CONFIG_OPTIONS = CONFIG_OPTIONS =
# anacron is still being provided by src:anacron
CONFIG_OPTIONS += --disable-anacron
# Default EDITOR path
CONFIG_OPTIONS += --with-editor=/usr/bin/sensible-editor
# PAM is enabled by default # PAM is enabled by default
ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS))) ifeq (,$(findstring nopam,$(DEB_BUILD_OPTIONS)))
CONFIG_OPTIONS += --with-pam CONFIG_OPTIONS += --with-pam
endif endif
##########################
### Linux-only options ### ### Linux-only options ###
ifeq ($(DEB_HOST_ARCH_OS), linux) ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), linux)
# SELINUX is enabled by default # SELINUX is enabled by default
ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS))) ifeq (,$(findstring noselinux,$(DEB_BUILD_OPTIONS)))
@ -46,31 +35,34 @@ ifneq (,$(findstring withaudit,$(DEB_BUILD_OPTIONS)))
endif endif
endif endif
##### End Linux-only ##### ### End Linux-only ###
##########################
%: %:
dh $@ dh $@ --with autoreconf
# Set SPOOL_DIR to Debian's traditional location for crontabs (see Policy) # Set SPOOL_DIR to Debian's traditional location for crontabs (see Policy)
# Set CRON_GROUP to "crontab" to enable SGID functionality (avoids SUID) # Set CRON_GROUP to "crontab" to enable SGID functionality (avoids SUID)
override_dh_auto_configure: override_dh_auto_configure:
SPOOL_DIR=/var/spool/cron/crontabs \ SPOOL_DIR=/var/spool/cron/crontabs dh_auto_configure CRON_GROUP=crontab -- $(CONFIG_OPTIONS)
dh_auto_configure CRON_GROUP=crontab -- $(CONFIG_OPTIONS)
override_dh_install: override_dh_install:
dh_install dh_install
# Create /etc/cron.deny to allow crontab(1) for all users by default # Create /etc/cron.deny to allow crontab(1) for all users by default
install -m 644 debian/etc/cronie.deny debian/cronie/etc/cron.deny install -m 644 debian/cronie.deny debian/cronie/etc/cron.deny
# System-wide crontab # System-wide crontab
install -m 644 debian/etc/crontab.system debian/cronie/etc/crontab install -m 644 debian/crontab.system debian/cronie/etc/crontab
# Placeholders for dpkg # Placeholders for dpkg
install -m 644 debian/etc/placeholder debian/cronie/etc/cron.d/.placeholder install -m 644 debian/placeholder debian/cronie/etc/cron.d/.placeholder
install -m 644 debian/etc/placeholder debian/cronie/etc/cron.hourly/.placeholder install -m 644 debian/placeholder debian/cronie/etc/cron.hourly/.placeholder
install -m 644 debian/etc/placeholder debian/cronie/etc/cron.daily/.placeholder install -m 644 debian/placeholder debian/cronie/etc/cron.daily/.placeholder
install -m 644 debian/etc/placeholder debian/cronie/etc/cron.weekly/.placeholder install -m 644 debian/placeholder debian/cronie/etc/cron.weekly/.placeholder
install -m 644 debian/etc/placeholder debian/cronie/etc/cron.monthly/.placeholder install -m 644 debian/placeholder debian/cronie/etc/cron.monthly/.placeholder
# systemd service file
install -d -m 755 debian/cronie/lib/systemd/system/ # Don't need stop (redundant with sendsigs)
install -m 644 contrib/cronie.systemd debian/cronie/lib/systemd/system/cronie.service override_dh_installinit:
dh_installinit -- start 89 2 3 4 5 .
override_dh_clean:
dh_clean
rm -f src/cron-paths.h

6
debian/watch vendored
View File

@ -1,3 +1,3 @@
version=4 version=3
opts=filenamemangle=s/.+\/cronie-(\d\S+)\.tar\.gz/cronie-$1\.tar\.gz/ \
https://github.com/cronie-crond/cronie/releases .*/cronie-(\d\S+)\.tar\.gz https://fedorahosted.org/releases/c/r/cronie/cronie-(.*)\.tar\.gz

6
man/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
dist_man_MANS = crontab.1 crontab.5 cron.8 crond.8 cronnext.1
EXTRA_DIST = anacrontab.5 anacron.8
if ANACRON
dist_man_MANS += $(EXTRA_DIST)
endif

593
man/Makefile.in Normal file
View File

@ -0,0 +1,593 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ANACRON_TRUE@am__append_1 = $(EXTRA_DIST)
subdir = man
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \
"$(DESTDIR)$(man8dir)"
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
NROFF = nroff
MANS = $(dist_man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ANACRONTAB = @ANACRONTAB@
ANACRON_SPOOL_DIR = @ANACRON_SPOOL_DIR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DAEMON_GROUPNAME = @DAEMON_GROUPNAME@
DAEMON_USERNAME = @DAEMON_USERNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBAUDIT = @LIBAUDIT@
LIBOBJS = @LIBOBJS@
LIBPAM = @LIBPAM@
LIBS = @LIBS@
LIBSELINUX = @LIBSELINUX@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPOOL_DIR = @SPOOL_DIR@
STRIP = @STRIP@
SYSCRONTAB = @SYSCRONTAB@
SYS_CROND_DIR = @SYS_CROND_DIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
editor_defined = @editor_defined@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
dist_man_MANS = crontab.1 crontab.5 cron.8 crond.8 cronnext.1 \
$(am__append_1)
EXTRA_DIST = anacrontab.5 anacron.8
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu man/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-man5: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man5dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.5[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
done; }
uninstall-man5:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man5dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.5[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
install-man8: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man8dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.8[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
done; }
uninstall-man8:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man8dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.8[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1 install-man5 install-man8
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-man1 install-man5 \
install-man8 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \
uninstall uninstall-am uninstall-man uninstall-man1 \
uninstall-man5 uninstall-man8
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,16 +0,0 @@
dist_man_MANS = \
man/cron.8 \
man/crond.8 \
man/cronnext.1 \
man/crontab.1 \
man/crontab.5
anacron_man = \
man/anacrontab.5 \
man/anacron.8
EXTRA_DIST += $(anacron_man)
if ANACRON
dist_man_MANS += $(anacron_man)
endif

View File

@ -6,7 +6,7 @@ cronnext \- time of next job cron will execute
.B cronnext .B cronnext
[\fB-i \fIusers\fR] [\fB-e \fIusers\fR] [\fB-s\fR] [\fB-i \fIusers\fR] [\fB-e \fIusers\fR] [\fB-s\fR]
[\fB-a\fR] [\fB-a\fR]
[\fB-t \fItime\fR] [\fB-q \fItime\fR] [\fB-j \fIcommand\fR] [\fB-t \fItime\fR] [\fB-q \fItime\fR]
[\fB-l\fR] [\fB-c\fR] [\fB-f\fR] [\fB-h\fR] [\fB-V\fR] [\fB-l\fR] [\fB-c\fR] [\fB-f\fR] [\fB-h\fR] [\fB-V\fR]
[file]... [file]...
.SH DESCRIPTION .SH DESCRIPTION
@ -52,9 +52,6 @@ and is internally rounded to the minute.
Do not check jobs over this time, expressed in the same way as in option Do not check jobs over this time, expressed in the same way as in option
.BR -t . .BR -t .
.TP .TP
.BI "\-j " command
Only look for jobs that contain \fIcommand\fP as a substring.
.TP
.B \-l .B \-l
Print the whole entries of the jobs that are the next to be executed by cron. Print the whole entries of the jobs that are the next to be executed by cron.
The default is to only print their next time of execution. The default is to only print their next time of execution.

View File

@ -22,7 +22,7 @@
.\" .\"
.\" $Id: crontab.1,v 1.7 2004/01/23 19:03:32 vixie Exp $ .\" $Id: crontab.1,v 1.7 2004/01/23 19:03:32 vixie Exp $
.\" .\"
.TH CRONTAB 1 "2019-10-29" "cronie" "User Commands" .TH CRONTAB 1 "2012-11-22" "cronie" "User Commands"
.SH NAME .SH NAME
crontab \- maintains crontab files for individual users crontab \- maintains crontab files for individual users
.SH SYNOPSIS .SH SYNOPSIS
@ -67,21 +67,18 @@ it is possible to use a network-mounted shared
across a cluster of hosts and specify that only one of the hosts should across a cluster of hosts and specify that only one of the hosts should
run the crontab jobs in the particular directory at any one time. You run the crontab jobs in the particular directory at any one time. You
may also use may also use
.BR crontab .BR crontab (1)
from any of these hosts to edit the same shared set of crontab files, and from any of these hosts to edit the same shared set of crontab files, and
to set and query which host should run the crontab jobs. to set and query which host should run the crontab jobs.
.PP .PP
Scheduling cron jobs with Running cron jobs can be allowed or disallowed for different users. For
.BR crontab this purpose, use the
can be allowed or disallowed for different users. For this purpose, use the
.I cron.allow .I cron.allow
and and
.I cron.deny .I cron.deny
files. If the files. If the
.I cron.allow .I cron.allow
file exists, a user must be listed in it to be allowed to use file exists, a user must be listed in it to be allowed to use cron If the
.BR crontab .
If the
.I cron.allow .I cron.allow
file does not exist but the file does not exist but the
.I cron.deny .I cron.deny
@ -89,17 +86,12 @@ file does exist, then a user must
.I not .I not
be listed in the be listed in the
.I cron.deny .I cron.deny
file in order to use file in order to use cron. If neither of these files exists, only the
.BR crontab. super user is allowed to use cron. Another way to restrict access to
If neither of these files exist, then only the super user is allowed to use cron is to use PAM authentication in
.BR crontab .
.PP
Another way to restrict the scheduling of cron jobs beyond
.BR crontab
is to use PAM authentication in
.I /etc/security/access.conf .I /etc/security/access.conf
to set up users, which are allowed or disallowed to use to set up users, which are allowed or disallowed to use
.BR crontab .I crontab
or modify system cron jobs in the or modify system cron jobs in the
.IR /etc/cron.d/ .IR /etc/cron.d/
directory. directory.
@ -114,12 +106,12 @@ directory is used.
.B "\-u" .B "\-u"
Specifies the name of the user whose crontab is to be modified. If this Specifies the name of the user whose crontab is to be modified. If this
option is not used, option is not used,
.BR crontab .I crontab
examines "your" crontab, i.e., the crontab of the person executing the examines "your" crontab, i.e., the crontab of the person executing the
command. If no crontab exists for a particular user, it is created for command. If no crontab exists for a particular user, it is created for
them the first time the him the first time the
.B crontab -u .B crontab -u
command is used under their username. command is used under his username.
.TP .TP
.B "\-l" .B "\-l"
Displays the current crontab on standard output. Displays the current crontab on standard output.
@ -186,27 +178,6 @@ option.
.TP .TP
.B "\-V" .B "\-V"
Print version and exit. Print version and exit.
.SH CAVEATS
The files
.I cron.allow
and
.I cron.deny
cannot be used to restrict the execution of cron jobs; they only restrict the
use of
.BR crontab .
In particular, restricting access to
.BR crontab
has no effect on an existing
.I crontab
of a user. Its jobs will continue to be executed until the crontab is removed.
.PP
The files
.I cron.allow
and
.I cron.deny
must be readable by the user invoking
.BR crontab .
If this is not the case, then they are treated as non-existent.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR crontab (5), .BR crontab (5),
.BR cron (8) .BR cron (8)

View File

@ -326,11 +326,6 @@ option on the crond command line. If inotify support is in use, changes
in the symlinked crontabs are not automatically noticed by the cron in the symlinked crontabs are not automatically noticed by the cron
daemon. The cron daemon must receive a SIGHUP signal to reload the daemon. The cron daemon must receive a SIGHUP signal to reload the
crontabs. This is a limitation of the inotify API. crontabs. This is a limitation of the inotify API.
.PP
cron requires that each entry in a crontab end in a newline character. If the
last entry in a crontab is missing a newline (i.e.\& terminated by EOF),
cron will consider the crontab (at least partially) broken.
A warning will be written to syslog.
.SH AUTHOR .SH AUTHOR
.MT vixie@isc.org .MT vixie@isc.org
Paul Vixie Paul Vixie

View File

@ -1,55 +1,27 @@
# Makefile.am - two binaries crond and crontab # Makefile.am - two binaries crond and crontab
sbin_PROGRAMS += \ sbin_PROGRAMS = crond
src/crond bin_PROGRAMS = crontab cronnext
bin_PROGRAMS += \ crond_SOURCES = \
src/cronnext \ cron.c database.c user.c job.c do_command.c popen.c security.c \
src/crontab
src_crond_SOURCES = \
src/cron.c \
src/database.c \
src/do_command.c \
src/job.c \
src/popen.c \
src/security.c \
src/user.c \
$(common_src) $(common_src)
crontab_SOURCES = crontab.c security.c $(common_src)
src_crontab_SOURCES = \ cronnext_SOURCES = \
src/crontab.c \ cronnext.c database.c user.c job.c \
src/security.c \
$(common_src) $(common_src)
common_src = entry.c env.c misc.c pw_dup.c \
externs.h funcs.h globals.h macros.h pathnames.h structs.h \
bitstring.h
common_nodist = cron-paths.h
nodist_crond_SOURCES = $(common_nodist)
nodist_crontab_SOURCES = $(common_nodist)
nodist_cronnext_SOURCES = $(common_nodist)
BUILT_SOURCES = $(common_nodist)
src_cronnext_SOURCES = \ AM_CFLAGS = -I$(top_srcdir)
src/cronnext.c \
src/database.c \
src/job.c \
src/user.c \
$(common_src)
common_src = \ LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
src/bitstring.h \
src/entry.c \
src/env.c \
src/externs.h \
src/funcs.h \
src/globals.h \
src/macros.h \
src/misc.c \
src/pathnames.h \
src/pw_dup.c \
src/structs.h
common_nodist += cron-paths.h
nodist_src_crond_SOURCES = $(common_nodist)
nodist_src_crontab_SOURCES = $(common_nodist)
nodist_src_cronnext_SOURCES = $(common_nodist)
BUILT_SOURCES += $(common_nodist)
src_crond_LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
src_crontab_LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
## if DEBUG ## if DEBUG
## noinst_PROGRAMS = debug ## noinst_PROGRAMS = debug
@ -59,7 +31,7 @@ src_crontab_LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
# If they are configurable, they are declared in configure script. # If they are configurable, they are declared in configure script.
# Depends on this Makefile, because it uses make variables. # Depends on this Makefile, because it uses make variables.
# CCD 2010/09/10 added CRON_HOSTNAME for clustered-cron. # CCD 2010/09/10 added CRON_HOSTNAME for clustered-cron.
CLEANFILES += cron-paths.h CLEANFILES = cron-paths.h
cron-paths.h: Makefile cron-paths.h: Makefile
@echo 'creating $@' @echo 'creating $@'
@sed >$@ 's/ *\\$$//' <<\END #\ @sed >$@ 's/ *\\$$//' <<\END #\

788
src/Makefile.in Normal file
View File

@ -0,0 +1,788 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am - two binaries crond and crontab
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
sbin_PROGRAMS = crond$(EXEEXT)
bin_PROGRAMS = crontab$(EXEEXT) cronnext$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"
PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
am__objects_1 = entry.$(OBJEXT) env.$(OBJEXT) misc.$(OBJEXT) \
pw_dup.$(OBJEXT)
am_crond_OBJECTS = cron.$(OBJEXT) database.$(OBJEXT) user.$(OBJEXT) \
job.$(OBJEXT) do_command.$(OBJEXT) popen.$(OBJEXT) \
security.$(OBJEXT) $(am__objects_1)
am__objects_2 =
nodist_crond_OBJECTS = $(am__objects_2)
crond_OBJECTS = $(am_crond_OBJECTS) $(nodist_crond_OBJECTS)
crond_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
crond_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am_cronnext_OBJECTS = cronnext.$(OBJEXT) database.$(OBJEXT) \
user.$(OBJEXT) job.$(OBJEXT) $(am__objects_1)
nodist_cronnext_OBJECTS = $(am__objects_2)
cronnext_OBJECTS = $(am_cronnext_OBJECTS) $(nodist_cronnext_OBJECTS)
cronnext_LDADD = $(LDADD)
cronnext_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am_crontab_OBJECTS = crontab.$(OBJEXT) security.$(OBJEXT) \
$(am__objects_1)
nodist_crontab_OBJECTS = $(am__objects_2)
crontab_OBJECTS = $(am_crontab_OBJECTS) $(nodist_crontab_OBJECTS)
crontab_LDADD = $(LDADD)
crontab_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/cron.Po ./$(DEPDIR)/cronnext.Po \
./$(DEPDIR)/crontab.Po ./$(DEPDIR)/database.Po \
./$(DEPDIR)/do_command.Po ./$(DEPDIR)/entry.Po \
./$(DEPDIR)/env.Po ./$(DEPDIR)/job.Po ./$(DEPDIR)/misc.Po \
./$(DEPDIR)/popen.Po ./$(DEPDIR)/pw_dup.Po \
./$(DEPDIR)/security.Po ./$(DEPDIR)/user.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(crond_SOURCES) $(nodist_crond_SOURCES) $(cronnext_SOURCES) \
$(nodist_cronnext_SOURCES) $(crontab_SOURCES) \
$(nodist_crontab_SOURCES)
DIST_SOURCES = $(crond_SOURCES) $(cronnext_SOURCES) $(crontab_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
ANACRONTAB = @ANACRONTAB@
ANACRON_SPOOL_DIR = @ANACRON_SPOOL_DIR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DAEMON_GROUPNAME = @DAEMON_GROUPNAME@
DAEMON_USERNAME = @DAEMON_USERNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBAUDIT = @LIBAUDIT@
LIBOBJS = @LIBOBJS@
LIBPAM = @LIBPAM@
LIBS = @LIBS@
LIBSELINUX = @LIBSELINUX@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPOOL_DIR = @SPOOL_DIR@
STRIP = @STRIP@
SYSCRONTAB = @SYSCRONTAB@
SYS_CROND_DIR = @SYS_CROND_DIR@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
editor_defined = @editor_defined@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
crond_SOURCES = \
cron.c database.c user.c job.c do_command.c popen.c security.c \
$(common_src)
crontab_SOURCES = crontab.c security.c $(common_src)
cronnext_SOURCES = \
cronnext.c database.c user.c job.c \
$(common_src)
common_src = entry.c env.c misc.c pw_dup.c \
externs.h funcs.h globals.h macros.h pathnames.h structs.h \
bitstring.h
common_nodist = cron-paths.h
nodist_crond_SOURCES = $(common_nodist)
nodist_crontab_SOURCES = $(common_nodist)
nodist_cronnext_SOURCES = $(common_nodist)
BUILT_SOURCES = $(common_nodist)
AM_CFLAGS = -I$(top_srcdir)
LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
# This header contains all the paths.
# If they are configurable, they are declared in configure script.
# Depends on this Makefile, because it uses make variables.
# CCD 2010/09/10 added CRON_HOSTNAME for clustered-cron.
CLEANFILES = cron-paths.h
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
} \
; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
crond$(EXEEXT): $(crond_OBJECTS) $(crond_DEPENDENCIES) $(EXTRA_crond_DEPENDENCIES)
@rm -f crond$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(crond_OBJECTS) $(crond_LDADD) $(LIBS)
cronnext$(EXEEXT): $(cronnext_OBJECTS) $(cronnext_DEPENDENCIES) $(EXTRA_cronnext_DEPENDENCIES)
@rm -f cronnext$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(cronnext_OBJECTS) $(cronnext_LDADD) $(LIBS)
crontab$(EXEEXT): $(crontab_OBJECTS) $(crontab_DEPENDENCIES) $(EXTRA_crontab_DEPENDENCIES)
@rm -f crontab$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(crontab_OBJECTS) $(crontab_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cron.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cronnext.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crontab.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_command.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popen.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pw_dup.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-sbinPROGRAMS \
mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/cron.Po
-rm -f ./$(DEPDIR)/cronnext.Po
-rm -f ./$(DEPDIR)/crontab.Po
-rm -f ./$(DEPDIR)/database.Po
-rm -f ./$(DEPDIR)/do_command.Po
-rm -f ./$(DEPDIR)/entry.Po
-rm -f ./$(DEPDIR)/env.Po
-rm -f ./$(DEPDIR)/job.Po
-rm -f ./$(DEPDIR)/misc.Po
-rm -f ./$(DEPDIR)/popen.Po
-rm -f ./$(DEPDIR)/pw_dup.Po
-rm -f ./$(DEPDIR)/security.Po
-rm -f ./$(DEPDIR)/user.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/cron.Po
-rm -f ./$(DEPDIR)/cronnext.Po
-rm -f ./$(DEPDIR)/crontab.Po
-rm -f ./$(DEPDIR)/database.Po
-rm -f ./$(DEPDIR)/do_command.Po
-rm -f ./$(DEPDIR)/entry.Po
-rm -f ./$(DEPDIR)/env.Po
-rm -f ./$(DEPDIR)/job.Po
-rm -f ./$(DEPDIR)/misc.Po
-rm -f ./$(DEPDIR)/popen.Po
-rm -f ./$(DEPDIR)/pw_dup.Po
-rm -f ./$(DEPDIR)/security.Po
-rm -f ./$(DEPDIR)/user.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS
.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic clean-sbinPROGRAMS \
cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-sbinPROGRAMS
.PRECIOUS: Makefile
cron-paths.h: Makefile
@echo 'creating $@'
@sed >$@ 's/ *\\$$//' <<\END #\
/* This file has been automatically generated. Do not edit. */ \
\
#ifndef _CRON_PATHS_H_ \
#define _CRON_PATHS_H_ \
\
/* SPOOLDIR is where the crontabs live. \
* This directory will have its modtime updated \
* whenever crontab(1) changes a crontab; this is \
* the signal for cron(8) to look at each individual \
* crontab file and reload those whose modtimes are \
* newer than they were last time around (or which \
* didn't exist last time around...) \
* or it will be checked by inotify \
*/ \
#define SPOOL_DIR "$(SPOOL_DIR)" \
\
/* CRON_HOSTNAME is file in SPOOL_DIR which, if it \
* exists, and does not just contain a line matching \
* the name returned by gethostname(), causes all \
* crontabs in SPOOL_DIR to be ignored. This is \
* intended to be used when clustering hosts sharing \
* one NFS-mounted SPOOL_DIR, and where only one host \
* should use the crontab files here at any one time. \
*/ \
#define CRON_HOSTNAME ".cron.hostname" \
\
/* cron allow/deny file. At least cron.deny must \
* exist for ordinary users to run crontab. \
*/ \
#define CRON_ALLOW "$(sysconfdir)/cron.allow" \
#define CRON_DENY "$(sysconfdir)/cron.deny" \
\
/* 4.3BSD-style crontab f.e. /etc/crontab */ \
#define SYSCRONTAB "$(SYSCRONTAB)" \
\
/* system crontab dir f.e. /etc/cron.d/ */ \
#define SYS_CROND_DIR "$(SYS_CROND_DIR)" \
\
#define SYSCONFDIR "$(sysconfdir)" \
\
#endif /* _CRON_PATHS_H_ */ \
END
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -68,9 +68,8 @@ find_jobs(int, cron_db *, int, int, long),
set_time(int), set_time(int),
cron_sleep(int, cron_db *), cron_sleep(int, cron_db *),
sigchld_handler(int), sigchld_handler(int),
sighup_handler(int ATTRIBUTE_UNUSED), sighup_handler(int),
sigchld_reaper(void), sigchld_reaper(void), sigintterm_handler(int), parse_args(int c, char *v[]);
sigintterm_handler(int ATTRIBUTE_UNUSED), parse_args(int c, char *v[]);
static volatile sig_atomic_t got_sighup, got_sigchld, got_sigintterm; static volatile sig_atomic_t got_sighup, got_sigchld, got_sigintterm;
static int timeRunning, virtualTime, clockTime; static int timeRunning, virtualTime, clockTime;
@ -262,7 +261,7 @@ int main(int argc, char *argv[]) {
*/ */
setlocale(LC_ALL, ""); /* set locale to system defaults or to setlocale(LC_ALL, ""); /* set locale to system defaults or to
* that specified by any LC_* env vars */ * that specified by any LC_* env vars */
if ((cs = nl_langinfo(CODESET)) != NULL) if ((cs = nl_langinfo(CODESET)) != 0L)
strncpy(cron_default_mail_charset, cs, MAX_ENVSTR-1); strncpy(cron_default_mail_charset, cs, MAX_ENVSTR-1);
else else
strcpy(cron_default_mail_charset, "US-ASCII"); strcpy(cron_default_mail_charset, "US-ASCII");
@ -652,15 +651,15 @@ static void cron_sleep(int target, cron_db * db) {
} }
} }
static void sighup_handler(int x ATTRIBUTE_UNUSED) { static void sighup_handler(int x) {
got_sighup = 1; got_sighup = 1;
} }
static void sigchld_handler(int x ATTRIBUTE_UNUSED) { static void sigchld_handler(int x) {
got_sigchld = 1; got_sigchld = 1;
} }
static void sigintterm_handler(int x ATTRIBUTE_UNUSED) { static void sigintterm_handler(int x) {
got_sigintterm = 1; got_sigintterm = 1;
} }

View File

@ -25,8 +25,6 @@
#define MAIN_PROGRAM #define MAIN_PROGRAM
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
@ -83,7 +81,7 @@ const char *flagname[]= {
}; };
void printflags(char *indent, int flags) { void printflags(char *indent, int flags) {
size_t f; int f;
int first = 1; int first = 1;
printf("%s flagnames:", indent); printf("%s flagnames:", indent);
@ -199,11 +197,11 @@ time_t nextmatch(entry *e, time_t start, time_t end) {
/* /*
* match a user against a list * match a user against a list
*/ */
int matchuser(char *user_name, char *list) { int matchuser(char *user, char *list) {
char *pos; char *pos;
size_t l = strlen(user_name); size_t l = strlen(user);
for (pos = list; (pos = strstr(pos, user_name)) != NULL; pos += l) { for (pos = list; (pos = strstr(pos, user)) != NULL; pos += l) {
if ((pos != list) && (*(pos - 1) != ',')) if ((pos != list) && (*(pos - 1) != ','))
continue; continue;
if ((pos[l] != '\0') && (pos[l] != ',')) if ((pos[l] != '\0') && (pos[l] != ','))
@ -218,7 +216,7 @@ int matchuser(char *user_name, char *list) {
*/ */
time_t cronnext(cron_db database, time_t cronnext(cron_db database,
time_t start, time_t end, time_t start, time_t end,
char *include, char *exclude, char *command, int flags) { char *include, char *exclude, int flags) {
time_t closest, next; time_t closest, next;
user *u; user *u;
entry *e; entry *e;
@ -244,9 +242,7 @@ time_t cronnext(cron_db database,
if (flags & CRONTABS) if (flags & CRONTABS)
printcrontab(u); printcrontab(u);
for (e = u->crontab; e; e = e->next) { for (e = u->crontab; e; e = e->next)
if (command && strstr(e->cmd, command) == NULL)
continue;
for (next = nextmatch(e, start, end); for (next = nextmatch(e, start, end);
next <= end; next <= end;
next = nextmatch(e, next + 60, end)) { next = nextmatch(e, next + 60, end)) {
@ -259,7 +255,6 @@ time_t cronnext(cron_db database,
if (! (flags & ALLJOBS)) if (! (flags & ALLJOBS))
break; break;
} }
}
} }
return closest; return closest;
@ -272,7 +267,6 @@ cron_db database(int installed, char **additional) {
cron_db db = {NULL, NULL, (time_t) 0}; cron_db db = {NULL, NULL, (time_t) 0};
struct passwd pw; struct passwd pw;
int fd; int fd;
struct stat ss;
user *u; user *u;
if (installed) if (installed)
@ -284,12 +278,6 @@ cron_db database(int installed, char **additional) {
perror(*additional); perror(*additional);
continue; continue;
} }
fstat(fd, &ss);
if (S_ISDIR(ss.st_mode)) {
fprintf(stderr, "%s is a directory - skipping\n", *additional);
close(fd);
continue;
}
memset(&pw, 0, sizeof(pw)); memset(&pw, 0, sizeof(pw));
pw.pw_name = *additional; pw.pw_name = *additional;
pw.pw_passwd = ""; pw.pw_passwd = "";
@ -317,7 +305,6 @@ void usage() {
fprintf(stderr, " -a examine installed crontabs even if files are given\n"); fprintf(stderr, " -a examine installed crontabs even if files are given\n");
fprintf(stderr, " -t time start from this time (seconds since epoch)\n"); fprintf(stderr, " -t time start from this time (seconds since epoch)\n");
fprintf(stderr, " -q time end check at this time (seconds since epoch)\n"); fprintf(stderr, " -q time end check at this time (seconds since epoch)\n");
fprintf(stderr, " -j cmd only check jobs that contain cmd as a substring\n");
fprintf(stderr, " -l print next jobs to be executed\n"); fprintf(stderr, " -l print next jobs to be executed\n");
fprintf(stderr, " -c print next execution of each job\n"); fprintf(stderr, " -c print next execution of each job\n");
fprintf(stderr, " -f print all jobs executed in the given interval\n"); fprintf(stderr, " -f print all jobs executed in the given interval\n");
@ -330,7 +317,7 @@ void usage() {
*/ */
int main(int argn, char *argv[]) { int main(int argn, char *argv[]) {
int opt; int opt;
char *include, *exclude, *command; char *include, *exclude;
int flags; int flags;
time_t start, next, end = 0; time_t start, next, end = 0;
int endtime, printjobs; int endtime, printjobs;
@ -339,13 +326,12 @@ int main(int argn, char *argv[]) {
include = NULL; include = NULL;
exclude = NULL; exclude = NULL;
command = NULL;
flags = SYSTEM; flags = SYSTEM;
endtime = 0; endtime = 0;
printjobs = 0; printjobs = 0;
start = time(NULL) / 60 * 60; start = time(NULL) / 60 * 60;
while (-1 != (opt = getopt(argn, argv, "i:e:ast:q:j:lcfhV"))) { while (-1 != (opt = getopt(argn, argv, "i:e:ast:q:lcfhV"))) {
switch (opt) { switch (opt) {
case 'i': case 'i':
include = optarg; include = optarg;
@ -366,9 +352,6 @@ int main(int argn, char *argv[]) {
end = atoi(optarg) / 60 * 60; end = atoi(optarg) / 60 * 60;
endtime = 1; endtime = 1;
break; break;
case 'j':
command = optarg;
break;
case 'l': case 'l':
printjobs = 1; printjobs = 1;
break; break;
@ -416,7 +399,7 @@ int main(int argn, char *argv[]) {
db = database(installed || argv[optind] == NULL, argv + optind); db = database(installed || argv[optind] == NULL, argv + optind);
/* find time of next scheduled command */ /* find time of next scheduled command */
next = cronnext(db, start, end, include, exclude, command, flags); next = cronnext(db, start, end, include, exclude, flags);
/* print time */ /* print time */
if (next == -1) if (next == -1)
@ -427,7 +410,7 @@ int main(int argn, char *argv[]) {
/* print next jobs */ /* print next jobs */
if (printjobs) { if (printjobs) {
printf("nextjobs:\n"); printf("nextjobs:\n");
cronnext(db, next, next, include, exclude, command, (flags & SYSTEM) | ENTRIES); cronnext(db, next, next, include, exclude, (flags & SYSTEM) | ENTRIES);
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -66,9 +66,6 @@
#define NHEADER_LINES 0 #define NHEADER_LINES 0
#define COMMENT_COLOR "\x1B[34m"
#define RESET_COLOR "\033[0m"
enum opt_t {opt_unknown, opt_list, opt_delete, opt_edit, opt_replace, opt_hostset, opt_hostget}; enum opt_t {opt_unknown, opt_list, opt_delete, opt_edit, opt_replace, opt_hostset, opt_hostget};
#if DEBUGGING #if DEBUGGING
@ -395,8 +392,6 @@ static void list_cmd(void) {
char n[MAX_FNAME]; char n[MAX_FNAME];
FILE *f; FILE *f;
int ch; int ch;
const int is_tty = isatty(STDOUT);
int new_line = 1;
log_it(RealUser, Pid, "LIST", User, 0); log_it(RealUser, Pid, "LIST", User, 0);
if (!glue_strings(n, sizeof n, SPOOL_DIR, User, '/')) { if (!glue_strings(n, sizeof n, SPOOL_DIR, User, '/')) {
@ -414,18 +409,8 @@ static void list_cmd(void) {
/* file is open. copy to stdout, close. /* file is open. copy to stdout, close.
*/ */
Set_LineNum(1) Set_LineNum(1)
while (EOF != (ch = get_char(f))) { while (EOF != (ch = get_char(f)))
if (is_tty && new_line) {
if (ch == '#') {
fputs(COMMENT_COLOR, stdout);
}
else {
fputs(RESET_COLOR, stdout);
}
}
putchar(ch); putchar(ch);
new_line = ch == '\n';
}
fclose(f); fclose(f);
} }
@ -434,7 +419,7 @@ static void delete_cmd(void) {
if (PromptOnDelete == 1) { if (PromptOnDelete == 1) {
printf("crontab: really delete %s's crontab? ", User); printf("crontab: really delete %s's crontab? ", User);
fflush(stdout); fflush(stdout);
if ((fgets(n, MAX_FNAME - 1, stdin) == NULL) if ((fgets(n, MAX_FNAME - 1, stdin) == 0L)
|| ((n[0] != 'Y') && (n[0] != 'y')) || ((n[0] != 'Y') && (n[0] != 'y'))
) )
exit(0); exit(0);
@ -715,7 +700,7 @@ static void edit_cmd(void) {
perror("swapping uids back"); perror("swapping uids back");
exit(ERROR_EXIT); exit(ERROR_EXIT);
} }
if (NewCrontab == NULL) { if (NewCrontab == 0L) {
perror("fopen"); perror("fopen");
goto fatal; goto fatal;
} }
@ -724,10 +709,10 @@ static void edit_cmd(void) {
break; break;
case -1: case -1:
for (;;) { for (;;) {
printf("Do you want to retry the same edit? (Y/N) "); printf("Do you want to retry the same edit? ");
fflush(stdout); fflush(stdout);
q[0] = '\0'; q[0] = '\0';
if (fgets(q, sizeof q, stdin) == NULL) if (fgets(q, sizeof q, stdin) == 0L)
continue; continue;
switch (q[0]) { switch (q[0]) {
case 'y': case 'y':
@ -818,14 +803,15 @@ static int replace_cmd(void) {
error = -2; error = -2;
goto done; goto done;
} }
if (ferror(tmp) || fflush(tmp) || fsync(fileno(tmp))) { fflush(tmp);
rewind(tmp);
if (ferror(tmp)) {
fprintf(stderr, "%s: error while writing new crontab to %s\n", fprintf(stderr, "%s: error while writing new crontab to %s\n",
ProgramName, TempFilename); ProgramName, TempFilename);
fclose(tmp); fclose(tmp);
error = -2; error = -2;
goto done; goto done;
} }
rewind(tmp);
/* check the syntax of the file being installed. /* check the syntax of the file being installed.
*/ */
@ -1055,7 +1041,7 @@ static void poke_daemon(void) {
} }
} }
static void die(int x ATTRIBUTE_UNUSED) { static void die(int x) {
if (TempFilename[0]) if (TempFilename[0])
(void) unlink(TempFilename); (void) unlink(TempFilename);
_exit(ERROR_EXIT); _exit(ERROR_EXIT);

View File

@ -48,6 +48,9 @@
#include "globals.h" #include "globals.h"
#include "pathnames.h" #include "pathnames.h"
#define TMAX(a,b) ((a)>(b)?(a):(b))
#define TMIN(a,b) ((a)<(b)?(a):(b))
/* size of the event structure, not counting name */ /* size of the event structure, not counting name */
#define EVENT_SIZE (sizeof (struct inotify_event)) #define EVENT_SIZE (sizeof (struct inotify_event))

View File

@ -46,7 +46,7 @@ static int safe_p(const char *, const char *);
void do_command(entry * e, user * u) { void do_command(entry * e, user * u) {
pid_t pid = getpid(); pid_t pid = getpid();
int ev; int ev;
char **jobenv = NULL; char **jobenv = 0L;
Debug(DPROC, ("[%ld] do_command(%s, (%s,%ld,%ld))\n", Debug(DPROC, ("[%ld] do_command(%s, (%s,%ld,%ld))\n",
(long) pid, e->cmd, u->name, (long) pid, e->cmd, u->name,
@ -238,7 +238,7 @@ static int child_process(entry * e, char **jobenv) {
*/ */
{ {
char *shell = env_get("SHELL", jobenv); char *shell = env_get("SHELL", jobenv);
int fd, fdmax = TMIN(getdtablesize(), MAX_CLOSE_FD); int fd, fdmax = getdtablesize();
/* close all unwanted open file descriptors */ /* close all unwanted open file descriptors */
for(fd = STDERR + 1; fd < fdmax; fd++) { for(fd = STDERR + 1; fd < fdmax; fd++) {
@ -427,14 +427,8 @@ static int child_process(entry * e, char **jobenv) {
gethostname(hostname, MAXHOSTNAMELEN); gethostname(hostname, MAXHOSTNAMELEN);
if (MailCmd[0] == '\0') { if (MailCmd[0] == '\0') {
int len; if (snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG, mailfrom)
>= sizeof mailcmd) {
len = snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG, mailfrom);
if (len < 0) {
fprintf(stderr, "mailcmd snprintf failed\n");
(void) _exit(ERROR_EXIT);
}
if (sizeof mailcmd <= (size_t) len) {
fprintf(stderr, "mailcmd too long\n"); fprintf(stderr, "mailcmd too long\n");
(void) _exit(ERROR_EXIT); (void) _exit(ERROR_EXIT);
} }
@ -456,7 +450,7 @@ static int child_process(entry * e, char **jobenv) {
fprintf(mail, "Date: %s\n", arpadate(&StartTime)); fprintf(mail, "Date: %s\n", arpadate(&StartTime));
#endif /*MAIL_DATE */ #endif /*MAIL_DATE */
fprintf(mail, "MIME-Version: 1.0\n"); fprintf(mail, "MIME-Version: 1.0\n");
if (content_type == NULL) { if (content_type == 0L) {
fprintf(mail, "Content-Type: text/plain; charset=%s\n", fprintf(mail, "Content-Type: text/plain; charset=%s\n",
cron_default_mail_charset); cron_default_mail_charset);
} }
@ -467,17 +461,17 @@ static int child_process(entry * e, char **jobenv) {
char *nl = content_type; char *nl = content_type;
size_t ctlen = strlen(content_type); size_t ctlen = strlen(content_type);
while ((*nl != '\0') while ((*nl != '\0')
&& ((nl = strchr(nl, '\n')) != NULL) && ((nl = strchr(nl, '\n')) != 0L)
&& (nl < (content_type + ctlen)) && (nl < (content_type + ctlen))
) )
*nl = ' '; *nl = ' ';
fprintf(mail, "Content-Type: %s\n", content_type); fprintf(mail, "Content-Type: %s\n", content_type);
} }
if (content_transfer_encoding != NULL) { if (content_transfer_encoding != 0L) {
char *nl = content_transfer_encoding; char *nl = content_transfer_encoding;
size_t ctlen = strlen(content_transfer_encoding); size_t ctlen = strlen(content_transfer_encoding);
while ((*nl != '\0') while ((*nl != '\0')
&& ((nl = strchr(nl, '\n')) != NULL) && ((nl = strchr(nl, '\n')) != 0L)
&& (nl < (content_transfer_encoding + ctlen)) && (nl < (content_transfer_encoding + ctlen))
) )
*nl = ' '; *nl = ' ';
@ -506,8 +500,6 @@ static int child_process(entry * e, char **jobenv) {
*/ */
while (EOF != (ch = getc(in))) { while (EOF != (ch = getc(in))) {
if (ch == '\r')
continue;
bytes++; bytes++;
if (mail) if (mail)
putc(ch, mail); putc(ch, mail);

View File

@ -548,13 +548,6 @@ get_range(bitstr_t * bits, int low, int high, const char *names[],
num3 = 1; num3 = 1;
} }
/* num1 (through i) will be validated by set_element() below, but num2
* and num3 are merely used as loop condition and increment, and must
* be validated separately.
*/
if (num2 < low || num2 > high || num3 > high)
return (EOF);
/* range. set all elements from num1 to num2, stepping /* range. set all elements from num1 to num2, stepping
* by num3. (the step is a downward-compatible extension * by num3. (the step is a downward-compatible extension
* proposed conceptually by bob@acornrc, syntactically * proposed conceptually by bob@acornrc, syntactically

View File

@ -23,7 +23,6 @@
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
@ -282,7 +281,7 @@ char *env_get(const char *name, char **envp) {
while ((p = *envp++) != NULL) { while ((p = *envp++) != NULL) {
if (!(q = strchr(p, '='))) if (!(q = strchr(p, '=')))
continue; continue;
if ((size_t)(q - p) == len && !strncmp(p, name, len)) if ((q - p) == len && !strncmp(p, name, len))
return (q + 1); return (q + 1);
} }
return (NULL); return (NULL);

View File

@ -61,7 +61,6 @@
#define MAX_USER_ENVS 1000 /* maximum environment variables in user's crontab */ #define MAX_USER_ENVS 1000 /* maximum environment variables in user's crontab */
#define MAX_USER_ENTRIES 1000 /* maximum crontab entries in user's crontab */ #define MAX_USER_ENTRIES 1000 /* maximum crontab entries in user's crontab */
#define MAX_GARBAGE 32768 /* max num of chars of comments and whitespaces between entries */ #define MAX_GARBAGE 32768 /* max num of chars of comments and whitespaces between entries */
#define MAX_CLOSE_FD 10000 /* max fd num to close when spawning a child process */
/* NOTE: these correspond to DebugFlagNames, /* NOTE: these correspond to DebugFlagNames,
* defined below. * defined below.
@ -130,9 +129,6 @@
#define LAST_DOW 7 #define LAST_DOW 7
#define DOW_COUNT (LAST_DOW - FIRST_DOW + 1) #define DOW_COUNT (LAST_DOW - FIRST_DOW + 1)
#define TMAX(a,b) ((a)>(b)?(a):(b))
#define TMIN(a,b) ((a)<(b)?(a):(b))
/* /*
* Because crontab/at files may be owned by their respective users we * Because crontab/at files may be owned by their respective users we
* take extreme care in opening them. If the OS lacks the O_NOFOLLOW * take extreme care in opening them. If the OS lacks the O_NOFOLLOW

View File

@ -315,6 +315,9 @@ void acquire_daemonlock(int closeflag) {
return; return;
} }
if (NoFork == 1)
return; //move along, nothing to do here...
if (fd == -1) { if (fd == -1) {
pidfile = _PATH_CRON_PID; pidfile = _PATH_CRON_PID;
/* Initial mode is 0600 to prevent flock() race/DoS. */ /* Initial mode is 0600 to prevent flock() race/DoS. */
@ -457,6 +460,76 @@ int skip_comments(FILE * file) {
return TRUE; return TRUE;
} }
/* int in_file(const char *string, FILE *file, int error)
* return TRUE if one of the lines in file matches string exactly,
* FALSE if no lines match, and error on error.
*/
static int in_file(const char *string, FILE * file, int error) {
char line[MAX_TEMPSTR];
char *endp;
if (fseek(file, 0L, SEEK_SET))
return (error);
while (fgets(line, MAX_TEMPSTR, file)) {
if (line[0] != '\0') {
endp = &line[strlen(line) - 1];
if (*endp != '\n')
return (error);
*endp = '\0';
if (0 == strcmp(line, string))
return (TRUE);
}
}
if (ferror(file))
return (error);
return (FALSE);
}
/* int allowed(const char *username, const char *allow_file, const char *deny_file)
* returns TRUE if (allow_file exists and user is listed)
* or (deny_file exists and user is NOT listed).
* root is always allowed.
*/
int allowed(const char *username, const char *allow_file,
const char *deny_file) {
FILE *fp;
int isallowed;
char buf[128];
if (getuid() == 0)
return TRUE;
isallowed = FALSE;
if ((fp = fopen(allow_file, "r")) != NULL) {
isallowed = in_file(username, fp, FALSE);
fclose(fp);
if ((getuid() == 0) && (!isallowed)) {
snprintf(buf, sizeof (buf),
"root used -u for user %s not in cron.allow", username);
log_it("crontab", getpid(), "warning", buf, 0);
isallowed = TRUE;
}
}
else if ((fp = fopen(deny_file, "r")) != NULL) {
isallowed = !in_file(username, fp, FALSE);
fclose(fp);
if ((getuid() == 0) && (!isallowed)) {
snprintf(buf, sizeof (buf),
"root used -u for user %s in cron.deny", username);
log_it("crontab", getpid(), "warning", buf, 0);
isallowed = TRUE;
}
}
#ifdef WITH_AUDIT
if (isallowed == FALSE) {
int audit_fd = audit_open();
audit_log_user_message(audit_fd, AUDIT_USER_START, "cron deny",
NULL, NULL, NULL, 0);
close(audit_fd);
}
#endif
return (isallowed);
}
void log_it(const char *username, PID_T xpid, const char *event, void log_it(const char *username, PID_T xpid, const char *event,
const char *detail, int err) { const char *detail, int err) {
#if defined(LOG_FILE) || DEBUGGING #if defined(LOG_FILE) || DEBUGGING

View File

@ -81,19 +81,12 @@ FILE *cron_popen(char *program, const char *type, struct passwd *pw, char **jobe
if (!pids) { if (!pids) {
if ((fds = getdtablesize()) <= 0) if ((fds = getdtablesize()) <= 0)
return (NULL); return (NULL);
if (fds > MAX_CLOSE_FD)
fds = MAX_CLOSE_FD; /* avoid allocating too much memory */
if (!(pids = (PID_T *) malloc((u_int) ((size_t)fds * sizeof (PID_T))))) if (!(pids = (PID_T *) malloc((u_int) ((size_t)fds * sizeof (PID_T)))))
return (NULL); return (NULL);
memset((char *) pids, 0, (size_t)fds * sizeof (PID_T)); memset((char *) pids, 0, (size_t)fds * sizeof (PID_T));
} }
if (pipe(pdes) < 0) if (pipe(pdes) < 0)
return (NULL); return (NULL);
if (pdes[0] >= fds || pdes[1] >= fds) {
(void) close(pdes[0]);
(void) close(pdes[1]);
return NULL;
}
/* break up string into pieces */ /* break up string into pieces */
for (argc = 0, cp = program; argc < MAX_ARGS; cp = NULL) for (argc = 0, cp = program; argc < MAX_ARGS; cp = NULL)
@ -152,16 +145,14 @@ FILE *cron_popen(char *program, const char *type, struct passwd *pw, char **jobe
} }
/* parent; assume fdopen can't fail... */ /* parent; assume fdopen can't fail... */
if (*type == 'r') { if (*type == 'r') {
fd = pdes[0];
iop = fdopen(pdes[0], type); iop = fdopen(pdes[0], type);
(void) close(pdes[1]); (void) close(pdes[1]);
} }
else { else {
fd = pdes[1];
iop = fdopen(pdes[1], type); iop = fdopen(pdes[1], type);
(void) close(pdes[0]); (void) close(pdes[0]);
} }
pids[fd] = pid; pids[fileno(iop)] = pid;
pfree: pfree:
return (iop); return (iop);
@ -177,8 +168,7 @@ int cron_pclose(FILE * iop) {
* pclose returns -1 if stream is not associated with a * pclose returns -1 if stream is not associated with a
* `popened' command, or, if already `pclosed'. * `popened' command, or, if already `pclosed'.
*/ */
fdes = fileno(iop); if (pids == 0 || pids[fdes = fileno(iop)] == 0)
if (pids == NULL || fdes >= fds || pids[fdes] == 0L)
return (-1); return (-1);
(void) fclose(iop); (void) fclose(iop);

View File

@ -120,7 +120,7 @@ int cron_set_job_security_context(entry *e, user *u ATTRIBUTE_UNUSED,
/* "minute-ly" job: Every minute for given hour/dow/month/dom. /* "minute-ly" job: Every minute for given hour/dow/month/dom.
* Ensure that these jobs never run in the same minute: * Ensure that these jobs never run in the same minute:
*/ */
minutely_time = time(NULL); minutely_time = time(0);
Debug(DSCH, ("Minute-ly job. Recording time %lu\n", minutely_time)); Debug(DSCH, ("Minute-ly job. Recording time %lu\n", minutely_time));
} }
@ -169,7 +169,7 @@ int cron_set_job_security_context(entry *e, user *u ATTRIBUTE_UNUSED,
*jobenv = build_env(e->envp); *jobenv = build_env(e->envp);
time_t job_run_time = time(NULL); time_t job_run_time = time(0L);
if ((minutely_time > 0) && ((job_run_time / 60) != (minutely_time / 60))) { if ((minutely_time > 0) && ((job_run_time / 60) != (minutely_time / 60))) {
/* if a per-minute job is delayed into the next minute /* if a per-minute job is delayed into the next minute
@ -350,12 +350,12 @@ cron_get_job_range(user * u, security_context_t * ucontextp, char **jobenv) {
if (is_selinux_enabled() <= 0) if (is_selinux_enabled() <= 0)
return 0; return 0;
if (ucontextp == NULL) if (ucontextp == 0L)
return -1; return -1;
*ucontextp = NULL; *ucontextp = 0L;
if ((range = env_get("MLS_LEVEL", jobenv)) != NULL) { if ((range = env_get("MLS_LEVEL", jobenv)) != 0L) {
context_t ccon; context_t ccon;
if (!(ccon = context_new(u->scontext))) { if (!(ccon = context_new(u->scontext))) {
log_it(u->name, getpid(), "context_new FAILED for MLS_LEVEL", log_it(u->name, getpid(), "context_new FAILED for MLS_LEVEL",
@ -404,7 +404,7 @@ static int cron_change_selinux_range(user * u, security_context_t ucontext) {
if (is_selinux_enabled() <= 0) if (is_selinux_enabled() <= 0)
return 0; return 0;
if (u->scontext == NULL) { if (u->scontext == 0L) {
if (security_getenforce() > 0) { if (security_getenforce() > 0) {
log_it(u->name, getpid(), "NULL security context for user", "", 0); log_it(u->name, getpid(), "NULL security context for user", "", 0);
return -1; return -1;
@ -592,7 +592,7 @@ get_security_context(const char *name, int crontab_fd,
void free_security_context(security_context_t * scontext) { void free_security_context(security_context_t * scontext) {
if (*scontext != NULL) { if (*scontext != NULL) {
freecon(*scontext); freecon(*scontext);
*scontext = NULL; *scontext = 0L;
} }
} }
#endif #endif
@ -675,74 +675,3 @@ static char **build_env(char **cronenv) {
return jobenv; return jobenv;
#endif #endif
} }
/* int in_file(const char *string, FILE *file, int error)
* return TRUE if one of the lines in file matches string exactly,
* FALSE if no lines match, and error on error.
*/
static int in_file(const char *string, FILE * file, int error) {
char line[MAX_TEMPSTR];
char *endp;
if (fseek(file, 0L, SEEK_SET))
return (error);
while (fgets(line, MAX_TEMPSTR, file)) {
if (line[0] != '\0') {
endp = &line[strlen(line) - 1];
if (*endp != '\n')
return (error);
*endp = '\0';
if (0 == strcmp(line, string))
return (TRUE);
}
}
if (ferror(file))
return (error);
return (FALSE);
}
/* int allowed(const char *username, const char *allow_file, const char *deny_file)
* returns TRUE if (allow_file exists and user is listed)
* or (deny_file exists and user is NOT listed).
* root is always allowed.
*/
int allowed(const char *username, const char *allow_file,
const char *deny_file) {
FILE *fp;
int isallowed;
char buf[128];
if (getuid() == 0)
return TRUE;
isallowed = FALSE;
if ((fp = fopen(allow_file, "r")) != NULL) {
isallowed = in_file(username, fp, FALSE);
fclose(fp);
if ((getuid() == 0) && (!isallowed)) {
snprintf(buf, sizeof (buf),
"root used -u for user %s not in cron.allow", username);
log_it("crontab", getpid(), "warning", buf, 0);
isallowed = TRUE;
}
}
else if ((fp = fopen(deny_file, "r")) != NULL) {
isallowed = !in_file(username, fp, FALSE);
fclose(fp);
if ((getuid() == 0) && (!isallowed)) {
snprintf(buf, sizeof (buf),
"root used -u for user %s in cron.deny", username);
log_it("crontab", getpid(), "warning", buf, 0);
isallowed = TRUE;
}
}
#ifdef WITH_AUDIT
if (isallowed == FALSE) {
int audit_fd = audit_open();
audit_log_user_message(audit_fd, AUDIT_USER_START, "cron deny",
NULL, NULL, NULL, 0);
close(audit_fd);
}
#endif
return (isallowed);
}

View File

@ -124,16 +124,6 @@ load_user (int crontab_fd, struct passwd *pw, const char *uname,
} }
status = load_env (envstr, file); status = load_env (envstr, file);
switch (status) { switch (status) {
case ERR:
/* If envstr has content, we reached EOF
* without a newline, and the line will be
* ignored.
*/
if (envstr[0] != '\0') {
FileName = tabname;
log_error("missing newline before EOF");
}
break;
case FALSE: case FALSE:
++entries; ++entries;
if (!u->system && entries > MAX_USER_ENTRIES) { if (!u->system && entries > MAX_USER_ENTRIES) {