From 5c68d52ce4d4c4ede0ce0101820320b1d06886dd Mon Sep 17 00:00:00 2001 From: Ulrich Wilkens Date: Thu, 30 Aug 2012 03:09:48 +0200 Subject: [PATCH] Two fixes for dtmail --- cde/programs/dtmail/dtmail/MsgScrollingList.C | 4 +++- cde/programs/dtmail/include/MotifApp/Application.h | 5 +++++ cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtmail/dtmail/MsgScrollingList.C b/cde/programs/dtmail/dtmail/MsgScrollingList.C index 22d041c4..a2deab76 100644 --- a/cde/programs/dtmail/dtmail/MsgScrollingList.C +++ b/cde/programs/dtmail/dtmail/MsgScrollingList.C @@ -2608,7 +2608,9 @@ MsgScrollingList::formatHeader(DtMailHeaderLine & info, { DtMailValueDate ds = ((info.header_values[1])[0])->toDate(); - if (ds.dtm_date && ds.dtm_tz_offset_secs) +#define USE_MAX_TZ_SECONDS (60 * 60 * 12) + if (ds.dtm_date && ds.dtm_tz_offset_secs >= -USE_MAX_TZ_SECONDS + && ds.dtm_tz_offset_secs <= USE_MAX_TZ_SECONDS) { #define USE_YEAR_FORMAT_SECONDS (60 * 60 * 24 * 180) time_t now; diff --git a/cde/programs/dtmail/include/MotifApp/Application.h b/cde/programs/dtmail/include/MotifApp/Application.h index 2d19e0ab..77bd2977 100644 --- a/cde/programs/dtmail/include/MotifApp/Application.h +++ b/cde/programs/dtmail/include/MotifApp/Application.h @@ -133,8 +133,13 @@ class Application : public UIComponent { virtual void shutdown() = 0; // Functions to manipulate group execution privileges +#if defined(CSRG_BASED) + void disableGroupPrivileges(void) { (void) setegid(_originalRgid); } + void enableGroupPrivileges(void) { (void) setegid(_originalEgid); } +#else void disableGroupPrivileges(void) { (void) setgid(_originalRgid); } void enableGroupPrivileges(void) { (void) setgid(_originalEgid); } +#endif gid_t originalEgid(void) { return _originalEgid; } gid_t originalRgid(void) { return _originalRgid; } diff --git a/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C b/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C index 00965d78..38d53ebf 100644 --- a/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C +++ b/cde/programs/dtmail/libDtMail/RFC/RFCMailValues.C @@ -493,6 +493,8 @@ RFCValue::toDate(void) date.dtm_date = SafeMktime(&new_time); #ifdef SVR4 date.dtm_tz_offset_secs = timezone; +#else + date.dtm_tz_offset_secs = new_time.tm_gmtoff; #endif } else { -- 2.25.1