Bug 11321 - Atd does not support userids with length > 8
Summary: Atd does not support userids with length > 8
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: at   
(Show other bugs)
Version: 6.1
Hardware: All Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-05-09 05:17 UTC by riehl
Modified: 2014-03-17 02:13 UTC (History)
3 users (show)

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

Attachments (Terms of Use)

Description riehl 2000-05-09 05:17:52 UTC
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
Here is a sample header:
# 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",
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 15:46:34 UTC
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.