diff options
author | emaste <emaste@FreeBSD.org> | 2016-09-05 15:50:40 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-09-05 15:50:40 +0000 |
commit | 6da7f85311d66f5b649b451d176a99d6daa05f54 (patch) | |
tree | 415e17bde2893531e4787a39a5e5192483141d9a /usr.sbin/cron/crontab/crontab.c | |
parent | 23cf012b280ed8f8274e25a82bf44492132b1419 (diff) | |
download | FreeBSD-src-6da7f85311d66f5b649b451d176a99d6daa05f54.zip FreeBSD-src-6da7f85311d66f5b649b451d176a99d6daa05f54.tar.gz |
MFC r305269: cron: use existing maximum username constant MAXLOGNAME
Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).
PR: 212305
Reported by: Andrii Kuzik
Diffstat (limited to 'usr.sbin/cron/crontab/crontab.c')
-rw-r--r-- | usr.sbin/cron/crontab/crontab.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/cron/crontab/crontab.c b/usr.sbin/cron/crontab/crontab.c index 2608be7..933450b 100644 --- a/usr.sbin/cron/crontab/crontab.c +++ b/usr.sbin/cron/crontab/crontab.c @@ -28,6 +28,7 @@ static const char rcsid[] = #define MAIN_PROGRAM +#include <sys/param.h> #include "cron.h" #include <errno.h> #include <fcntl.h> @@ -57,7 +58,7 @@ static char *Options[] = { "???", "list", "delete", "edit", "replace" }; static PID_T Pid; -static char User[MAX_UNAME], RealUser[MAX_UNAME]; +static char User[MAXLOGNAME], RealUser[MAXLOGNAME]; static char Filename[MAX_FNAME]; static FILE *NewCrontab; static int CheckErrorCount; |