Bug 11321 - Atd does not support userids with length > 8
Atd does not support userids with length > 8
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: at (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-05-09 01:17 EDT by riehl
Modified: 2014-03-16 22:13 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-09 01:17:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description riehl 2000-05-09 01:17:52 EDT
If a userid submits a job via at, and the userid is greater than 8
characters (and the part after the 8th character is non-numeric), the job
will fail.   When the atd wakes up to parse it, it will issue an error in
/var/log/messages: Apr 26 17:01:00 speedy atd[1882]: File a0000400f35341 is
in wrong format - aborting.   It will periodically wake up and attempt to
reevaluate the file, repeating the error, until atd finally dies.
Atd fails to correctly parse a header when the userid is longer than 8
characters.
Here is a sample header:
#!/bin/sh
# atrun uid=513 gid=503
# mail aiwonderland 0
the error occurs out of this code (atd.c):
    if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %8s %d",
               &nuid, &ngid, mailbuf, &send_mail) != 4)
        pabort("File %.500s is in wrong format - aborting",
               filename);
Notice that the userid in the third line of the header has a length of 12.
Mailbuf is a string of length 9 (8 plus null character), and is read as
%8s, which produces the error on the fscanf.

Mailbuf should be expanded, and the fscanf amended appropriately.  Making
these changes fixes the problem.

Note that if the userid in the mail line was composed of only numbers after
the 8th character (e.g. fixed1234567), the job will run, but the mail
address will be errantly truncated to 8 characters, (e.g. fixed123).
Comment 1 Bill Nottingham 2000-06-09 11:46:34 EDT
Fixed in at-3.1.8-2; thanks for the bug report.

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