https://bugzilla.novell.com/show_bug.cgi?id=471386 Summary: long 'last -aF' output may lack a newline Classification: openSUSE Product: openSUSE 10.3 Version: Final Platform: All OS/Version: openSUSE 10.3 Status: NEW Severity: Minor Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jmichaud@sgi.com QAContact: qa@suse.de Found By: --- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 With sufficiently long login hostnames, the output lines from 'last -aF' may not have newlines. Consecutive output lines become concatenated. The cause is simple enough. Looking in sysvinit-2.86-102/sysvinit-2.86/src/last.c: .. 472 } else { 473 snprintf(final, sizeof(final), 474 fulltime ? 475 "%-8.8s %-12.12s %-24.24s %-26.26s %-12.12s %s\n" : 476 "%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s %s\n", 477 p->ut_name, utline, 478 logintime, logouttime, length, domain); 479 } 480 } else .. We need to ensure the NUL character stays there when a long domain is printed out. This would probably work: .. 472 } else { 473 snprintf(final, sizeof(final), 474 fulltime ? 475 "%-8.8s %-12.12s %-24.24s %-26.26s %-12.12s %s\n" : 476 "%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s %s\n", 477 p->ut_name, utline, 478 logintime, logouttime, length, domain); 479 final[127] = 0; 480 } 481 } else .. Reproducible: Always Steps to Reproduce: 1. login from a machine with a long hostname (more than 42 or so characters) 2. last -aF Actual Results: foobar pts/7 Sat Jan 31 19:22:15 2009 - Sat Jan 31 19:44:08 2009 (00:21) ddeeff-abcdefg.abcd.abcde.edu abcde pts/5 Sat Jan 31 18:55:32 2009 - Sat Jan 31 21:01:23 2009 (02:05) abcd-111-22-0-555.washdc.fios.verizon.nefoobar pts/5 Sat Jan 31 18:40:00 2009 - Sat Jan 31 18:40:41 2 009 (00:00) ddeeff-abcdefg.abcd.abcde.edu hhiij pts/3 Sat Jan 31 18:03:54 2009 - Sat Jan 31 20:04:12 2009 (02:00) ab12345678-5544.bb.online.no Expected Results: foobar pts/7 Sat Jan 31 19:22:15 2009 - Sat Jan 31 19:44:08 2009 (00:21) ddeeff-abcdefg.abcd.abcde.edu abcde pts/5 Sat Jan 31 18:55:32 2009 - Sat Jan 31 21:01:23 2009 (02:05) abcd-111-22-0-555.washdc.fios.verizon.net foobar pts/5 Sat Jan 31 18:40:00 2009 - Sat Jan 31 18:40:41 2009 (00:00) ddeeff-abcdefg.abcd.abcde.edu hhiij pts/3 Sat Jan 31 18:03:54 2009 - Sat Jan 31 20:04:12 2009 (02:00) ab12345678-5544.bb.online.no -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.