Patch Name: PHCO_29692 Patch Description: s700_800 11.11 find(1) cumulative patch Creation Date: 04/02/13 Post Date: 04/03/09 Hardware Platforms - OS Releases: s700: 11.11 s800: 11.11 Products: N/A Filesets: OS-Core.CMDS-MIN,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP OS-Core.CMIN-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/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_29692 Symptoms: PHCO_29692: ( SR:8606326820 CR:JAGae89095 ) find(1) fails to locate a file, if current working directory does not have read permission. ( SR:8606342869 CR:JAGaf03763 ) find(1) with -exec option gives improper output when delimited with plus sign (+). PHCO_25905: ( SR:8606201448 CR:JAGad70624 ) On a cdfs file system, "find /cdrom \( -nouser -o -nogroup \)" causes bus error. ( SR:8606186711 CR:JAGad55921 ) "find -group +" will display files with group id matching "n" instead of displaying files with group id > n . Defect Description: PHCO_29692: ( SR:8606326820 CR:JAGae89095 ) find(1) tries to open current working directory to capture file descriptor for further processing, but fails if it does not have read permission. In such case find(1) comes out with an error "find: cannot get 'pwd'". The steps to reproduce the problem are :- 1. Create two directories in a temp directory. $ cd /tmp $ mkdir dir1 dir2 2. Create a file in dir2 directory. $ touch dir2/file1 3. Goto dir1 directory and remove the read permission. $ cd dir1 $ chmod -r . 4. Search for file1 in /tmp/dir2 directory. $ find /tmp/dir2 -name file1 find: cannot get 'pwd' Resolution: When opening of current working directory fails due to missing permissions, find(1) tries to build the complete path of 'pwd' by climbing up the parent directories till it reaches root. find(1) will fail if any of the predecessor directory does not have read permission or the current directory is very deep (>341 levels). ( SR:8606342869 CR:JAGaf03763 ) find(1) -exec , if delimited with plus sign (+), executes incomplete command. The error is observed only when one of the command arguments specified is "{}". While parsing and building the command line vector, the last argument was not properly updated because of improper handling of "{}" argument. The steps to reproduce the problem are :- 1. Create two files, namely file1 file2 $ touch file1 file2 2. Run find command $ find . -name 'file?' -exec ls -l {} \+ ./file1 ./file2 The expected output is a long listing of two files. $ find . -name 'file?' -exec ls -l \+ -rw-rw-r-- 1 user group 0 Feb 3 19:50 ./file1 -rw-rw-r-- 1 user group 0 Feb 3 19:50 ./file2 Resolution: The vector that points to the next element in the command line is now properly updated to point to the beginning of the arguments to -exec option. Any command argument between the first occurrence of "{}" and +, is ignored. PHCO_25905: ( SR:8606201448 CR:JAGad70624 ) When find(1) is used to search for files belonging to an unlisted user or group under a cdfs file system,bus error is generated.For example: $mount /dev/dsk/c0t1d0 /SD_CDROM (mount the CDROM in the drive) $find /SD_CDROM \( -nouser -o -nogroup \) >>/dev/null Bus Error $find /SD_CDROM -nouser -fstype cdfs Bus Error $find /SD_CDROM -nogroup -fstype cdfs Bus Error Resolution: For a CD,-1 is returned by cdfs if no UID/GIDS are stored on it.This ID(-1) is used for key values of the hash tables used in find(1).The hash functions used in find(1) were not handling the negative numbers properly resulting in out of range values causing bus errors. The find(1) command is modified to take care of negative id's.The data types used internally are modified to ensure key values never go negative. ( SR:8606186711 CR:JAGad55921 ) When find(1) is used to search for files whose group id is greater than a particular group id say n,it does not display all files having group id greater than n. For example:On a 11.11 machine, $ls -l test -rw-rw-r-- 1 test1 users1 10 May 20 2001 foo1 -rw-rw-r-- 1 test1 users2 10 May 20 2001 foo2 -rw-rw-r-- 1 test1 users3 10 May 20 2001 foo3 (where group id's of users1,users2,users3 are 20,21,22 respectively) $find test -group +20 -rw-rw-r-- 1 test1 user1 10 May 20 2001 foo1 This is wrong.Instead it should display -rw-rw-r-- 1 test1 user2 10 May 20 2001 foo2 -rw-rw-r-- 1 test1 user3 10 May 20 2001 foo3 Resolution: find(1) command was not processing the group id argument correctly.It used to ignore the "+/-" sign associated with the "-group" argument. Now the command is modified to process the "+/-" sign of "-group" option as per the man page description. Enhancement: No SR: 8606186711 8606201448 8606326820 8606342869 Patch Files: OS-Core.CMDS-MIN,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/find OS-Core.CMIN-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: /usr/share/man/man1.Z/find.1 what(1) Output: OS-Core.CMDS-MIN,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/find: find.c $Date: 2004/01/05 05:30:55 $Revision: r11.11/ 5 PATCH_11.11 (PHCO_29692) funcs.c $Date: 2002/02/09 04:05:22 $Revision: r11.11 /2 PATCH_11.11 (PHCO_25905) getpwd.c $Date: 2003/10/28 05:30:55 $Revision: r11.1 1/1 PATCH_11.11 (PHCO_29692) $Revision: @(#) find R11.11_BL2004_0213_1 PATCH_11.1 1 PHCO_29692 Fri Feb 13 03:12:42 PST 2004 $ OS-Core.CMIN-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: /usr/share/man/man1.Z/find.1: None cksum(1) Output: OS-Core.CMDS-MIN,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: 2004643360 57344 /usr/bin/find OS-Core.CMIN-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: 1505191694 10571 /usr/share/man/man1.Z/find.1 Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHCO_25905 Equivalent Patches: None Patch Package Size: 70 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_29692 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_29692.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_29692. 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_29692.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_29692.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_29692.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None