Bug 5688 - asctime_r hardcoded in globus_gram_job_manager_auditing.c
: asctime_r hardcoded in globus_gram_job_manager_auditing.c
Status: RESOLVED FIXED
: GRAM
gt2 Gatekeeper/Jobmanager
: 4.0.5
: Sun Solaris
: P3 normal
: 4.0.7
Assigned To:
:
:
: 5705
:
  Show dependency treegraph
 
Reported: 2007-11-27 10:08 by
Modified: 2008-02-01 16:34 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-11-27 10:08:07
In gram/jobmanager/source/globus_gram_job_manager_auditing.c:
...
    }
    t = asctime_r(tm_p, tbuf);
    if (t == NULL)
...

This results in a broken build under Solaris 10 (x86) with the gcc-3.4.3
compiler. 

Whereas mds/openldap/giis-ldapmodules/init.c uses:

#if GLOBUS_HAVE_ASCTIME_R_2
        buf_p = asctime_r(&tm_v, buf);
#elif GLOBUS_HAVE_ASCTIME_R_3
        buf_p = asctime_r(&tm_v, buf, 50);
#else
        buf_p = asctime(&tm_v);
        memcpy(&buf[0], buf_p, 50);
        buf_p = &buf[0];
#endif


Therefore the correct code would seem to be:
...
    }
#if GLOBUS_HAVE_ASCTIME_R_2
    t = asctime_r(tm_p, tbuf);
#elif GLOBUS_HAVE_ASCTIME_R_3
    t = asctime_r(tm_p, tbuf, 50);
#else
    t = asctime(tm_p);
    memcpy(&t[0], tbuf, 50);
    t = &tbuf[0];
#endif
    if (t == NULL)
...
------- Comment #1 From 2007-12-04 16:46:57 -------
Proposed patch:
http://www.bovine.net/~jlawson/exchange/globus-bug5688.diff
------- Comment #2 From 2007-12-05 12:13:08 -------
Added a bug for this patch in the common runtime component bug 5705.  In the
end, this will be a one line change for GRAM.
------- Comment #3 From 2008-02-01 16:31:27 -------
Committed a workaround to 4.0 branch and trunk.