Patch Name: PHCO_30156 Patch Description: s700_800 11.11 cp(1) cumulative patch Creation Date: 04/07/08 Post Date: 04/07/26 Hardware Platforms - OS Releases: s700: 11.11 s800: 11.11 Products: N/A Filesets: OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP OS-Core.UX-CORE,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP Automatic Reboot?: No Status: General Release Critical: Yes PHCO_30156: ABORT Category Tags: defect_repair general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHCO_30156 Symptoms: PHCO_30156: ( SR:8606351120 CR:JAGaf11932 ) cp(1) with -r or -R, doesn't copy multiple source correctly if the target directory doesn't exist. ( SR:8606351121 CR:JAGaf11933 ) Under certain conditions, cp(1) with -rp option doesn't copy largefiles. ( SR:8606351122 CR:JAGaf11934 ) cp(1) with -r option returns 0 if the number of files not copied is 256 or multiple of 256. ( SR:8606351127 CR:JAGaf11939 ) cp(1) coredumps if calloc/malloc fails to allocate memory. ( SR:8606352749 CR:JAGaf13553 ) For cp(1) -S functionality not listed in manpage. Defect Description: PHCO_30156: ( SR:8606351120 CR:JAGaf11932 ) cp(1) with -r/-R option doesn't copy correctly, while trying to copy multiple files/directories to a non-existing directory. Steps to reproduce the problem is as below: $ mkdir -p d1/d2 $ echo "d1/e" > d1/e $ echo "d1/d2/b" > d1/d2/b $ cp -rp d1/* d4 $ diff -r d1 d4 1>/dev/null 2>/dev/null $ echo $? 1 $ The exit status of diff(1) is 1 because cp(1) didn't copy the file and directories correctly. Resolution: cp(1) is modified to copy files and directory correctly. With UNIX95 flag set, cp(1) would exit with an error if any attempt is made to copy multiple files to a non-existing directory. ( SR:8606351121 CR:JAGaf11933 ) If a largefile enabled file is being copied to a target directory (largefile enabled) mounted on no-largefile system this error is seen. In such a case cp(1) with -rp option doesn't copy largefiles. The steps to reproduce the problem is as below: 1.Mount a large file enabled filesystem on /devlopment/dir1. 2.Create largefiles in /devlopment/dir1. 3.Mount a No-Large-filesystem on /temp. 4.Mount a LargeFile system on /temp/development/dir1. 5.Copy the directory using option '-rp' /devlopment/dir1 cp -rp /devlopment/dir1 /temp/development cp(1) gives an error and comes out with non-zero exit status. Resolution: cp(1) is modified to check if the final destination supports largefiles and then allow copying of largefile in it. ( SR:8606351122 CR:JAGaf11934 ) If cp(1) with -r option is unable to copy 256 files or multiple of 256 files the exit status of cp(1) changes to 0. The steps to reproduce the defect is as below: 1. Create 256 files in a directory (say dir1). 2. Remove read permission of the files. 3. Using cp(1) with -r option try copying dir1 to dir2. 4. Check the exit status for cp(1). Resolution: The code is modified to give non-zero exit status if cp(1) fails to copy. ( SR:8606351127 CR:JAGaf11939 ) If cp(1) program is unable to allocate memory due to some system constraint, cp(1) dumps core. Steps to reproduce the defect is as below: 1. Create a test directory. 2. Create 200 files and create hard-link each one. 3. Run the command "ulimit -Sd 150". 4. Run cp(1) "cp -r test1 test2". This step can coredump. Resolution: If cp(1) program fails to allocate sufficient memory, it exits with an error. ( SR:8606352749 CR:JAGaf13553 ) In the manpage of cp(1), the functionality for -S option is not listed. Resolution: The functionality with -S option is listed in manpage. Enhancement: No SR: 8606351120 8606351121 8606351122 8606351127 8606352749 Patch Files: OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: /usr/share/man/man1.Z/cp.1 OS-Core.UX-CORE,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/cp what(1) Output: OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: /usr/share/man/man1.Z/cp.1: None OS-Core.UX-CORE,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/cp: cp.c $Date: 2004/06/22 00:18:16 $Revision: r11.11/3 PATCH_11.11 (PHCO_30156) $Revision: vw: -f selectors: R11.11_BL2004_0708_2 PHCO_30156 'R11.11_BL2004_0708_2' cksum(1) Output: OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: 2566897083 5401 /usr/share/man/man1.Z/cp.1 OS-Core.UX-CORE,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: 1878787128 28672 /usr/bin/cp Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: None Equivalent Patches: None Patch Package Size: 50 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_30156 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_30156.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_30156. 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_30156.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_30156.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_30156.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None