Bug 31235

Summary: crontab truncates names at 31 char instead of 32
Product: [Retired] Red Hat Linux Reporter: mw
Component: vixie-cronAssignee: Jason Vas Dias <jvdias>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: mw
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-10 22:25:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

aaaaaaaaaabbbbbbbbbbccccccccccdd
aaaaaaaaaabbbbbbbbbbccccccccccd

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:
/var/spool/cron/aaaaaaaaaabbbbbbbbbbccccccccccdd




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.