alias.c (182352) | alias.c (249729) |
---|---|
1/* 2 * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 */ 13 14#include <sendmail.h> 15 | 1/* 2 * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 */ 13 14#include <sendmail.h> 15 |
16SM_RCSID("@(#)$Id: alias.c,v 8.219 2006/10/24 18:04:09 ca Exp $") | 16SM_RCSID("@(#)$Id: alias.c,v 8.220 2013/03/12 15:24:52 ca Exp $") |
17 18#define SEPARATOR ':' 19# define ALIAS_SPEC_SEPARATORS " ,/:" 20 21static MAP *AliasFileMap = NULL; /* the actual aliases.files map */ 22static int NAliasFileMaps; /* the number of entries in AliasFileMap */ 23 24static char *aliaslookup __P((char *, int *, char *)); --- 627 unchanged lines hidden (view full) --- 652 /* 653 ** Read and interpret lines 654 */ 655 656 FileName = map->map_file; 657 LineNumber = 0; 658 naliases = bytes = longest = 0; 659 skipping = false; | 17 18#define SEPARATOR ':' 19# define ALIAS_SPEC_SEPARATORS " ,/:" 20 21static MAP *AliasFileMap = NULL; /* the actual aliases.files map */ 22static int NAliasFileMaps; /* the number of entries in AliasFileMap */ 23 24static char *aliaslookup __P((char *, int *, char *)); --- 627 unchanged lines hidden (view full) --- 652 /* 653 ** Read and interpret lines 654 */ 655 656 FileName = map->map_file; 657 LineNumber = 0; 658 naliases = bytes = longest = 0; 659 skipping = false; |
660 while (sm_io_fgets(af, SM_TIME_DEFAULT, line, sizeof(line)) != NULL) | 660 while (sm_io_fgets(af, SM_TIME_DEFAULT, line, sizeof(line)) >= 0) |
661 { 662 int lhssize, rhssize; 663 int c; 664 665 LineNumber++; 666 p = strchr(line, '\n'); 667 668 /* XXX what if line="a\\" ? */ 669 while (p != NULL && p > line && p[-1] == '\\') 670 { 671 p--; 672 if (sm_io_fgets(af, SM_TIME_DEFAULT, p, | 661 { 662 int lhssize, rhssize; 663 int c; 664 665 LineNumber++; 666 p = strchr(line, '\n'); 667 668 /* XXX what if line="a\\" ? */ 669 while (p != NULL && p > line && p[-1] == '\\') 670 { 671 p--; 672 if (sm_io_fgets(af, SM_TIME_DEFAULT, p, |
673 SPACELEFT(line, p)) == NULL) | 673 SPACELEFT(line, p)) < 0) |
674 break; 675 LineNumber++; 676 p = strchr(p, '\n'); 677 } 678 if (p != NULL) 679 *p = '\0'; 680 else if (!sm_io_eof(af)) 681 { --- 93 unchanged lines hidden (view full) --- 775 c = sm_io_getc(af, SM_TIME_DEFAULT); 776 if (!sm_io_eof(af)) 777 (void) sm_io_ungetc(af, SM_TIME_DEFAULT, c); 778 if (c != ' ' && c != '\t') 779 break; 780 781 /* read continuation line */ 782 if (sm_io_fgets(af, SM_TIME_DEFAULT, p, | 674 break; 675 LineNumber++; 676 p = strchr(p, '\n'); 677 } 678 if (p != NULL) 679 *p = '\0'; 680 else if (!sm_io_eof(af)) 681 { --- 93 unchanged lines hidden (view full) --- 775 c = sm_io_getc(af, SM_TIME_DEFAULT); 776 if (!sm_io_eof(af)) 777 (void) sm_io_ungetc(af, SM_TIME_DEFAULT, c); 778 if (c != ' ' && c != '\t') 779 break; 780 781 /* read continuation line */ 782 if (sm_io_fgets(af, SM_TIME_DEFAULT, p, |
783 sizeof(line) - (p-line)) == NULL) | 783 sizeof(line) - (p-line)) < 0) |
784 break; 785 LineNumber++; 786 787 /* check for line overflow */ 788 if (strchr(p, '\n') == NULL && !sm_io_eof(af)) 789 { 790 usrerr("554 5.3.5 alias too long"); 791 while ((c = sm_io_getc(af, SM_TIME_DEFAULT)) --- 224 unchanged lines hidden --- | 784 break; 785 LineNumber++; 786 787 /* check for line overflow */ 788 if (strchr(p, '\n') == NULL && !sm_io_eof(af)) 789 { 790 usrerr("554 5.3.5 alias too long"); 791 while ((c = sm_io_getc(af, SM_TIME_DEFAULT)) --- 224 unchanged lines hidden --- |