>Number:         6415
>Category:       user
>Synopsis:       ksh: changes in TZ are not reflected by time macros in PS1
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Jun 29 21:40:01 GMT 2010
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        
>Organization:
>Environment:
        System      : OpenBSD 4.7
        Details     : OpenBSD 4.7-beta (GENERIC.MP) #399: Wed Jan 27 12:22:57 
MST 2010
                         
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP

        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
        the time macros supported in PS1 (and PS2) (eg '\t', '\A', etc)
        seem to use the timezone present when the shell was invoked, and
        subsequently the shell seems to not notice if the timezone specified in
        the environment (TZ) is changed.

        tested on 4.7-beta / 20100127.  i don't currently have access to
        a more current -current.

>How-To-Repeat:

        following example shows:

- current date; current value of TZ (which is set in this case)
- changing PS1 to use the PS1 time macros
- setting TZ in the environment and retrieving the date
- exporting TZ and retrieving the date (no change in effect - normal)
- unsetting TZ and retrieving the date (falling back to system setting)
- value of the system setting
- attempt to demonstrate that PS1 still contains the native macros and
  not incorrect or stale string literals

#/home/jrrs $ date; echo $TZ
Tue Jun 29 14:19:33 PDT 2010
/usr/share/zoneinfo/right/US/Pacific
#/home/jrrs $ PS1='# t:\t T:\T @:\@ A:\A D:\D{%Z} $ '
# t:14:19:52 T: 2:19:52 @:02:19:52 PM A:14:19 D:PDT $ 
TZ=/usr/share/zoneinfo/right/UTC; date
Tue Jun 29 21:20:03 UTC 2010
# t:14:20:03 T: 2:20:03 @:02:20:03 PM A:14:20 D:PDT $ export TZ; date
Tue Jun 29 21:20:11 UTC 2010
# t:14:20:11 T: 2:20:11 @:02:20:11 PM A:14:20 D:PDT $ unset TZ; date
Tue Jun 29 17:20:17 EDT 2010
# t:14:20:17 T: 2:20:17 @:02:20:17 PM A:14:20 D:PDT $ readlink /etc/localtime
/usr/share/zoneinfo/right/US/Eastern
# t:14:20:24 T: 2:20:24 @:02:20:24 PM A:14:20 D:PDT $ set | grep ^PS1
PS1='# t:\t T:\T @:\@ A:\A D:\D{%Z} $ '
# t:14:20:30 T: 2:20:30 @:02:20:30 PM A:14:20 D:PDT $

>Fix:
        

        only other experience i have is bash(1), which appears to reflect
        TZ changes after running an external command (subsequent to altering
        value of TZ).  internal commands do not appear to trigger an update


dmesg:
OpenBSD 4.7-beta (GENERIC.MP) #399: Wed Jan 27 12:22:57 MST 2010
    [email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Xeon(TM) CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID,xTPR
real mem  = 4159188992 (3966MB)
avail mem = 4052766720 (3865MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 12/18/03, BIOS32 rev. 0 @ 0xfd6e0, SMBIOS 
rev. 2.31 @ 0xe3010 (46 entries)
bios0: vendor Phoenix Technologies LTD version 
"E7501CW20.86B.0026.P08.0312181024" date 12/18/2003
bios0: Intel Corporation SE7501CW2
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP APIC BOOT SPCR
acpi0: wakeup devices ICH3(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 132MHz
cpu1 at mainbus0: apid 6 (application processor)
cpu1: Intel(R) Xeon(TM) CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID,xTPR
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Xeon(TM) CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz
cpu2: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID,xTPR
cpu3 at mainbus0: apid 7 (application processor)
cpu3: Intel(R) Xeon(TM) CPU 2.80GHz ("GenuineIntel" 686-class) 2.80 GHz
cpu3: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID,xTPR
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
ioapic1 at mainbus0: apid 3 pa 0xfec80000, version 20, 24 pins
ioapic2 at mainbus0: apid 4 pa 0xfec80400, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 5 (ICH3)
acpiprt2 at acpi0: bus 3 (Z000)
acpiprt3 at acpi0: bus 2 (Z001)
acpicpu0 at acpi0
acpicpu1 at acpi0
acpicpu2 at acpi0
acpicpu3 at acpi0
acpibtn0 at acpi0: PWRB
bios0: ROM list: 0xc0000/0x8000 0xc8000/0x1800 0xc9800/0x1800 0xcb000/0x1200 
0xe3000/0x1000!
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel E7501 Host" rev 0x01
"Intel E7500 Error Reporting" rev 0x01 at pci0 dev 0 function 1 not configured
ppb0 at pci0 dev 2 function 0 "Intel E7500 PCI" rev 0x01
pci1 at ppb0 bus 1
"Intel 82870P2 IOxAPIC" rev 0x04 at pci1 dev 28 function 0 not configured
ppb1 at pci1 dev 29 function 0 "Intel 82870P2 PCIX-PCIX" rev 0x04
pci2 at ppb1 bus 2
"Intel 82870P2 IOxAPIC" rev 0x04 at pci1 dev 30 function 0 not configured
ppb2 at pci1 dev 31 function 0 "Intel 82870P2 PCIX-PCIX" rev 0x04
pci3 at ppb2 bus 3
ppb3 at pci3 dev 1 function 0 "Intel IOP331 PCIX-PCIX" rev 0x0a
pci4 at ppb3 bus 4
arc0 at pci4 dev 14 function 0 "Areca ARC-1110" rev 0x00: apic 4 int 2 (irq 10)
arc0: 4 ports, 256MB SDRAM, firmware V1.47 2009-07-02
scsibus0 at arc0: 16 targets
sd0 at scsibus0 targ 0 lun 0: <Areca, /, R001> SCSI3 0/direct fixed
sd0: 76293MB, 512 bytes/sec, 156249088 sec total
sd1 at scsibus0 targ 0 lun 1: <Areca, /var/www/htdocs, R001> SCSI3 0/direct 
fixed
sd1: 190734MB, 512 bytes/sec, 390624256 sec total
sd2 at scsibus0 targ 0 lun 2: <Areca, /home, R001> SCSI3 0/direct fixed
sd2: 3548428MB, 512 bytes/sec, 7267181568 sec total
"Intel E7500 PCI" rev 0x01 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801CA/CAM USB" rev 0x02: apic 2 int 16 
(irq 10)
uhci1 at pci0 dev 29 function 1 "Intel 82801CA/CAM USB" rev 0x02: apic 2 int 19 
(irq 5)
uhci2 at pci0 dev 29 function 2 "Intel 82801CA/CAM USB" rev 0x02: apic 2 int 18 
(irq 10)
ppb4 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0x42
pci5 at ppb4 bus 5
vga1 at pci5 dev 3 function 0 "ATI Rage XL" rev 0x27
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
fxp0 at pci5 dev 4 function 0 "Intel 8255x" rev 0x0d, i82550: apic 2 int 20 
(irq 10), address 00:0e:0c:4d:2b:45
inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 4
em0 at pci5 dev 5 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02: apic 2 int 
23 (irq 11), address 00:0e:0c:4d:2b:6e
ichpcib0 at pci0 dev 31 function 0 "Intel 82801CA LPC" rev 0x02
pciide0 at pci0 dev 31 function 1 "Intel 82801CA IDE" rev 0x02: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 disabled (no drives)
ichiic0 at pci0 dev 31 function 3 "Intel 82801CA/CAM SMBus" rev 0x02: apic 2 
int 17 (irq 0)
iic0 at ichiic0
iic0: addr 0x1b 02=0a 03=0a 04=ff 05=ff 10=58 11=58 12=56 13=56 14=1f 15=1f 
16=01 17=01 18=37 19=37 1a=37 1b=37 1c=37 1d=37 1e=37 1f=37 22=0a 23=0a 24=ff 
25=ff 30=58 31=58 32=56 33=56 34=1f 35=1f 36=01 37=01 38=37 39=37 3a=37 3b=37 
3c=37 3d=37 3e=37 3f=37 42=0a 43=0a 44=ff 45=ff 50=58 51=58 52=56 53=56 54=1f 
55=1f 56=01 57=01 58=37 59=37 5a=37 5b=37 5c=37 5d=37 5e=37 5f=37 62=0a 63=0a 
64=ff 65=ff 70=58 71=58 72=56 73=56 74=1f 75=1f 76=01 77=01 78=37 79=37 7a=37 
7b=37 7c=37 7d=37 7e=37 7f=37 82=0a 83=0a 84=ff 85=ff 90=58 91=58 92=56 93=56 
94=1f 95=1f 96=01 97=01 98=37 99=37 9a=37 9b=37 9c=37 9d=37 9e=37 9f=37 a2=0a 
a3=0a a4=ff a5=ff b0=58 b1=58 b2=56 b3=56 b4=1f b5=1f b6=01 b7=01 b8=37 b9=37 
ba=37 bb=37 bc=37 bd=37 be=37 bf=37 c2=0a c3=0a c4=ff c5=ff d0=58 d1=58 d2=56 
d3=56 d4=1f d5=1f d6=01 d7=01 d8=37 d9=37 da=37 db=37 dc=37 dd=37 de=37 df=37 
e2=0a e3=0a e4=ff e5=ff f0=58 f1=58 f2=56 f3=56 f4=1f f5=1f f6=01 f7=01 f8=37 
f9=37 fa=37 fb=37 fc=37 fd=37 fe=37 ff=37 words 00=0000!
  01=0000 02=0a0a 03=0a0a 04=ffff 05=ffff 06=0000 07=0000
lm1 at iic0 addr 0x2c: W83627HF
spdmem0 at iic0 addr 0x50: 1GB DDR SDRAM registered ECC PC2700CL2.5
spdmem1 at iic0 addr 0x51: 1GB DDR SDRAM registered ECC PC2700CL2.5
spdmem2 at iic0 addr 0x54: 1GB DDR SDRAM registered ECC PC2700CL2.5
spdmem3 at iic0 addr 0x55: 1GB DDR SDRAM registered ECC PC2700CL2.5
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb1 at uhci1: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci2: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
wbsio0 at isa0 port 0x2e/2: W83627HF rev 0x17
lm2 at wbsio0 port 0x290/8: W83627HF
lm1 detached
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
root on sd0a swap on sd0b dump on sd0b
WARNING: / was not properly unmounted


>Release-Note:
>Audit-Trail:
>Unformatted:

Reply via email to