Page MenuHomeFreeBSD

cron: log when a crontab path is too long
ClosedPublic

Authored by chris.longros_gmail.com on Apr 3 2026, 2:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 15, 12:00 PM
Unknown Object (File)
Thu, May 14, 2:33 PM
Unknown Object (File)
Thu, May 14, 2:30 PM
Unknown Object (File)
Thu, May 14, 8:35 AM
Unknown Object (File)
Thu, May 14, 8:35 AM
Unknown Object (File)
Wed, May 13, 4:31 PM
Unknown Object (File)
Sun, May 10, 10:34 PM
Unknown Object (File)
Wed, May 6, 6:33 PM

Details

Summary

Log via syslog when snprintf truncates the crontab path,
instead of silently skipping the entry.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Is it safe to assume that I don't want to ask if there's a story behind deciding to resolve this XXX? =) Will try to commit later today

This revision is now accepted and ready to land.Fri, Apr 24, 5:30 PM
michaelo added inline comments.
usr.sbin/cron/cron/database.c
172

Is the length actually documented in the manpage? I fail to find it.

usr.sbin/cron/cron/database.c
172

No, there's no documented limit on crontab filename length in cron.8, crontab.1, or crontab.5

usr.sbin/cron/cron/database.c
172

It think it is then worth documenting that tabname is confined by MAXPATHLEN sans NULL byte.

Document the resulting filename length limit in cron(8) under FILES.

This revision now requires review to proceed.Sat, Apr 25, 7:25 PM
bcr added a subscriber: bcr.

OK from manpages.

This revision is now accepted and ready to land.Sun, Apr 26, 11:08 AM
This revision was automatically updated to reflect the committed changes.