Patch Name: PHCO_11347 Patch Description: s700_800 10.20 ksh(1) cumulative patch Creation Date: 97/08/28 Post Date: 97/09/03 Hardware Platforms - OS Releases: s700: 10.20 s800: 10.20 Products: N/A Filesets: OS-Core.UX-CORE OS-Core.CORE-ENG-A-MAN Automatic Reboot?: No Status: General Superseded Critical: No Path Name: /hp-ux_patches/s700_800/10.X/PHCO_11347 Symptoms: PHCO_11347: 1) Korn shell does not source a script if stderr is closed. $cat prog . sprog $cat sprog echo hello $prog 2>&- <--- does not source 'sprog' $ 2) trap DEBUG does not behave consistently with command substitution. 3) Shell builtin ':' (: > file) does not truncate file when called second time from a function. 4) Korh shell dumps core due to memory fault when function is defined in a loop. 5) Korn shell adds character when parsing input for trap action name $cat prog #!/usr/bin/ksh trap $1 EXIT echo t (d ) $./prog ate prog[2]: syntax error at line 3 : `(' unexpected Fri Jun 13 18:01:14 IST 1997 <-- 'd' from line 3 is added to action name 'ate' 6) ksh script causes bus error when variable attribute is changed with shell-builtin typeset. $cat prog #! /usr/bin/ksh -p typeset -L14 x integer x typeset -L14 x integer x $prog Illegal instruction(coredump) PHCO_11010: 1) Korn shell dumps core during command substitution if standard input is closed. 2) Korn shell does not remove the temporary files when it exits due to receipt of a signal. PHCO_10719: 1) When ksh sees history file (using old internal magic cookies) of pre-10.10 release, it simply unlinks (discards) that history file. 2) When any shell-builtin command returns NULL in command substitution and the execution trace flag -x is on, then the output of the next shell-builtin in command substition is affected. PHCO_9484: 1) While using in-line command editing, characters would sometimes appear that had not been typed by the user, most commonly ^B. Also, in editing long history lines, especially near the end of the lines, garbage characters would appear and the line couldn't be edited properly. 2) ksh was leaving fd 10 [used for history file] always open. File descriptor 10 was being reserved for use by the shell, but the file descriptor was opened in a way that it would remain open across an exec(2) system call. 3) ksh returns incorrect exit-status when it executes 'exit' command on trap. For Example, When you run the following script "trap.sh" #! /usr/bin/ksh trap "_Exit" 0 1 2 3 15 _Exit(){ exit } rm FOOOOOOOO ls FOOOOOOOO $trap.sh $echo $? 0 The exit-value of the above script should be of last command executed that is 2 (exit value of ls FOOOOOOOO), rather it will return 0. PHCO_9088: 1) Trap on EXIT set outside a function is not executed. For example, trap 'echo exiting shell' EXIT f() { exit } f should output "exiting shell" but instead produces no output. 2) When a here-document is used on the left side of a pipeline that is put into the background, the shell sometimes fails to open temporary files. For example, cat < file) does not truncate file when called second time from a function. 4) Korh shell dumps core due to memory fault when function is defined in a loop. 5) Unread (undo read) character in lexical analyser is stored in shell data structure and this is added to input for trap action name is read. 3) ksh script causes bus error when variable attribute is changed with shell-builtin typeset. $cat prog #! /usr/bin/ksh -p typeset -L14 x integer x typeset -L14 x integer x $prog Illegal instruction(coredump) PHCO_11010: 1) When standard input is closed, the i/o channel established using the file descriptor 0 for the command substitution is not closed. This further leads ksh to bus error and hence make ksh dump core when it refers invalid location in the memory. 2) Korn shell does not clean up temporary files created when it exits due to receipt of a signal. PHCO_10719: 1) Since the internal magic cookies (H_UNDO & H_CMDNO) used in history file were valid multibyte characters, the cookies were changed to and hence aviod ambiguity when a history file is read in multibyte locales, the old history files were simply discarded. 2) When any shell-builtin command returns NULL in command substitution and the execution trace flag -x is on, then it takes incorrect output from the I/O stream for next shell-builtin command substition. set -x FOO=$(whence non_existing_file) FOO=$(whence ls) echo $FOO PHCO_9484: 1) While using in-line command editing, untyped characters would sometimes appear, most often ^B. These occurred most typically when very long command lines had been created. Also, in editing long history lines, especially near the end of the lines, garbage characters would appear and the line couldn't be edited properly. 2) File descriptor 10 was being reserved for use by the shell, but the file descriptor was opened in a way that it would remain open across an exec(2) system call. 3) ksh returns incorrect exit-status when it executes 'exit' command on trap. PHCO_9088: 1) A trap on EXIT set outside of a function is not executed if an exit is called from within a function. 2) When a here-document is used on the left side of a pipeline that is put into the background, the shell sometimes fails to open temporary files. A race condition exists that sometimes causes the shell to delete its temporary files before it has read them. 3) cd -P and pwd -P generate nonexistent path names when the logical path uses symbolic links containing .. 4) ksh hangs when processing "cat bigfile | while read ..." The right side of the pipe can be any shell command (while, if, for, etc.) SR: 4701339309 1653182162 1653164350 1653174615 5003295741 5003340166 5003359547 1653210948 5003366856 1653205088 1653152892 1653216481 Patch Files: /usr/bin/ksh /usr/bin/rksh /usr/share/man/man1.Z/ksh.1 what(1) Output: /usr/bin/ksh: $Revision: 78.5.1.22 $ Version 11/16/88 PATCH_10_20: arith.o blok.o ctype.o defs.o edit.o ec ho.o expand.o fault.o io.o string.o stak.o w ord.o emacs.o vi.o hpux_rel.o args.o builtin .o cmd.o main.o msg.o print.o xec.o name.o m acro.o error.o service.o test.o jobs.o histo ry.o 97/08/28 /usr/bin/rksh: $Revision: 78.5.1.22 $ Version 11/16/88 PATCH_10_20: arith.o blok.o ctype.o defs.o edit.o ec ho.o expand.o fault.o io.o string.o stak.o w ord.o emacs.o vi.o hpux_rel.o args.o builtin .o cmd.o main.o msg.o print.o xec.o name.o m acro.o error.o service.o test.o jobs.o histo ry.o 97/08/28 /usr/share/man/man1.Z/ksh.1: None cksum(1) Output: 2117787732 159744 /usr/bin/ksh 2117787732 159744 /usr/bin/rksh 1152796396 40742 /usr/share/man/man1.Z/ksh.1 Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: If the user's home directory is NFS-mounted to a mixed HP-UX environment, the equivalent shell patches should be installed on all of the NFS clients. Failure to do so could result in the shell history files being deleted. s700: 9.0X: PHCO_12193 s700: 10.00: PHCO_10730 PHCO_10731 s700: 10.01: PHCO_10728 PHCO_10729 s700: 10.10: PHCO_10720 PHCO_10721 s700: 10.20: PHCO_10718 s800: 9.0X: PHCO_12193 s800: 10.00: PHCO_10730 PHCO_10731 s800: 10.01: PHCO_10728 PHCO_10729 s800: 10.10: PHCO_10720 PHCO_10721 s800: 10.20: PHCO_10718 Supersedes: PHCO_9088 PHCO_9484 PHCO_10719 PHCO_11010 Equivalent Patches: PHCO_12193: s700: 9.01 9.03 9.05 9.07 s800: 9.00 9.04 Patch Package Size: 250 KBytes Installation Instructions: Please review all instructions and the Hewlett-Packard SupportLine User Guide or your Hewlett-Packard support terms and conditions for precautions, scope of license, restrictions, and, limitation of liability and warranties, before installing this patch. ------------------------------------------------------------ 1. Back up your system before installing a patch. 2. Login as root. 3. Copy the patch to the /tmp directory. 4. Move to the /tmp directory and unshar the patch: cd /tmp sh PHCO_11347 5a. For a standalone system, run swinstall to install the patch: swinstall -x autoreboot=true -x match_target=true \ -s /tmp/PHCO_11347.depot 5b. For a homogeneous NFS Diskless cluster run swcluster on the server to install the patch on the server and the clients: swcluster -i -b This will invoke swcluster in the interactive mode and force all clients to be shut down. WARNING: All cluster clients must be shut down prior to the patch installation. Installing the patch while the clients are booted is unsupported and can lead to serious problems. The swcluster command will invoke an swinstall session in which you must specify: alternate root path - default is /export/shared_root/OS_700 source depot path - /tmp/PHCO_11347.depot To complete the installation, select the patch by choosing "Actions -> Match What Target Has" and then "Actions -> Install" from the Menubar. 5c. For a heterogeneous NFS Diskless cluster: - run swinstall on the server as in step 5a to install the patch on the cluster server. - run swcluster on the server as in step 5b to install the patch on the cluster clients. By default swinstall will archive the original software in /var/adm/sw/patch/PHCO_11347. If you do not wish to retain a copy of the original software, you can create an empty file named /var/adm/sw/patch/PATCH_NOSAVE. Warning: If this file exists when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. It is recommended that you move the PHCO_11347.text file to /var/adm/sw/patch for future reference. To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_11347.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None