diff options
author | ulfvonbelow <striness@tilde.club> | 2023-02-02 19:29:52 +0000 |
---|---|---|
committer | Dale Mellor <mcron-lsfnyl@rdmp.org> | 2023-03-18 14:00:26 +0000 |
commit | 4727c770c2a723d46b4162cff21ab8f0b75c3998 (patch) | |
tree | 5cdd3a6c110d60d96892032b05edb60f0a77271c /src/crontab-access-real.in | |
parent | 2ff4d0f44ec21332d13de8d8ab8c39c77450ff7d (diff) | |
download | mcron-4727c770c2a723d46b4162cff21ab8f0b75c3998.tar.gz mcron-4727c770c2a723d46b4162cff21ab8f0b75c3998.tar.bz2 mcron-4727c770c2a723d46b4162cff21ab8f0b75c3998.zip |
crontab-access: replace with wrapper, rename to crontab-access-real.
The wrapper has two purposes:
1. Not being a script, thereby eliminating the issues with setuid scripts.
2. Purging the environment. crontab-access-real has no need for any
environment variables to do its work, so to prevent tampering with dynamic
linker, libc, or guile, we may as well just unset them all.
This wrapper does introduce a requirement for a C compiler. Ideally it would
be conditional based on whether the wrapper is even going to be built, but
autoconf doesn't like that one bit. Someone with more experience with
autotools should sort that out. In the meantime I guess anyone wanting to
build without a C compiler being present is going to have to edit configure.ac
and re-run bootstrap.
* src/crontab-access.in: renamed to src/crontab-access-real.in
* src/crontab-access.c.in: new file, wrapper for crontab-access-real.
* Makefile.am: inform about crontab-access.c.in and name change to
crontab-access-real. Put crontab-access-real in libexecdir.
Diffstat (limited to 'src/crontab-access-real.in')
-rw-r--r-- | src/crontab-access-real.in | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/crontab-access-real.in b/src/crontab-access-real.in new file mode 100644 index 0000000..569d147 --- /dev/null +++ b/src/crontab-access-real.in @@ -0,0 +1,45 @@ +#!%GUILE% --no-auto-compile +-*- scheme -*- +!# + +;;;; crontab -- run jobs at scheduled times +;;; Copyright © 2003, 2020 Dale Mellor <mcron-lsfnyl@rdmp.org> +;;; Copyright © 2015, 2016, 2018 Mathieu Lirzin <mthl@gnu.org> +;;; +;;; This file is part of GNU Mcron. +;;; +;;; GNU Mcron 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 3 of the License, or +;;; (at your option) any later version. +;;; +;;; GNU Mcron 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 GNU Mcron. If not, see <http://www.gnu.org/licenses/>. + + +(unless (getenv "MCRON_UNINSTALLED") + (set! %load-path (cons "%modsrcdir%" %load-path)) + (set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))) + +(use-modules (mcron scripts crontab) + (mcron command-line-processor)) + +(process-command-line (command-line) + application "crontab" + version "%VERSION%" + usage "[-u user] { -R | -l | -r }" + help-preamble "the default operation is to list." + option (--user= -u "the user whose files are to be manipulated") + option (--replace -R "replace this userʼs crontab via stdin") + option (--list -l "list this userʼs crontab") + option (--remove -r "delete the userʼs crontab") + bug-address "%PACKAGE_BUGREPORT%" + copyright "2003, 2016, 2020 Free Software Foundation, Inc." + license GPLv3) + +((@ (mcron scripts crontab-access) main) --user --replace --list --remove) |