~ubuntu-branches/ubuntu/intrepid/binkd/intrepid

« back to all changes in this revision

Viewing changes to readcfg.c

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2006-08-25 19:50:50 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060825195050-ljt6glswfvxvsyjp
Tags: 0.9.9+20060809-1
* New upstream snapshot.
* I AM LOOKING FOR A CO-MAINTAINER!

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 */
13
13
 
14
14
/*
15
 
 * $Id: readcfg.c,v 2.26.2.1 2003/06/30 22:49:39 hbrew Exp $
 
15
 * $Id: readcfg.c,v 2.26.2.3 2006/03/02 20:27:10 stas Exp $
16
16
 *
17
17
 * $Log: readcfg.c,v $
 
18
 * Revision 2.26.2.3  2006/03/02 20:27:10  stas
 
19
 * print warning if password file is invalid
 
20
 *
 
21
 * Revision 2.26.2.2  2006/03/02 20:08:06  stas
 
22
 * ifcico/qico passwords file support
 
23
 *
18
24
 * Revision 2.26.2.1  2003/06/30 22:49:39  hbrew
19
25
 * Allow to override -ip, -sip, -md, -nomd in add_node()
20
26
 *
366
372
    if (pd->alias4)
367
373
      continue;
368
374
    if (pd->path)
369
 
    { 
 
375
    {
370
376
      char *s;
371
377
#ifdef UNIX
372
378
      if (obox==strstr(obox, pd->path))
436
442
static void add_to_config_list(const char *path)
437
443
{
438
444
  struct conflist_type *pc;
439
 
    
 
445
 
440
446
  if (config_list)
441
447
  {
442
448
    for (pc = config_list; pc->next; pc = pc->next);
561
567
static void passwords (KEYWORD *key, char *s)
562
568
{
563
569
  FILE *in;
564
 
  char buf[MAXCFGLINE + 1];  
 
570
  char buf[MAXCFGLINE + 1];
565
571
  char *w = getword(s, 2);
566
572
  FTN_ADDR fa;
567
573
 
568
 
  if(!w) 
 
574
  if(!w)
569
575
    Log (0, "%s: %i: password filename expected", path, line);
570
576
  if((in=fopen(w, "rt"))==NULL)
571
577
    Log (0, "%s: %i: unable to open password file (%s)", path, line, w);
580
586
    if (!fgets (buf, sizeof (buf), in))
581
587
      break;
582
588
    for(w=buf;isspace(w[0]);w++);  /* skip spaces */
583
 
    if(w!=buf) strcpy(buf, w); 
 
589
    if (STRNICMP(w,"password",8)==0)  /* ifcico/qico password file */
 
590
    {
 
591
      w += 8;
 
592
      for(;isspace(w[0]);w++);
 
593
    }
 
594
 
 
595
    if(w!=buf) strcpy(buf, w);
584
596
    for(w=buf;(w[0])&&(!isspace(w[0]));w++);
585
597
    while(isspace(w[0]))           /* go to the password */
586
598
    {
587
599
      w[0]=0;
588
600
      w++;
589
601
    }
590
 
    if((!w[0])||(!parse_ftnaddress (buf, &fa))) 
 
602
    if((!w[0])||(!parse_ftnaddress (buf, &fa)))
 
603
    {
 
604
      if(*w) Log (1, "%s: invalid FTN address", buf);
591
605
      continue;     /* Do not process if any garbage found */
 
606
    }
592
607
    exp_ftnaddress (&fa);
593
608
    strcpy(buf, w);
594
609
    for(w=buf;(w[0])&&(!isspace(w[0]));w++);
716
731
  memset (w, 0, sizeof (w));
717
732
  i = 0;                               /* index in w[] */
718
733
  j = 2;                               /* number of word in the source string */
719
 
  
 
734
 
720
735
  if(key->option1) /* defnode */
721
736
  {
722
737
          w[i++]=xstrdup("0:0/0.0@defnode");