1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../cron/hardened-remove.patch
5 # Copyright (C) 2004 - 2010 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Never ever remove my crontab with a mistyping -e, again ... - it just
20 - Rene Rebe <rene@exactcode.de>
22 --- cron3.0pl1/crontab.1.vanilla 2010-07-18 23:13:02.000000000 +0200
23 +++ cron3.0pl1/crontab.1 2010-07-18 23:22:52.000000000 +0200
26 crontab [ -u user ] file
28 -crontab [ -u user ] [ -i ] { -e | -l | -r }
29 +crontab [ -u user ] [ -i ] { -e | -l | -rr }
32 is the program used to install, deinstall or list the tables
38 -option causes the current crontab to be removed.
40 +option causes the current crontab to be removed. NOTE: Since users accidently
41 +managed to delete their crontab serveral times, accidently hitting -r instead
42 +of -e, - we decided that -r needs to be specified two (!) times in order to
43 +delete the user's crontab, by default for the T2 SDE.
47 --- cron3.0pl1/crontab.c.vanilla 2010-07-18 23:13:02.000000000 +0200
48 +++ cron3.0pl1/crontab.c 2010-07-18 23:23:22.000000000 +0200
51 fprintf(stderr, "%s: usage error: %s\n", ProgramName, msg);
52 fprintf(stderr, "usage:\t%s [-u user] file\n", ProgramName);
53 - fprintf(stderr, "\t%s [ -u user ] [ -i ] { -e | -l | -r }\n", ProgramName);
54 + fprintf(stderr, "\t%s [ -u user ] [ -i ] { -e | -l | -rr }\n", ProgramName);
55 fprintf(stderr, "\t\t(default operation is replace, per 1003.2)\n");
56 fprintf(stderr, "\t-e\t(edit user's crontab)\n");
57 fprintf(stderr, "\t-l\t(list user's crontab)\n");
58 - fprintf(stderr, "\t-r\t(delete user's crontab)\n");
59 + fprintf(stderr, "\t-rr\t(delete user's crontab)\n");
60 fprintf(stderr, "\t-i\t(prompt before deleting user's crontab)\n");
65 case opt_list: list_cmd();
67 - case opt_delete: delete_cmd();
68 + case opt_delete: printf("here\n") ; // delete_cmd();
70 case opt_edit: edit_cmd();
76 + static int really_delete = 0;
78 if (!(pw = getpwuid(getuid()))) {
79 fprintf(stderr, "%s: your UID isn't in the passwd file.\n",
82 if (Option != opt_unknown)
83 usage("only one operation permitted");
84 - Option = opt_delete;
86 + Option = opt_delete;
91 if (Option != opt_unknown)