Menu

#229 Curl related code is never exerciesd if reputation is not enabled

2.10.1
open
None
5
2015-07-02
2015-07-02
No

The build option to link against libcurl does not appear to actually do anything if reputation is not enabled. Resulting builds have no dependency on any function in libcurl.

There is also what I would call "dead" code related to the HAVE_CURL_EASY_SETOPT function:

build@c7test:~/p4/zimbra/main/ThirdParty/opendkim/q/opendkim-2.10.3$ find . -type f | xargs grep HAVE_CURL_EASY_SETOPT
./opendkim/opendkim.c:#ifdef HAVE_CURL_EASY_SETOPT
./opendkim/opendkim.c:#else / HAVE_CURL_EASY_SETOPT /
./opendkim/opendkim.c:#endif / HAVE_CURL_EASY_SETOPT /

configure never tests for this, so it never gets set.

For the other curl define HAVE_CURL_EASY_STRERROR, nothing touching the curl library is ever invoked, so the code blocks that depend on its existence make no senes to me.

For example:

ifdef HAVE_CURL_EASY_STRERROR

    char *          conf_smtpuri;           /* outgoing mail URI */

endif / HAVE_CURL_EASY_STRERROR /

ifdef HAVE_CURL_EASY_STRERROR

            (void) config_get(data, "SMTPURI", &conf->conf_smtpuri,
                              sizeof conf->conf_smtpuri);

endif / HAVE_CURL_EASY_STRERROR /

ifdef HAVE_CURL_EASY_STRERROR

    if (conf->conf_smtpuri != NULL)
    {
            int fd;
            char path[MAXPATHLEN + 1];

            snprintf(path, sizeof path, "%s/%s.XXXXXX", conf->conf_tmpdir,
                     progname);

            fd = mkstemp(path);
            if (fd < 0)
            {
                    if (conf->conf_dolog)
                    {
                            syslog(LOG_ERR, "%s: mkstemp(): %s",
                                   dfc->mctx_jobid, strerror(errno));
                    }

                    return;
            }

            unlink(path);

            out = fdopen(fd, "w");
            if (out == NULL)
            {
                    if (conf->conf_dolog)
                    {
                            syslog(LOG_ERR, "%s: fdopen(): %s",
                                   dfc->mctx_jobid, strerror(errno));
                    }

                    close(fd);
                    return;
            }
    }
    else
    {
            out = popen(reportcmd, "w");
            if (out == NULL)
            {
                    if (conf->conf_dolog)
                    {
                            syslog(LOG_ERR, "%s: popen(): %s",
                                   dfc->mctx_jobid, strerror(errno));
                    }

                    return;
            }
    }

else / HAVE_CURL_EASY_STRERROR /

    out = popen(reportcmd, "w");
    if (out == NULL)
    {
            if (conf->conf_dolog)
            {
                    syslog(LOG_ERR, "%s: popen(): %s",
                           dfc->mctx_jobid, strerror(errno));
            }

            return;
    }

endif / HAVE_CURL_EASY_STRERROR /

None of the above code block appears to have anything related to curl ?

Again, perhaps this is related to reputation being enabled.

If so, then the above defines should be wrapped around whether or not reputation was enabled.

I.e.,

ifdef _FFR_REPUTATION

ifdef HAVE_CURL_EASY_STRERROR

...

Discussion


Log in to post a comment.

MongoDB Logo MongoDB