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: 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).
Fixed in at-3.1.8-2; thanks for the bug report.