Bug 663032 - wall command cuts the banner unfortunately
Summary: wall command cuts the banner unfortunately
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sysvinit
Version: 14
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 668476
TreeView+ depends on / blocked
 
Reported: 2010-12-14 14:24 UTC by Karel Volný
Modified: 2011-01-13 17:58 UTC (History)
1 user (show)

Fixed In Version: sysvinit-2.87-7.dsf.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 668476 (view as bug list)
Environment:
Last Closed: 2011-01-13 17:58:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
raise limit for broadcast message (993 bytes, patch)
2011-01-07 15:22 UTC, Petr Lautrbach
no flags Details | Diff

Description Karel Volný 2010-12-14 14:24:33 UTC
Description of problem:
trying to use wall, the messages are a bit mangled, see the example below

Version-Release number of selected component (if applicable):
sysvinit-tools-2.87-6.dsf.fc14.x86_64

How reproducible:
always

Steps to Reproduce:
1. wall test
  
Actual results:
Broadcast message from kvolny@machine (pts/8) (Tue Dec 14 1test

Expected results:
Broadcast message from kvolny@machine (pts/8) (Tue Dec 14 15:20:34)
test

Additional info:
this doesn't seem to happen with the write command

Comment 1 Petr Lautrbach 2010-12-14 15:51:05 UTC
There is limitation 80 chars in this broadcast message probably because of standard terminal size:

src/dowall.c:
133         char                    line[81];
...
165         if (remote) {
166                 snprintf(line, sizeof(line),
167                         "\007\r\nRemote broadcast message (%s):\r\n\r\n",
168                         date);
169         } else {
170                 snprintf(line, sizeof(line),
171                         "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
172                         user, hostname, tty, date);
173         }


What should be reasonable size for you? 100? 255? without limit?

Comment 2 Karel Volný 2010-12-14 16:23:16 UTC
hm, so the problem obviously is that the banner goes over the line limit if the hostname is too long (which it is, I've replaced my real hostname with "machine" here), then the newline characters get eaten by snprintf

so ...

- I think the limit should not include the non-spacing characters (like the bell and the newline characters)

- personally, I'd lift the 80 characters limit (make it unlimited), as this is very unsafe assumption nowadays (konsole on my laptop has more that 150 characters, terminal on my FreeRunner phone has about 40 characters ... and the messages on my laptop are shown via KDE notifications which is graphical application ...)

- if that is unacceptable,
a) make sure that snprintf doesn't eat the newline characters
b) try to shorten the banner or split it over multiple lines

Comment 3 Petr Lautrbach 2011-01-07 15:22:51 UTC
Created attachment 472250 [details]
raise limit for broadcast message

This patch raises limit for broadcast message to 400 (411) characters and changes creating message so white symbols won't be cut out.

Comment 4 Karel Volný 2011-01-07 15:39:48 UTC
(In reply to comment #3)
> Created attachment 472250 [details]
> raise limit for broadcast message
> 
> This patch raises limit for broadcast message to 400 (411) characters and
> changes creating message so white symbols won't be cut out.

seems nice

don't you have a package to test, pls?

Comment 5 Petr Lautrbach 2011-01-10 10:06:18 UTC
There is a rawhide build [1] and I will send it to updates-testing soon

[1] http://koji.fedoraproject.org/koji/buildinfo?buildID=213146

Comment 7 Fedora Update System 2011-01-10 13:59:54 UTC
sysvinit-2.87-7.dsf.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/sysvinit-2.87-7.dsf.fc14

Comment 8 Fedora Update System 2011-01-10 21:26:37 UTC
sysvinit-2.87-7.dsf.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sysvinit'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/sysvinit-2.87-7.dsf.fc14

Comment 9 Fedora Update System 2011-01-13 17:58:00 UTC
sysvinit-2.87-7.dsf.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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