Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 33696 - atd will not parse login names longer than 8 chars, while at and batch write them
Summary: atd will not parse login names longer than 8 chars, while at and batch write ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Aron Griffis (RETIRED)
URL:
Whiteboard:
Keywords:
: 44012 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-17 11:52 UTC by Yuval Kogman
Modified: 2004-04-06 14:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuval Kogman 2003-11-17 11:52:37 UTC
The fscanf() function called has the format %8s to parse the login name, which is, perhaps, a 
historical left over.

I've been getting bad format errors to syslog because my login name is "nothingmuch"

Reproducible: Always
Steps to Reproduce:
1. run at or batch as a user with name > 8 chars
2. wait for atd to work, or run atd -s manually
Actual Results:  
The jobs are not run, and i think it fails before it tries others.

Expected Results:  
either complained at at/batch time, or worked properly.

I've changed the format of the fscanf call:

<<EOF;
diff -uNr at-3.1.8/atd.c at-3.1.8.255charfix/atd.c
--- at-3.1.8/atd.c       Fri Jan 18 06:15:27 2002
+++ at-3.1.8.255charfix/atd.c    Mon Nov 17 21:07:14 2003
@@ -299,7 +299,7 @@
      * NFS and works with local file systems.  It's not clear where
      * the bug is located.  -Joey
      */
-    if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %8s %d",
+    if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %255s %d",
             &nuid, &ngid, mailbuf, &send_mail) != 4)
             pabort("File %.500s is in wrong format - aborting",
                    filename);
EOF

it seems to be working properly.
Comment 1 Yuval Kogman 2003-11-17 11:54:07 UTC
I've supplied a patch in the description...

sorry, I haven't quite gotten the hang of this bugzilla stuff yet... =)
Comment 2 Alexander Isacson 2004-03-08 01:09:03 UTC
*** Bug 44012 has been marked as a duplicate of this bug. ***
Comment 3 Yuval Kogman 2004-04-05 07:03:05 UTC
I don't see this is being looked at, and it's not resolved.

It's a real problem that takes quite a bit of effort to fix each time around.
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-04-06 12:25:07 UTC
Check the length of the buffer you're stuffing that into...
Comment 5 Yuval Kogman 2004-04-06 12:36:10 UTC
Cough. Right.

char mailbuf[256] instead of char mailbuf[9].

Anybody know what's the most pam/whoever will eat?
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-04-06 14:34:06 UTC
Thanks, fixed in at-3.1.8-r10