Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2002 12:42:47 -0700 (PDT)
From:      Kajimoto Masato <kajimoto@iijmio-mail.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/44504: tcsh-6.12.00's "source" command ignore commands over 4kb with ja_JP.EUC locale
Message-ID:  <200210261942.g9QJglfM006495@www.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         44504
>Category:       bin
>Synopsis:       tcsh-6.12.00's "source" command ignore commands over 4kb with ja_JP.EUC locale
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 26 12:50:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kajimoto Masato
>Release:        FreeBSD 4.7 i386
>Organization:
individual
>Environment:
FreeBSD 4.7-RELEASE i386
and maybe all versions using tcsh-6.12.00.
>Description:
This bug is the same problem discussed in the freebsd-stable ML.
     http://docs.freebsd.org/cgi/getmsg.cgi?fetch=494343+0+/usr/local/www/db/text/2002/freebsd-stable/20020901.freebsd-stable
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=108590+0+/usr/local/www/db/text/2002/freebsd-stable/20020908.freebsd-stable
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=162447+0+archive/2002/freebsd-stable/20020908.freebsd-stable

In the tcsh's prompt, "source file" command ignore
the characters over 4096 bytes if the file
has "unset" command before 4096 bytes and /usr/share/nls/$LANG/tcsh.cat file exists.
The problem also occurs in ".cshrc".
>How-To-Repeat:
% env LANG=ja_JP.EUC /bin/tcsh -f
% source file

For example, the file has "unset a" in the first line,
following any commands with over 4096 bytes.
Tcsh will ignore all characters over the boundary of 4096 bytes.
LANG must be set to the locale with tcsh.cat in /usr/share/nls/$LANG/ before starting tcsh.
>Fix:
Apply this patch to /usr/src/contrib/tcsh/sh.c

diff -c tcsh-6.12.00.ORIG/sh.c tcsh-6.12.00/sh.c
*** tcsh-6.12.00.ORIG/sh.c      Sat Jul  6 01:28:16 2002
--- tcsh-6.12.00/sh.c   Sun Oct 27 01:34:15 2002
***************
*** 1010,1016 ****
--- 1010,1026 ----
       * descriptor to hold the name of the script (setuid case) and this name
       * mustn't be lost by closing the fd too soon.
       */
+ #ifdef NLS_BUGS
+ #ifdef NLS_CATALOGS
+     (void)catclose(catd);
+ #endif /* NLS_CATALOGS */
+ #endif /* NLS_BUGS */
      closem();
+ #ifdef NLS_BUGS
+ #ifdef NLS_CATALOGS
+     nlsinit();
+ #endif /* NLS_CATALOGS */
+ #endif /* NLS_BUGS */
  
      /*
       * Consider input a tty if it really is or we are interactive. but not for


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210261942.g9QJglfM006495>