Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 619658

Summary: The wall command's man-page says that the length of the message is limited to 20 lines.
Product: Red Hat Enterprise Linux 6 Reporter: Shinji Kito <skito>
Component: sysvinitAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: azelinka, moshiro, myamazak, rvokal, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sysvinit-2.87-4.dsf.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 14:05:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 627601    
Attachments:
Description Flags
Fix counting MAXLINES in wall none

Description Shinji Kito 2010-07-30 05:03:25 UTC
Description of problem:
RHEL6 wall command's man-page says that the length of the message
is limited to 20 lines, but it should be 22. 

-RHEL6 wall man-
<snip>
      The length of the message is limited to 20 lines.  For every invocation of
      wall a notification will be written to syslog, with facility LOG_USER  and
      level LOG_INFO.
<snip>

-RHEL5 wall man--
<snip>
      The length of the message is limited to 22 lines.  For every invocation of
      wall a notification will be written to syslog, with facility LOG_USER  and
      level LOG_INFO.
 <snip>

wall.c has not been changed since RHEL5, but RHEL6 man page has been updated like the above.

RHEL6 syslog:
Jul 30 11:56:32 localhost wall[2878]: wall: user root broadcasted 22 lines (79 chars)

This also indicates that RHEL 6 wall can process up to 22 lines.

corresponding source code:
<snip>
     95   i = 0;
     96   for (p = buf; *p; p++) {
     97         if (*p == '\n' && i++ > MAXLINES) {
     98                 *++p = 0;
     99                 break;
    100         }
    101   }
    102 
    103   openlog("wall", LOG_PID, LOG_USER);
    104   syslog(LOG_INFO, "wall: user %s broadcasted %d lines (%d chars)",
    105         whoami, i, strlen(buf));
</snip>

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Just run the wall man page.
  
Actual results:
The wall command's man-page says that the length of the message
is limited to 20 lines.


Expected results:
The wall command's man-page says that the length of the message
is limited to 22 lines.


Additional info:
Target Release: 6.1GA
sysvinit-wall-man-line22.patch is attached.

Comment 2 Petr Lautrbach 2010-10-11 14:12:19 UTC
It's seems more like bug in code. MAXLINES is set to 20:

27 #define MAXLINES 20

condition should be
97         if (*p == '\n' && ++i >= MAXLINES) {

If you agree I would rather fix the code then the wall man page.

Comment 3 Shinji Kito 2010-10-12 01:49:04 UTC
(In reply to comment #2)
> It's seems more like bug in code. MAXLINES is set to 20:
> 
> 27 #define MAXLINES 20
> 
> condition should be
> 97         if (*p == '\n' && ++i >= MAXLINES) {
> 
> If you agree I would rather fix the code then the wall man page.

Yes, fixing code should be fine.

Comment 4 Petr Lautrbach 2010-10-12 11:06:06 UTC
Created attachment 452939 [details]
Fix counting MAXLINES in wall

before:
# seq 1 30 | wall
...
Oct 12 12:57:45 RHEL-6 wall[1350]: wall: user root broadcasted 22 lines (79 chars)

after:
# seq 1 30 | wall
...
Oct 12 12:58:07 RHEL-6 wall[1355]: wall: user root broadcasted 20 lines (71 chars)

Comment 9 errata-xmlrpc 2011-05-19 14:05:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0698.html