[exim-cvs] cvs commit: exim/exim-src/src exim.c readconf.c

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Tom Kistner
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] cvs commit: exim/exim-src/src exim.c readconf.c
tom 2009/10/16 09:51:34 BST

  Modified files:
    exim-src/src         exim.c readconf.c 
  Log:
  Bugzilla #643


  Revision  Changes    Path
  1.64      +2 -1      exim/exim-src/src/exim.c
  1.37      +50 -6     exim/exim-src/src/readconf.c


  Index: exim.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- exim.c    14 Oct 2009 13:52:48 -0000    1.63
  +++ exim.c    16 Oct 2009 08:51:34 -0000    1.64
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim.c,v 1.63 2009/10/14 13:52:48 nm4 Exp $ */
  +/* $Cambridge: exim/exim-src/src/exim.c,v 1.64 2009/10/16 08:51:34 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -3939,7 +3939,8 @@
         if (i < argc - 1 &&
             (Ustrcmp(argv[i], "router") == 0 ||
              Ustrcmp(argv[i], "transport") == 0 ||
  -           Ustrcmp(argv[i], "authenticator") == 0))
  +           Ustrcmp(argv[i], "authenticator") == 0 ||
  +           Ustrcmp(argv[i], "macro") == 0))
           {
           readconf_print(argv[i+1], argv[i]);
           i++;


  Index: readconf.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/readconf.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- readconf.c    10 Jun 2009 07:34:04 -0000    1.36
  +++ readconf.c    16 Oct 2009 08:51:34 -0000    1.37
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/readconf.c,v 1.36 2009/06/10 07:34:04 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/readconf.c,v 1.37 2009/10/16 08:51:34 tom Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -2366,15 +2366,17 @@
     routers            print the routers' configurations
     transports         print the transports' configuration
     authenticators     print the authenticators' configuration
  +  macros             print the macros' configuration
     router_list        print a list of router names
     transport_list     print a list of transport names
     authenticator_list print a list of authentication mechanism names
  +  macro_list         print a list of macro names
     +name              print a named list item
     local_scan         print the local_scan options


-If the second argument is not NULL, it must be one of "router", "transport", or
-"authenticator" in which case the first argument identifies the driver whose
-options are to be printed.
+If the second argument is not NULL, it must be one of "router", "transport",
+"authenticator" or "macro" in which case the first argument identifies the
+driver whose options are to be printed.

   Arguments:
     name        option name if type == NULL; else driver name
  @@ -2390,6 +2392,7 @@
   optionlist *ol;
   optionlist *ol2 = NULL;
   driver_instance *d = NULL;
  +macro_item *m;
   int size = 0;


   if (type == NULL)
  @@ -2471,11 +2474,10 @@
       name = NULL;
       }


  -  else if (Ustrcmp(name, "authenticator_list") == 0)
  +  else if (Ustrcmp(name, "macros") == 0)
       {
  -    type = US"authenticator";
  +    type = US"macro";
       name = NULL;
  -    names_only = TRUE;
       }


     else if (Ustrcmp(name, "router_list") == 0)
  @@ -2484,12 +2486,28 @@
       name = NULL;
       names_only = TRUE;
       }
  +
     else if (Ustrcmp(name, "transport_list") == 0)
       {
       type = US"transport";
       name = NULL;
       names_only = TRUE;
       }
  +
  +  else if (Ustrcmp(name, "authenticator_list") == 0)
  +    {
  +    type = US"authenticator";
  +    name = NULL;
  +    names_only = TRUE;
  +    }
  +
  +  else if (Ustrcmp(name, "macro_list") == 0)
  +    {
  +    type = US"macro";
  +    name = NULL;
  +    names_only = TRUE;
  +    }
  +
     else
       {
       print_ol(find_option(name, optionlist_config, optionlist_config_size),
  @@ -2523,6 +2541,32 @@
     size = optionlist_auths_size;
     }


  +else if (Ustrcmp(type, "macro") == 0)
  +  {
  +  /* People store passwords in macros and they were previously not available
  +  for printing.  So we have an admin_users restriction. */
  +  if (!admin_user)
  +    {
  +    fprintf(stderr, "exim: permission denied\n");
  +    exit(EXIT_FAILURE);
  +    }
  +  for (m = macros; m != NULL; m = m->next)
  +    {
  +    if (name == NULL || Ustrcmp(name, m->name) == 0)
  +      {
  +      if (names_only)
  +        printf("%s\n", CS m->name);
  +      else
  +        printf("%s=%s\n", CS m->name, CS m->replacement);
  +      if (name != NULL)
  +        return;
  +      }
  +    }
  +  if (name != NULL)
  +    printf("%s %s not found\n", type, name);
  +  return;
  +  }
  +
   if (names_only)
     {
     for (; d != NULL; d = d->next) printf("%s\n", CS d->name);