Changeset 22 for trunk/src/yulectl.c


Ignore:
Timestamp:
Feb 23, 2006, 12:03:58 AM (19 years ago)
Author:
rainer
Message:

Minor code revisions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/yulectl.c

    r1 r22  
    300300  if (0 != good)
    301301    {
    302       fprintf (stderr, _("ERROR: Bounced message != original message.\n"));
     302      fprintf (stderr, _("ERROR: Bounced message != original message (possible reason: superfluous password).\n"));
    303303      return -1;
    304304    }
     
    321321  printf(_("          transfer to the client <client_hostname> when\n"));
    322322  printf(_("          this client connects to deliver a message.\n\n"));
     323  printf(_("          If password is required, it is read from\n"));
     324  printf(_("          $HOME/.yulectl_cred or taken from the environment\n"));
     325  printf(_("          variable YULECTL_PASSWORD (not recommended).\n\n"));
    323326
    324327  printf(_("Commands: RELOAD    <reload configuration>\n"));
     
    337340  FILE * fp;
    338341  struct passwd * pwent;
    339 
     342  char * pw;
     343
     344  pw = getenv(_("YULECTL_PASSWORD"));
     345  if (pw && strlen(pw) < 15)
     346    {
     347      strcpy(password, pw);
     348      strcpy(message2, password);
     349      goto do_msg;
     350    }
    340351 
    341352  pwent = getpwuid(geteuid());
     
    388399      exit(EXIT_FAILURE);
    389400    }
    390   if (strlen(message2) > 15)
     401  if (strlen(message2) > 14)
    391402    {
    392403      fprintf (stderr,
     
    400411    }
    401412  strcpy(password, message2);
     413  fclose(fp);
     414 do_msg:
    402415  strcat(message2, "@");
    403   fclose(fp);
    404416
    405417  strncat(message2, message, SH_MAXMSG - strlen(message2) -1);
Note: See TracChangeset for help on using the changeset viewer.