Patch Name: PHCO_25173 Patch Description: s700_800 11.20 sh-posix(1) patch Creation Date: 01/10/10 Post Date: 01/10/16 Hardware Platforms - OS Releases: s700: 11.20 s800: 11.20 Products: N/A Filesets: OS-Core.CORE-ENG-A-MAN,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP OS-Core.UX-CORE,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP Automatic Reboot?: No Status: General Release Critical: No Category Tags: defect_repair general_release Path Name: /hp-ux_patches/s700_800/11.X/PHCO_25173 Symptoms: PHCO_25173: ( SR:8606198219 CR:JAGad67409 ) sh-posix(1) does not evaluate integer constants in arithmetic expansions as per ISOC standards. Defect Description: PHCO_25173: ( SR:8606198219 CR:JAGad67409 ) sh-posix(1) should process expression inside $((..)) as per ISOC standards [ ie., numbers starting with 0 should be recognized as octals and numbers starting with 0x or 0X should be recognized as hexadecimals]. The following two examples demonstrates the problem: 1) [ $((010)) -eq 8 ] if [ $? -ne 0 ]; then echo "FAILED" else echo "PASS" fi (shell interprets $((010)) as 10) 2) [ $((0x10)) -eq 16 ] if [ $? -ne 0 ]; then Echo "FAILED" else echo "PASS" fi (shell evaluates $((0x10)) as an invalid number) Resolution: The builtin let "..", ((expr)), and the arithmetic evaluation by the command - $((expr)) have changed to accept hex and octal notations. Arithmatic Expressions starting with 0 are considered as octal and those starting with 0x or 0X are considered hexa decimal numbers. The man page documentation is also modified to state this behavior. SR: 8606198219 Patch Files: OS-Core.CORE-ENG-A-MAN,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP: /usr/share/man/man1.Z/alias.1 /usr/share/man/man1.Z/bg.1 /usr/share/man/man1.Z/fc.1 /usr/share/man/man1.Z/fg.1 /usr/share/man/man1.Z/jobs.1 /usr/share/man/man1.Z/sh-posix.1 /usr/share/man/man1.Z/unalias.1 OS-Core.UX-CORE,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP: /usr/bin/rsh /usr/bin/sh /usr/newconfig/sbin/sh what(1) Output: OS-Core.CORE-ENG-A-MAN,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP: /usr/share/man/man1.Z/alias.1: None /usr/share/man/man1.Z/bg.1: None /usr/share/man/man1.Z/fc.1: None /usr/share/man/man1.Z/fg.1: None /usr/share/man/man1.Z/jobs.1: None /usr/share/man/man1.Z/sh-posix.1: None /usr/share/man/man1.Z/unalias.1: None OS-Core.UX-CORE,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP: /usr/bin/rsh: Version M-11/16/88f $ B.11.20 May 2 2001 14:39:04 $ builtin.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) macro.c $Date: 2001/09/29 06:14:59 $Revision: r11.20 /1 PATCH_11.20 (PHCO_25173) xec.c $Date: 2001/09/29 06:14:59 $Revision: r11.20/1 PATCH_11.20 (PHCO_25173) arith.c $Date: 2001/09/29 06:14:59 $Revision: r11.20 /1 PATCH_11.20 (PHCO_25173) assign.c $Date: 2001/09/29 06:14:59 $Revision: r11.2 0/1 PATCH_11.20 (PHCO_25173) growaray.c $Date: 2001/09/29 06:14:59 $Revision: r11 .20/1 PATCH_11.20 (PHCO_25173) history.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) streval.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) test.c $Date: 2001/09/29 06:14:59 $Revision: r11.20/ 1 PATCH_11.20 (PHCO_25173) $Revision: vw: -f selectors: CUP11.20_BL2001_1010 _1 PHCO_25173 'CUP11.20_BL2001_1010_1' Wed Oct 10 07:15:15 PDT 2001 $ HP-UX/General Millicode UX.12.70 (IA64.ISV3): (MILLI - 02/13/01) /usr/bin/sh: Version M-11/16/88f $ B.11.20 May 2 2001 14:39:04 $ builtin.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) macro.c $Date: 2001/09/29 06:14:59 $Revision: r11.20 /1 PATCH_11.20 (PHCO_25173) xec.c $Date: 2001/09/29 06:14:59 $Revision: r11.20/1 PATCH_11.20 (PHCO_25173) arith.c $Date: 2001/09/29 06:14:59 $Revision: r11.20 /1 PATCH_11.20 (PHCO_25173) assign.c $Date: 2001/09/29 06:14:59 $Revision: r11.2 0/1 PATCH_11.20 (PHCO_25173) growaray.c $Date: 2001/09/29 06:14:59 $Revision: r11 .20/1 PATCH_11.20 (PHCO_25173) history.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) streval.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) test.c $Date: 2001/09/29 06:14:59 $Revision: r11.20/ 1 PATCH_11.20 (PHCO_25173) $Revision: vw: -f selectors: CUP11.20_BL2001_1010 _1 PHCO_25173 'CUP11.20_BL2001_1010_1' Wed Oct 10 07:15:15 PDT 2001 $ HP-UX/General Millicode UX.12.70 (IA64.ISV3): (MILLI - 02/13/01) /usr/newconfig/sbin/sh: Version M-11/16/88f $ B.11.20 May 2 2001 14:39:04 $ builtin.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) macro.c $Date: 2001/09/29 06:14:59 $Revision: r11.20 /1 PATCH_11.20 (PHCO_25173) xec.c $Date: 2001/09/29 06:14:59 $Revision: r11.20/1 PATCH_11.20 (PHCO_25173) arith.c $Date: 2001/09/29 06:14:59 $Revision: r11.20 /1 PATCH_11.20 (PHCO_25173) assign.c $Date: 2001/09/29 06:14:59 $Revision: r11.2 0/1 PATCH_11.20 (PHCO_25173) growaray.c $Date: 2001/09/29 06:14:59 $Revision: r11 .20/1 PATCH_11.20 (PHCO_25173) history.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) streval.c $Date: 2001/09/29 06:14:59 $Revision: r11. 20/1 PATCH_11.20 (PHCO_25173) test.c $Date: 2001/09/29 06:14:59 $Revision: r11.20/ 1 PATCH_11.20 (PHCO_25173) $Revision: vw: -f selectors: CUP11.20_BL2001_1010 _1 PHCO_25173 'CUP11.20_BL2001_1010_1' Wed Oct 10 07:16:03 PDT 2001 $ HP-UX/General Millicode UX.12.70 (IA64.ISV3): (MILLI - 02/13/01) cksum(1) Output: OS-Core.CORE-ENG-A-MAN,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP: 1773409491 45227 /usr/share/man/man1.Z/alias.1 1773409491 45227 /usr/share/man/man1.Z/bg.1 1773409491 45227 /usr/share/man/man1.Z/fc.1 1773409491 45227 /usr/share/man/man1.Z/fg.1 1773409491 45227 /usr/share/man/man1.Z/jobs.1 1773409491 45227 /usr/share/man/man1.Z/sh-posix.1 1773409491 45227 /usr/share/man/man1.Z/unalias.1 OS-Core.UX-CORE,fr=B.11.20,fa=HP-UX_B.11.20_64,v=HP: 1172453416 566404 /usr/bin/rsh 1172453416 566404 /usr/bin/sh 4138199087 1020072 /usr/newconfig/sbin/sh Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: None Equivalent Patches: None Patch Package Size: 1630 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_25173 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_25173.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_25173. If you do not wish to retain a copy of the original software, include the patch_save_files option in the swinstall command above: -x patch_save_files=false WARNING: If patch_save_files is false when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. For future reference, the contents of the PHCO_25173.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_25173.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_25173.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None