Enforce maximum crontab line count of 1000
As any user can create a crontab that is read by the cron daemon, it is possible for a user to cause a DoS via memory exhaustion by creating an excessivly large crontab. As a measure to prevent this, limit the size of individual crontab files to 1000 lines. While it is still technically possible for a user to create a larger crontab (for example, by creating a single, very long comment), this should not affect the daemon, as it simply skips over comments. For crontab entries (for which the daemon allocates memory), the maximum command length is already limited to 998 characters, so these allocations are already kept in check.
Showing with 26 additions and 5 deletions