Empty client time zone fails to default to server time zone (Perl)

Bug #1762815 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSRF
Fix Released
Medium
Unassigned
2.5
Fix Committed
Medium
Unassigned

Bug Description

OpenSRF 3.0

Seen when executing the "Mark Item as Missing Pieces" action in Evergreen, where the print template generated by the Perl API contained UTC dates. This action uses JSON gateway instead of the translator/websockets. A quick review of the client TZ code suggests maybe there's no way to relay the timezone via the gateway? (It doesn't use opensrf.js). Perhaps that's another bug.

Suffice to say, if no time zone is sent by the client, the server should default to the server time zone. It looks like it should be doing that in the Perl code, because a value of "" is applied when no time zone is sent. The tzset() code has other ideas in mind, though:

"If the TZ variable does appear in the environment, but its value is empty, or its value cannot be interpreted using any of the formats specified below, then Coordinated Universal Time (UTC) is used." -- from man 3 tzset

Deleting the $ENV{TZ} variable when no value is present before calling tzset() resolves the issue. Patch en route.

Tags: pullrequest
Revision history for this message
Bill Erickson (berick) wrote :
Changed in opensrf:
milestone: none → 3.0.1
tags: added: pullrequest
Changed in opensrf:
assignee: nobody → Jason Stephenson (jstephenson)
Revision history for this message
Jason Stephenson (jstephenson) wrote :

The fix works for me. Pushed to master, rel_3_0, and rel_2_5. Thanks, Bill!

Changed in opensrf:
status: New → Fix Committed
assignee: Jason Stephenson (jstephenson) → nobody
Galen Charlton (gmc)
Changed in opensrf:
importance: Undecided → Medium
Changed in opensrf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.