Patch Name: PHCO_24196 Patch Description: s700_800 10.26 cron/at/crontab cumulative patch Creation Date: 01/06/21 Post Date: 01/06/28 Hardware Platforms - OS Releases: s700: 10.26 s800: 10.26 Products: N/A Filesets: OS-Core.CMDS-MIN OS-Core.CMIN-ENG-A-MAN Automatic Reboot?: No Status: General Superseded Critical: No Path Name: /hp-ux_patches/s700_800/10.X/PHCO_24196 Symptoms: PHCO_24196: Porting of 10.20 patch PHCO_22768 (PHCO_22768:) 1.crontab(1) incorrect functionality. 2.When DST shift is due before the scheduled time, at(1) does not schedule the jobs correctly. 3.at(1) incorrect argument parsing. 4.cron(1M) does not schedule jobs during daylight saving shift. 5.at(1) reports "bad date specification" when specifying four digits time (PHCO_19985:) 1. at now + [n] months ignores leap year. 2. crontab(1) -e creates crontab job files with incorrect permissions. 3. at(1) manpage needs to be modified. 4. Patches for cron(1M) should stop cron and start the new cron. 5. PHCO_17552 does not have libc dependencies specified. 6. at(1) assumes the given time to be AM if the am_pm string in the specified locale is NULL. PHCO_20323: warning message in the swagent.log file when installing the patch bundle at coldinstall time. PHCO_19757: cron(1M) does not send mail with job output to user. PHCO_17931: 1. Incorrect behavior of crontab(1) with -l and -r options. 2. Port of PHCO_17552 to 10.26 (PHCO_17552) at(1) does not accept input of "00" or "0" for year for all locales. PHCO_17498: Port of PHCO_16864 to 10.26 (PHCO_16864) 1. On trusted systems, cron(1) has slower performance due to calling getspwent() when getspwnam() should have been used. 2. Cron from patch PHCO_15679 does not run at(1) and batch(1) jobs. 3. at(1) schedules jobs incorrectly relative to 28 Feb of non-leap years. 4. at(1) does not recognize year 00 (2000). When year is input as 00, at(1) exits with the error message - "bad date specification" PHCO_16958: 1. When an non-root user in /var/adm/cron/cron.allow tries to run crontab -e and then saves, he gets crontab: can't create your crontab file in the crontab directory. 2. When a user submits an at job, /var/adm/cron/log shows that the job was run, but job was not performed. Defect Description: PHCO_24196: Porting of 10.20 patch PHCO_22768 (PHCO_22768:) 1. crontab(1) incorrect functionality. Resolution: Code has been modified to take care of this issue. 2. When DST shift is due, there will be a non-existing time in a day. When jobs are scheduled for such non-existing times through commands like - at now + minutes, at fails with message "too late". Resolution: Now the code has been modified to take care of jobs scheduled for non-existing times. 3. at(1) incorrect argument parsing. Resolution: The code has been modified to take care of this. 4. cron(1M) executes the job 2 days later than the scheduled date, if a shift in daylight happens between the current date and the scheduled date. Resolution: Now the code has been modified to take care of jobs scheduled for non-existing times. 5. at(1) shows bad date specification when specifying four digits time. Resolution: Now the code has been modified to accept the four digits time. (PHCO_19985:) 1. Setting the system date such that the day is any day after 28th and executing the at(1) command to schedule the job for the month of February in a leap year, schedules the jobs incorrectly. The following shows the incorrect behaviour of at(1). $ date 1229084495 date:do you really want to run time backwards?[yes/no]yes Fri Dec 29 08:44:00 EST 1995 $ at now + 2 month warning: commands will be executed using /usr/bin/sh job 825687848.a at Fri Mar 1 08:44:08 1996 at(1) should have scheduled the job for Feb 29. Instead it is scheduling the job for Mar 1. 2. crontab when used with -e creates the job files with read permission for all. 3. The manpage of at(1) needs to be more clear regarding the ambiguity of dates. 4. The cron(1M) patches do not stop the old cron daemon and start the new cron daemon. The starting and stopping of the daemon does not correctly work in the swinstall scripts since the signal mask of the cron daemon gets modified through SD scripts. 5. The cron/at patches should have the libc dependencies specified. Without the libc patch PHCO_8108 installed, the at(1) command will fail with an unresolved symbol error for 'snprintf'. 6. For certain locales like fr_FR.iso88591, where am_pm string is defined as null ("";""), at(1) treats the specified time to be AM. The following illustrates the problem. $ export LANG=fr_FR.iso88591 $ echo date | at 07:00 demain # OK job 879487201.a at Vendredi 14 novembre 1997 07:00:00 $ echo date | at 20:00 # OK job 879447600.a at Jeudi 13 novembre 1997 20:00:00 $ echo date | at 20:00 demain # BUG Hours Field Is Invalid Resolution: 1. Checking for the leap year before scheduling the job, solves the problem. 2. The crontab command was relying on a macro for permissions on the job file. This macro was incorrect. This has been set right now. Now, crontab(1) creates job files with read permission only for the owner. 3. Necessary changes are made to the at(1) manpage to solve this problem. 4. Resetting the signal handlers in cron to their respective defaults solves the problem. 5. Specifying the libc patch, PHCO_8108, in the patch dependencies field solves the problem. 6. Checking for the value of am_pm string for the locale solves the problem. PHCO_20323: Repackaged to allow this patch to be part of a patch bundle. No changes made to the binaries. The changes are only made in the installation scripts. PHCO_19757: When a jobs output is not redirected to a file, it should be mailed to the submitter. This was not happening. Resolution: Enable cron to send output to the submitter. PHCO_17931: 1. Handling of 'crontab -l' and 'crontab -r' is incorrect for trusted systems. 2. Port of PHCO_17552 Resolution: 1. Removed special case code in order to behave like HP-UX 10.20. Updated man page for clarity. 2. Port of PHCO_17552 (PHCO_17552) at(1) treats year input of 00 or 0 as incorrect when locale is set to one which defines D_T_FMT (date-time) string to have year in fields other than the third. For eg. japanese locale defines the date string to be of format yy/mm/dd. With locale set to japanese, an attempt to schedule a job using at(1) for a date 00/12/20 or 0/12/20 fails. (Resolution:) at(1) assumed that the year field can be only in the third field of the date string. This assumption has been removed. Also, the function which returned error if the date string had 0 or 00 in the first or second fields has been changed not to check and return error for such a condition. Now, at(1) accepts input of 0 or 00 for year in any field of the date string, as specified by D_T_FMT string for the locale. PHCO_17498: (PHCO_16864) 1. On trusted systems, cron(1) called getspwent() which performs a linear search in the passwd database, instead of getspwnam() which performs a keyed search. 2. After installing PHCO_15679, jobs submitted from at(1) are never actually run, although they are removed from the /var/spool/cron/atjobs queue. 3. Jobs scheduled after 28 Feb are scheduled erratically by at(1). The following shows the incorrect behaviour of at(1). # date 0227112099 Sat Feb 27 11:20:00 GMT 1999 # at now + 2 day warning: commands will be executed using /usr/bin/sh job 920287223.a at Mon Mar 1 11:20:23 1999 # at now + 3 day warning: commands will be executed using /usr/bin/sh job 920287243.a at Mon Mar 1 11:20:43 1999 In the above example, job is scheduled for March 1st for both the inputs "now + 2 day" and "now + 3 day". For the input "now + 3 day", at(1) should have scheduled the job for March 2nd 1999. The source code has been changed to fix the defect. After the fix, at(1) correctly schedules jobs relative to Feb, 28th. In the above example, for input "now + 3 day", at(1) schedules the job for March 2nd. 4. at(1) treats year input of 00 as incorrect. Following shows how at(1) behaves with 00 as input year. # at 12:00 1 Jan 00 bad date specification The command has been changed to accept 00 as year 2000. After the fix, at(1) treats year input of 00 as year 2000 and does not show any error messages. Resolution: Port PHCO_16864 PHCO_16958: 1. Code could not handle multi-level directory 2. stdin, stderr and stdout were being closed before the shell was launched. This means, a shell would run with no input and exit, resulting in a good return value. Resolution: 1. Add code for multi-level directory 2. Move the close(2)'s up in the code, so that the proper jobs are opened and stdout / stderr and handled correctly. SR: 8606165710 8606125591 8606157697 8606158467 8606140830 4701411173 8606106557 1653312975 5003459313 1653293407 5003451278 5003457150 1653238113 4701416891 1653274167 5003425777 5003426254 1653269746 1653266239 1653241117 4701383794 1653215038 4701347153 4701334763 4701328179 4701393728 Patch Files: /usr/bin/crontab /usr/bin/at /usr/sbin/cron /usr/share/man/man1.Z/at.1 /usr/share/man/man1.Z/crontab.1 /usr/lib/nls/msg/C/at.cat /usr/lib/nls/msg/C/cron.cat /usr/lib/nls/msg/C/crontab.cat what(1) Output: /usr/bin/crontab: 2001/06/19 Hewlett-Packard HP-UX 10.26 TOS [ ic5ft - DAV17 ] PATCH_10_20 PHCO_10737 $Revision: 78.2.1.16 $ 99/03/15 cmd/cron/hpux_rel.c, hpux, hpux_10.26, ic5f t Revision 1.2 PATCH_10.26 (PHCO_17931) 01/05/30 cmd/cron/crontab.c, hpux, hpux_10.26, ic5ft Revision 1.12 PATCH_10.26 (PHCO_24196) /usr/bin/at: 2001/06/19 Hewlett-Packard HP-UX 10.26 TOS [ ic5ft - DAV17 ] PATCH_10_20 PHCO_10737 $Revision: 78.2.1.16 $ 99/03/15 cmd/cron/hpux_rel.c, hpux, hpux_10.26, ic5f t Revision 1.2 PATCH_10.26 (PHCO_17931) 01/05/30 cmd/cron/at.c, hpux, hpux_10.26, ic5ft Revi sion 1.8 PATCH_10.26 (PHCO_24196) $Revision: 76.2.1.11 $ 01/05/30 cmd/cron/ptime.c, hpux, hpux_10.26, ic5ft R evision 1.2 PATCH_10.26 (PHCO_24196)UNMODIFI ED $Revision: 76.2.1.1.1.5 $ 99/03/15 cmd/cron/pdate.c, hpux, hpux_10.26, ic5ft R evision 1.2 PATCH_10.26 (PHCO_17931) UNMODIF IED /usr/sbin/cron: 2001/06/19 Hewlett-Packard HP-UX 10.26 TOS [ ic5ft - DAV17 ] PATCH_10_20 PHCO_10737 $Revision: 78.2.1.16 $ 99/03/15 cmd/cron/hpux_rel.c, hpux, hpux_10.26, ic5f t Revision 1.2 PATCH_10.26 (PHCO_17931) 01/05/30 cmd/cron/cron.c, hpux, hpux_10.26, ic5ft Re vision 1.10 PATCH_10.26 (PHCO_24196) 99/09/09 cmd/cron/cron_sec.c, hpux, hpux_10.26, ic5f t Revision 1.3 PATCH_10.26 (PHCO_19757) /usr/share/man/man1.Z/at.1: None /usr/share/man/man1.Z/crontab.1: None /usr/lib/nls/msg/C/at.cat: None /usr/lib/nls/msg/C/cron.cat: None /usr/lib/nls/msg/C/crontab.cat: None cksum(1) Output: 3710540178 28672 /usr/bin/crontab 3538446374 45056 /usr/bin/at 1884068627 53248 /usr/sbin/cron 1675895882 11378 /usr/share/man/man1.Z/at.1 129400876 5380 /usr/share/man/man1.Z/crontab.1 3982863520 3212 /usr/lib/nls/msg/C/at.cat 1745700039 3275 /usr/lib/nls/msg/C/cron.cat 2280270017 1009 /usr/lib/nls/msg/C/crontab.cat Patch Conflicts: None Patch Dependencies: s700: 10.26: PHCO_23181 s800: 10.26: PHCO_23181 Hardware Dependencies: None Other Dependencies: This patch depends on the command patch PHCO_23181. For successful installation please insure that PHCO_23181 or its superseded patch is already installed before installing this patch. Supersedes: PHCO_16958 PHCO_17498 PHCO_17931 PHCO_19757 PHCO_20323 Equivalent Patches: PHCO_22768: s700: 10.20 s800: 10.20 Patch Package Size: 210 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_24196 5a. For a standalone system, run swinstall to install the patch: swinstall -x autoreboot=true -x match_target=true \ -s /tmp/PHCO_24196.depot By default swinstall will archive the original software in /var/adm/sw/patch/PHCO_24196. 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_24196.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_24196.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: This patch depends on the command patch PHCO_23181. For successful installation please insure that PHCO_23181 or its superseded patch is already installed before installing this patch