This one fixes a bug where suid bit is needed for dtmail on BSD systems.
It also fixes a bug where date/time is not displayed for some time zones.


--
Ulrich Wilkens
Email: m...@uwilkens.de

>From 764099a24f0e2987593fd33358f0c767d357f0ea Mon Sep 17 00:00:00 2001
From: Ulrich Wilkens <m...@uwilkens.de>
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 deletions(-)

diff --git a/cde/programs/dtmail/dtmail/MsgScrollingList.C 
b/cde/programs/dtmail/dtmail/MsgScrollingList.C
index 22d041c..a2deab7 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 2d19e0a..77bd297 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 00965d7..38d53eb 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 {
-- 
1.7.8

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to