[exim-dev] [Bug 1454] Adding option -oMm to supply message r…

Top Page
Delete this message
Reply to this message
Author: Heiko Schlichting
Date:  
To: exim-dev
Subject: [exim-dev] [Bug 1454] Adding option -oMm to supply message reference
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1454




--- Comment #7 from Heiko Schlichting <heiko@???> 2014-04-25 18:24:14 ---
(1)

if (trusted_config && mac_ismsgid(argv[++i]) )

does not work here:

(1.1) if trusted_config is false, "i" is not increased.
(1.2) This can be solved by reversing the order to
        if (mac_ismsgid(argv[++i] && trusted_config)
      but this does not work either and complain about invalid message ids.
(1.3) The we can reverse the change to
        if (trusted_config && mac_ismsgid(argv[i+1]) )
          message_reference = argv[++i];
      if there is an exit in the else clause and "i" does not need to be
increased.


(2) I agree that exit(EXIT_FAILURE); might be a good idea. Ignoring wrong
arguments is confusing and wrong usage is a fatal error.

(3) I prefer to split both error conditions infavor of more precise error
message. But this results in more lines of code:


      else if (Ustrcmp(argrest, "Mm") == 0)
        {
        if (!mac_ismsgid(argv[i+1]))
          {
            fprintf(stderr,"-oMm must be a valid message ID\n");
            exit(EXIT_FAILURE);
          }
        if (!trusted_config)
          {
            fprintf(stderr,"-oMm must be called by a trusted user/config\n");
            exit(EXIT_FAILURE);
          }
        message_reference = argv[++i];
        }



--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email