Bug 31235 - crontab truncates names at 31 char instead of 32
Summary: crontab truncates names at 31 char instead of 32
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: vixie-cron
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-09 21:58 UTC by mw
Modified: 2007-04-18 16:32 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2004-08-10 22:25:23 UTC

Attachments (Terms of Use)

Description mw 2001-03-09 21:58:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-0.1.19 i686)

Adding two different users with `useradd' may result in them owning the
same cron file.
For example, the users


will have the same cron file.

Reproducible: Always
Steps to Reproduce:
1. useradd aaaaaaaaaabbbbbbbbbbccccccccccdd
2. crontab -e -u aaaaaaaaaabbbbbbbbbbccccccccccdd
3. ls /var/spool/cron/aaaaaaaaaabbbbbbbbbbccccccccccd

Actual Results:  /var/spool/cron/aaaaaaaaaabbbbbbbbbbccccccccccd

is created.  Only one d at the end.

Expected Results:  The cron file's basename should be the same as the
user's name:

It is possible to fix the bug by changing MAX_UNAME to 33.  Instead, I
think it is better to provide a solution that dynamically allocate space
for User[] and RealUser[].

Indeed, otherwise a change in useradd (it allows, say, 40 char usernames)
will trigger the bug again.

Comment 1 Jason Vas Dias 2004-08-10 22:25:23 UTC
Just cleaning up old bugs here.
This really isn't an issue - cron's MAX_UNAME IS now 33; the maximum
length of a username for Linux is still 32 (and probably always will
be) . If and when that changes, will reassess.

Note You need to log in before you can comment on or make changes to this bug.