|
10 | 10 | *
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.101 2003/06/12 02:12:58 momjian Exp $ |
| 13 | + * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.102 2003/06/12 07:00:57 momjian Exp $ |
14 | 14 | *
|
15 | 15 | *-------------------------------------------------------------------------
|
16 | 16 | */
|
@@ -588,7 +588,6 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
|
588 | 588 | else if (strcmp(token, "host") == 0 || strcmp(token, "hostssl") == 0)
|
589 | 589 | {
|
590 | 590 | SockAddr file_ip_addr, mask;
|
591 |
| - char * cidr_slash; |
592 | 591 |
|
593 | 592 | if (strcmp(token, "hostssl") == 0)
|
594 | 593 | {
|
@@ -619,48 +618,26 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
|
619 | 618 | goto hba_syntax;
|
620 | 619 | user = lfirst(line);
|
621 | 620 |
|
622 |
| - /* Read the IP address field. (with or without CIDR netmask) */ |
| 621 | + /* Read the IP address field. */ |
623 | 622 | line = lnext(line);
|
624 | 623 | if (!line)
|
625 | 624 | goto hba_syntax;
|
626 | 625 | token = lfirst(line);
|
627 | 626 |
|
628 |
| - /* Check if it has a CIDR suffix and if so isolate it */ |
629 |
| - cidr_slash = strchr(token,'/'); |
630 |
| - if (cidr_slash) |
631 |
| - *cidr_slash = '\0'; |
632 |
| - |
633 |
| - /* Get the IP address either way */ |
634 | 627 | if(SockAddr_pton(&file_ip_addr, token) < 0)
|
635 |
| - { |
636 |
| - if (cidr_slash) |
637 |
| - *cidr_slash = '/'; |
638 | 628 | goto hba_syntax;
|
639 |
| - } |
640 |
| - |
641 |
| - /* Get the netmask */ |
642 |
| - if (cidr_slash) |
643 |
| - { |
644 |
| - *cidr_slash = '/'; |
645 |
| - if (SockAddr_cidr_mask(&mask, ++cidr_slash, file_ip_addr.sa.sa_family) < 0) |
646 |
| - goto hba_syntax; |
647 |
| - } |
648 |
| - else |
649 |
| - { |
650 |
| - /* Read the mask field. */ |
651 |
| - line = lnext(line); |
652 |
| - if (!line) |
653 |
| - goto hba_syntax; |
654 |
| - token = lfirst(line); |
655 | 629 |
|
656 |
| - if(SockAddr_pton(&mask, token) < 0) |
657 |
| - goto hba_syntax; |
658 |
| - |
659 |
| - if(file_ip_addr.sa.sa_family != mask.sa.sa_family) |
660 |
| - goto hba_syntax; |
661 |
| - } |
| 630 | + /* Read the mask field. */ |
| 631 | + line = lnext(line); |
| 632 | + if (!line) |
| 633 | + goto hba_syntax; |
| 634 | + token = lfirst(line); |
662 | 635 |
|
| 636 | + if(SockAddr_pton(&mask, token) < 0) |
| 637 | + goto hba_syntax; |
663 | 638 |
|
| 639 | + if(file_ip_addr.sa.sa_family != mask.sa.sa_family) |
| 640 | + goto hba_syntax; |
664 | 641 |
|
665 | 642 | /* Read the rest of the line. */
|
666 | 643 | line = lnext(line);
|
|
0 commit comments