Hello,
Here is my second set of patches to cronie. Most of the stuff is fairly
trivial, expect perhaps the gethostname() changes. The reason why static
character array is not good enough is documented to commit message.
Short version of the explanation is that fixed lenght array might 1 run
out on some systems, and 2 has unfortunate overflow possibility.
For users the most visitble change in this patch series is usage() output
changes. IMHO having as brief syntax explanation as possible, and
options described with arguments is better than old format.
The patches are also available in my github branch, just in case someone
in audience prefers doing merges with remote repository rather than
emails.
The following changes since commit 3674fa36412650688392676e2f7cfef56f5b6bea:
New release 1.4.10. (2012-11-27 10:35:28 +0100)
are available in the git repository at:
git://github.com/kerolasa/cronie.git 2012wk48
for you to fetch changes up to f4425685fd4981c5c61b1405a7e5229f0f2402e2:
init script: remove bashisms (2012-12-02 00:16:52 +0000)
----------------------------------------------------------------
Sami Kerola (15):
crontab: make usage easier to read
crond: make usage easier to read
compliancy: use sysconf() to determine max hostname length
smatch scan: fix various warningss found using smatch
compile: fix signed and unsigned warnings
compile: add function attributes
anacron: add function attributes
anacron: fix shadow declarations
anacron: remove unnecessary casts, and redundant assigment
anacron: set end job message string to be constant
anacron: clean up usage() output
anacron: remove numeric exit and file descriptor values
common: move xgethostname to cronie_common.h
anacron: make function declarations to be ansi compliant
init script: remove bashisms
Makefile.am | 14 +++++++--
anacron/global.h | 5 ++--
anacron/log.c | 82 +++++++++++++++++++++++++-------------------------
anacron/main.c | 90 +++++++++++++++++++++++++++----------------------------
anacron/readtab.c | 8 ++---
anacron/runjob.c | 26 ++++++++--------
configure.ac | 45 ++++++++++++++++++++++++++++
cronie.init | 16 +++++-----
cronie_common.h | 66 ++++++++++++++++++++++++++++++++++++++++
src/cron.c | 37 +++++++++++++----------
src/crontab.c | 62 ++++++++++++++++++++++++--------------
src/database.c | 11 +++++--
src/do_command.c | 8 +++--
src/entry.c | 6 ++--
src/macros.h | 2 +-
src/misc.c | 3 +-
src/security.c | 10 +++++--
17 files changed, 323 insertions(+), 168 deletions(-)
create mode 100644 cronie_common.h
The COPYING and file is replaced by files from GNU web site.
http://www.gnu.org/licenses/gpl-2.0.txt
Postal addresses to FSF in other files are updated to match with the
address in license files.
References: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html
Signed-off-by: Sami Kerola <kerolasa(a)iki.fi>
---
COPYING.anacron | 43 +++++++++++++++++++++----------------------
anacron/global.h | 6 +++---
anacron/gregor.c | 12 ++++++------
anacron/gregor.h | 6 +++---
anacron/lock.c | 12 ++++++------
anacron/log.c | 12 ++++++------
anacron/main.c | 12 ++++++------
anacron/matchrx.c | 12 ++++++------
anacron/matchrx.h | 6 +++---
anacron/readtab.c | 14 +++++++-------
anacron/runjob.c | 12 ++++++------
11 files changed, 73 insertions(+), 74 deletions(-)
diff --git a/COPYING.anacron b/COPYING.anacron
index 60549be..d159169 100644
--- a/COPYING.anacron
+++ b/COPYING.anacron
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ 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 Library General Public License instead.) You can apply it to
+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
@@ -55,8 +55,8 @@ 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
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
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
@@ -168,7 +168,7 @@ 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
@@ -225,7 +225,7 @@ 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
@@ -255,7 +255,7 @@ 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
+ 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
@@ -277,9 +277,9 @@ 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
+ 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
@@ -291,7 +291,7 @@ 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) 19yy <name of author>
+ 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
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ 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) 19yy name of author
+ 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.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
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 Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
diff --git a/anacron/global.h b/anacron/global.h
index 7cd4c41..2298f3c 100644
--- a/anacron/global.h
+++ b/anacron/global.h
@@ -14,9 +14,9 @@
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/gregor.c b/anacron/gregor.c
index 91e4173..0247e9b 100644
--- a/anacron/gregor.c
+++ b/anacron/gregor.c
@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
Copyright (C) 2004 Pascal Hakim <pasc(a)redellipse.net>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/gregor.h b/anacron/gregor.h
index 842c54d..f66b9c1 100644
--- a/anacron/gregor.h
+++ b/anacron/gregor.h
@@ -14,9 +14,9 @@
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/lock.c b/anacron/lock.c
index 755bca6..7fd59e4 100644
--- a/anacron/lock.c
+++ b/anacron/lock.c
@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
Copyirght (C) 2004 Pascal Hakim <pasc(a)redellipse.net>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/log.c b/anacron/log.c
index e78501b..83ec035 100644
--- a/anacron/log.c
+++ b/anacron/log.c
@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
Copyright (C) 2004 Pascal Hakim <pasc(a)redellipse.net>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/main.c b/anacron/main.c
index 7583bd0..be0585f 100644
--- a/anacron/main.c
+++ b/anacron/main.c
@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
Copyright (C) 2004 Pascal Hakim <pasc(a)redellipse.net>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/matchrx.c b/anacron/matchrx.c
index 2f41251..274672c 100644
--- a/anacron/matchrx.c
+++ b/anacron/matchrx.c
@@ -2,20 +2,20 @@
Anacron - run commands periodically
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/matchrx.h b/anacron/matchrx.h
index 3ce8350..b802848 100644
--- a/anacron/matchrx.h
+++ b/anacron/matchrx.h
@@ -13,9 +13,9 @@
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
diff --git a/anacron/readtab.c b/anacron/readtab.c
index fad381b..881bd74 100644
--- a/anacron/readtab.c
+++ b/anacron/readtab.c
@@ -3,21 +3,21 @@
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
Copyright (C) 2004 Pascal Hakim <pasc(a)redellipse.net>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+
+ 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.
+
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
*/
diff --git a/anacron/runjob.c b/anacron/runjob.c
index 5835524..eca4e7e 100644
--- a/anacron/runjob.c
+++ b/anacron/runjob.c
@@ -2,20 +2,20 @@
Anacron - run commands periodically
Copyright (C) 1998 Itai Tzur <itzur(a)actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh(a)debian.org>
-
+
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ 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.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
--
1.8.0.2