View | Details | Raw Unified | Return to bug 3515
Collapse All | Expand All

(-)a/readconf.c (-28 / +32 lines)
Lines 1554-1590 parse_pubkey_algos: Link Here
1554
	case oPermitRemoteOpen:
1554
	case oPermitRemoteOpen:
1555
		uintptr = &options->num_permitted_remote_opens;
1555
		uintptr = &options->num_permitted_remote_opens;
1556
		cppptr = &options->permitted_remote_opens;
1556
		cppptr = &options->permitted_remote_opens;
1557
		arg = argv_next(&ac, &av);
1558
		if (!arg || *arg == '\0')
1559
			fatal("%s line %d: missing %s specification",
1560
			    filename, linenum, lookup_opcode_name(opcode));
1561
		uvalue = *uintptr;	/* modified later */
1557
		uvalue = *uintptr;	/* modified later */
1562
		if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) {
1558
		i = 0;
1563
			if (*activep && uvalue == 0) {
1564
				*uintptr = 1;
1565
				*cppptr = xcalloc(1, sizeof(**cppptr));
1566
				(*cppptr)[0] = xstrdup(arg);
1567
			}
1568
			break;
1569
		}
1570
		while ((arg = argv_next(&ac, &av)) != NULL) {
1559
		while ((arg = argv_next(&ac, &av)) != NULL) {
1571
			arg2 = xstrdup(arg);
1560
			arg2 = xstrdup(arg);
1572
			p = hpdelim(&arg);
1561
			/* Allow any/none only in first position */
1573
			if (p == NULL) {
1562
			if (strcasecmp(arg, "none") == 0 ||
1574
				fatal("%s line %d: missing host in %s",
1563
			    strcasecmp(arg, "any") == 0) {
1575
				    filename, linenum,
1564
				if (i > 0 || ac > 0) {
1576
				    lookup_opcode_name(opcode));
1565
					error("%s line %d: keyword %s \"%s\" "
1577
			}
1566
					    "argument must appear alone.",
1578
			p = cleanhostname(p);
1567
					    filename, linenum, keyword, arg);
1579
			/*
1568
					goto out;
1580
			 * don't want to use permitopen_port to avoid
1569
				}
1581
			 * dependency on channels.[ch] here.
1570
			} else {
1582
			 */
1571
				p = hpdelim(&arg);
1583
			if (arg == NULL ||
1572
				if (p == NULL) {
1584
			    (strcmp(arg, "*") != 0 && a2port(arg) <= 0)) {
1573
					fatal("%s line %d: missing host in %s",
1585
				fatal("%s line %d: bad port number in %s",
1574
					    filename, linenum,
1586
				    filename, linenum,
1575
					    lookup_opcode_name(opcode));
1587
				    lookup_opcode_name(opcode));
1576
				}
1577
				p = cleanhostname(p);
1578
				/*
1579
				 * don't want to use permitopen_port to avoid
1580
				 * dependency on channels.[ch] here.
1581
				 */
1582
				if (arg == NULL || (strcmp(arg, "*") != 0 &&
1583
				    a2port(arg) <= 0)) {
1584
					fatal("%s line %d: bad port number "
1585
					    "in %s", filename, linenum,
1586
					    lookup_opcode_name(opcode));
1587
				}
1588
			}
1588
			}
1589
			if (*activep && uvalue == 0) {
1589
			if (*activep && uvalue == 0) {
1590
				opt_array_append(filename, linenum,
1590
				opt_array_append(filename, linenum,
Lines 1592-1598 parse_pubkey_algos: Link Here
1592
				    cppptr, uintptr, arg2);
1592
				    cppptr, uintptr, arg2);
1593
			}
1593
			}
1594
			free(arg2);
1594
			free(arg2);
1595
			i++;
1595
		}
1596
		}
1597
		if (i == 0)
1598
			fatal("%s line %d: missing %s specification",
1599
			    filename, linenum, lookup_opcode_name(opcode));
1596
		break;
1600
		break;
1597
1601
1598
	case oClearAllForwardings:
1602
	case oClearAllForwardings:

Return to bug 3515