Patch Name: PHCO_27141 Patch Description: s700_800 11.00 cumulative crontab/at/cron patch Creation Date: 02/06/17 Post Date: 02/06/24 Hardware Platforms - OS Releases: s700: 11.00 s800: 11.00 Products: N/A Filesets: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP OS-Core.CMIN-ENG-A-MAN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP Automatic Reboot?: No Status: General Release Critical: Yes PHCO_27141: OTHER atjobs are not getting executed if any of LANG/LC_ALL/LC_CTYPE are set. Category Tags: defect_repair general_release critical Path Name: /hp-ux_patches/s700_800/11.X/PHCO_27141 Symptoms: PHCO_27141: 1. atjobs are not executed, if any of LANG, LC_ALL and LC_CTYPE are set. 2. crontab(1) is not properly handling the crontab file when the filesystem is full. 3. at/cron jobs are not able to create large files. PHCO_24702: 1.at(1) aborts with "rc=2" error when processing multi-byte characters if 'atjobs' script contain expressions to set the locale to a multi-byte locale. PHCO_22767: 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.In trusted mode, crontab(1) does not create correct audit record. PHCO_21494: 1. For jobs scheduled for 31st of a month, Cron starts looping on the last day of the month if the month has 30 days. 2. at(1) reports "bad date specification" when specifying four digits time. PHCO_19986: 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. at(1) assumes the given time to be AM if the am_pm string in the specified locale is NULL. PHCO_17553: at(1) does not accept input of "00" or "0" for year for all locales. PHCO_16942: 1. On trusted systems, cron(1) has slower performance due to calling getspwent() when getspwnam() should have been used. 2. 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_15235: Year displayed in two digits PHCO_14780: 1. crontab creates files with improper permissions. 2. at creates an invalid file in /var/spool/cron when given a non-existant job file with the -f option. Defect Description: PHCO_27141: 1. On machines having latest kernel patches (available in Sept-2001 Quality pack) and the previous at/cron patch(PHCO_24702), atjobs are not getting executed when any of LANG, LC_ALL, LC_CTYPE are set. Steps to reproduce the defect: 1. Start the cron daemon $ /sbin/init.d/cron start 2. Set the LANG to some locale. $ export LANG=ja_JP.SJIS 3. Initiate an atjob. $ at now <t.1 EOF 4. Check whether the atjob was executed. $ ll t.1 t.1 not found Resolution: With the above environment, cron was not able to release the lock on the atjob file which resulted in a race condition. cron(1M) has been fixed to remove this race condition. 2. When the filesystem on which /var mounted is full, editing crontab file (using "crontab -e") nullifies the file. Resolution: crontab(1) has been modified to handle the crontab file properly when the filesystem is full, so that the content of the crontab file is not lost. 3. at/cron jobs cannot create large files. This was happening because at(1) was not checking for the allowed maximum limits of user. Steps to reproduce the defect : $ ulimit unlimited $ /usr/bin/at now <t1 EOF job 1023756162.a at Tue Jun 11 06:12:42 2002 $ cat t1 4194303 (expect output here is "unlimited") Resolution: at(1) has been modified so that the atjobs can create large files for users having the required ulimit value. PHCO_24702: 1. at(1) creates 'atjobs' scripts for executing batched commands at a later time. But at(1) causes execution error, when 'atjobs' scripts contain expressions to set the LC_CTYPE to a multi-byte locale. For example: if the atjob script has the following expressions: setenv LANG ja_JP.SJIS setenv AAA xxxx at -t 03261500 << EOF./test1.sh EOF Where "xxxx" is Japanese character and it is SJIS Code '0x93609197'. 'atjobs' script is created in /var/spool/cron/atjobs after above command. But when the above job is scheduled, at(1) aborts with "rc=2" error. The log file /var/adm/cron/log will contain the above error. Resolution: /usr/bin/sh does not handle the change in LC_CTYPE in the same session. This behavior of sh-posix(1) is as per the requirements of POSIX standards.The man page documentation of sh-posix(1) also states this behavior. sh-posix(1) man page states the following: "Changing the value of LC_CTYPE after the shell has started does not affect the lexical processing of shell commands in the current shell execution environment or its subshells. See environ(5)." As the above job involves changing the LC_CTYPE, at(1) used to process the data in the previous set locales resulting in error. at(1) is modified to take care of these environment Variables. Now, When scheduling 'atjobs' involving multibyte locales, at(1) inserts a new shell session in the 'atjobs' file, if it encounters any of LC_ALL, LC_CTYPE and LANG settings. PHCO_22767: 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 may 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 is modified to take care of this. 4. In trusted mode, crontab(1) does not create audit records because required data is not generated by the underlying library call. Resolution: Appropriate calls to get audit ids are used to resolve the problem. PHCO_21494: 1. A job scheduled for 31st of a month starts looping on the last day of the month incase the month does not have 31 days (Looping also happens for jobs scheduled for 29th and 30th of Feb incase of non-leap years and for jobs scheduled for 30th of Feb incase of leap years). This erroneous behaviour is due to an unnecessary day comparison introduced for DST fix. Resolution: Now the day comparison made in cron has been commented out to fix the problem. 2. The problem is because at(1) is parsing extra characters other than the time string (for eg. characters from date string), thus, giving the error message "bad date specification". Resolution: The fix is to set the END OF TIME(EOT) to 1 after parsing time string such that the unnecessary parsing of the date string is not done. PHCO_19986: 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 job 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. 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 november 1997 07:00:00 $ echo date | at 20:00 # OK job 879447600.a at Jeudi 13 november 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. Checking for the value of am_pm string for the locale solves the problem. PHCO_17553: 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_16942: 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. 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. PHCO_15235: Year displayed in two digits PHCO_14780: 1. The problem consists of the creation of a temporary file for "crontab -e".The file is created with improper permissions. The write permission should exist only for the owner of the calling process. 2. At fails to clean up the file created under /var/spool/cron when invoked with -f option and non-existant job file. SR: 8606239798 8606229258 8606179733 8606189207 8606165710 8606125591 8606157697 8606158467 4701411173 8606130624 8606106122 1653303602 8606106557 1653312975 5003459313 1653293407 5003451278 1653238113 4701416891 1653269746 1653266239 4701391466 4701384057 4701383794 Patch Files: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lib/nls/msg/C/at.cat /usr/lib/nls/msg/C/cron.cat /usr/lib/nls/msg/C/crontab.cat /usr/sbin/cron /usr/bin/at /usr/bin/crontab OS-Core.CMIN-ENG-A-MAN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: /usr/share/man/man1.Z/at.1 /usr/share/man/man1.Z/batch.1 what(1) Output: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lib/nls/msg/C/at.cat: None OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lib/nls/msg/C/cron.cat: None OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lib/nls/msg/C/crontab.cat: None OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/sbin/cron: $Revision: 82.9.1.29 $ PATCH_11_00: hpux_rel.o cron.o funcs.o 02/06/17 OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/bin/at: $Revision: 82.9.1.29 $ $Revision: 82.3.1.12 $ $Revision: 82.1.1.6 $ PATCH_11_00: hpux_rel.o at.o pdt.o ptime.o pdate.o f uncs.o permit.o 02/06/17 OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/bin/crontab: $Revision: 82.9.1.29 $ PATCH_11_00: hpux_rel.o crontab.o permit.o funcs.o 0 2/06/17 OS-Core.CMIN-ENG-A-MAN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: /usr/share/man/man1.Z/at.1: None OS-Core.CMIN-ENG-A-MAN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: /usr/share/man/man1.Z/batch.1: None cksum(1) Output: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 3018845174 3386 /usr/lib/nls/msg/C/at.cat OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 4002162402 2532 /usr/lib/nls/msg/C/cron.cat OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 947906553 1084 /usr/lib/nls/msg/C/crontab.cat OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 1687010161 45056 /usr/sbin/cron OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 90780666 53248 /usr/bin/at OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 1906009400 32768 /usr/bin/crontab OS-Core.CMIN-ENG-A-MAN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: 3528200293 9014 /usr/share/man/man1.Z/at.1 OS-Core.CMIN-ENG-A-MAN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: 3528200293 9014 /usr/share/man/man1.Z/batch.1 Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHCO_14780 PHCO_15235 PHCO_16942 PHCO_17553 PHCO_19986 PHCO_21494 PHCO_22767 PHCO_24702 Equivalent Patches: None Patch Package Size: 190 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_27141 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_27141.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_27141. 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_27141.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_27141.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_27141.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None