Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to force TZ to UTC #75 #76

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion class_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
DEBUG = 0

# The pytsk3 version.
VERSION = "20210327"
VERSION = "20210419"

# These functions are used to manage library memory.
FREE = "aff4_free"
Expand Down
4 changes: 2 additions & 2 deletions dpkg/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytsk3 (20210327-1) unstable; urgency=low
pytsk3 (20210419-1) unstable; urgency=low

* Auto-generated

-- Joachim Metz <[email protected]> Sat, 27 Mar 2021 13:12:25 -0100
-- Joachim Metz <[email protected]> Mon, 19 Apr 2021 20:05:49 -0100
21 changes: 20 additions & 1 deletion tsk3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "tsk3.h"

#include <time.h>

#if defined( TSK_MULTITHREAD_LIB )

extern "C" {
extern void tsk_init_lock(tsk_lock_t * lock);
extern void tsk_deinit_lock(tsk_lock_t * lock);
}
#endif

#endif /* defined( TSK_MULTITHREAD_LIB ) */

/* Prototypes for IMG_INFO hooks
* Note that IMG_INFO_read is called by the SleuthKit the Img_Info_read
Expand Down Expand Up @@ -690,6 +695,20 @@ VIRTUAL(Volume_Info, Object) {


void tsk_init() {

// libtsk uses mktime and localtime that rely on the TZ environment variable
// however that leads to inconsistent behavior with different TZ values.
// Hence that we force TZ to be UTC, when possible.
#if defined( _MSC_VER )
_putenv_s("TZ", "UTC");
_tzset();

// Some installations of MinGW do not support setenv
#elif !defined( __MINGW32__ )
setenv("TZ", "UTC", 1);
tzset();
#endif

//tsk_verbose++;
Img_Info_init((Object)&__Img_Info);
FS_Info_init((Object)&__FS_Info);
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20210327
20210419