diff --git a/cfg.c b/cfg.c index caf4242..7af690c 100644 --- a/cfg.c +++ b/cfg.c @@ -16,9 +16,16 @@ #include "sockd.h" #include "nk/log.h" #include "nk/privs.h" -#include "nk/copy_cmdarg.h" #include "nk/io.h" +static void copy_cmdarg(char *dest, const char *src, +size_t destlen, const char *argname) +{ + ssize_t olen = snprintf(dest, destlen, "%s", src); + if (olen < 0 || (size_t)olen > destlen) + suicide("snprintf failed on %s", argname); +} + struct cfgparse { char buf[MAX_BUF]; size_t buflen; @@ -27,15 +34,15 @@ struct cfgparse { }; -#line 161 "cfg.rl" +#line 168 "cfg.rl" -#line 210 "cfg.rl" +#line 217 "cfg.rl" -#line 39 "cfg.c" +#line 46 "cfg.c" static const int file_cfg_start = 1; static const int file_cfg_first_final = 291; static const int file_cfg_error = 0; @@ -43,7 +50,7 @@ static const int file_cfg_error = 0; static const int file_cfg_en_main = 1; -#line 212 "cfg.rl" +#line 219 "cfg.rl" static void parse_cfgfile(const char *fname) @@ -78,15 +85,15 @@ static void parse_cfgfile(const char *fname) const char *p = l + lstart; const char *pe = l + lstart + llen + 1; -#line 82 "cfg.c" +#line 89 "cfg.c" { ccfg.cs = (int)file_cfg_start; } -#line 245 "cfg.rl" +#line 252 "cfg.rl" -#line 90 "cfg.c" +#line 97 "cfg.c" { switch ( ccfg.cs ) { case 1: @@ -722,16 +729,16 @@ static void parse_cfgfile(const char *fname) goto _out0; _ctr34: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 732 "cfg.c" +#line 739 "cfg.c" { -#line 120 "cfg.rl" +#line 127 "cfg.rl" int t = atoi(ccfg.buf); arp_probe_max = t; @@ -742,21 +749,21 @@ static void parse_cfgfile(const char *fname) } } -#line 746 "cfg.c" +#line 753 "cfg.c" goto _st291; _ctr42: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 757 "cfg.c" +#line 764 "cfg.c" { -#line 111 "cfg.rl" +#line 118 "cfg.rl" int t = atoi(ccfg.buf); arp_probe_min = t; @@ -767,96 +774,96 @@ static void parse_cfgfile(const char *fname) } } -#line 771 "cfg.c" +#line 778 "cfg.c" goto _st291; _ctr51: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 782 "cfg.c" +#line 789 "cfg.c" { -#line 106 "cfg.rl" +#line 113 "cfg.rl" int t = atoi(ccfg.buf); if (t >= 0) arp_probe_num = t; } -#line 792 "cfg.c" +#line 799 "cfg.c" goto _st291; _ctr61: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 803 "cfg.c" +#line 810 "cfg.c" { -#line 101 "cfg.rl" +#line 108 "cfg.rl" int t = atoi(ccfg.buf); if (t >= 0) arp_probe_wait = t; } -#line 813 "cfg.c" +#line 820 "cfg.c" goto _st291; _ctr74: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 824 "cfg.c" +#line 831 "cfg.c" { -#line 82 "cfg.rl" +#line 89 "cfg.rl" copy_cmdarg(chroot_dir, ccfg.buf, sizeof chroot_dir, "chroot"); } -#line 832 "cfg.c" +#line 839 "cfg.c" goto _st291; _ctr87: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 843 "cfg.c" +#line 850 "cfg.c" { -#line 50 "cfg.rl" +#line 57 "cfg.rl" get_clientid_string(ccfg.buf, ccfg.buflen); } -#line 849 "cfg.c" +#line 856 "cfg.c" goto _st291; _ctr110: { -#line 48 "cfg.rl" +#line 55 "cfg.rl" ccfg.ternary = -1; } -#line 857 "cfg.c" +#line 864 "cfg.c" { -#line 144 "cfg.rl" +#line 151 "cfg.rl" switch (ccfg.ternary) { case 1: allow_hostname = 1; break; @@ -864,18 +871,18 @@ static void parse_cfgfile(const char *fname) } } -#line 868 "cfg.c" +#line 875 "cfg.c" goto _st291; _ctr111: { -#line 47 "cfg.rl" +#line 54 "cfg.rl" ccfg.ternary = 1; } -#line 876 "cfg.c" +#line 883 "cfg.c" { -#line 144 "cfg.rl" +#line 151 "cfg.rl" switch (ccfg.ternary) { case 1: allow_hostname = 1; break; @@ -883,21 +890,21 @@ static void parse_cfgfile(const char *fname) } } -#line 887 "cfg.c" +#line 894 "cfg.c" goto _st291; _ctr130: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 898 "cfg.c" +#line 905 "cfg.c" { -#line 129 "cfg.rl" +#line 136 "cfg.rl" char *q; long mt = strtol(ccfg.buf, &q, 10); @@ -910,78 +917,78 @@ static void parse_cfgfile(const char *fname) client_config.metric = (int)mt; } -#line 914 "cfg.c" +#line 921 "cfg.c" goto _st291; _ctr144: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 925 "cfg.c" +#line 932 "cfg.c" { -#line 51 "cfg.rl" +#line 58 "cfg.rl" copy_cmdarg(client_config.hostname, ccfg.buf, sizeof client_config.hostname, "hostname"); } -#line 934 "cfg.c" +#line 941 "cfg.c" goto _st291; _ctr160: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 945 "cfg.c" +#line 952 "cfg.c" { -#line 74 "cfg.rl" +#line 81 "cfg.rl" if (nk_uidgidbyname(ccfg.buf, &ifch_uid, &ifch_gid)) suicide("invalid ifch user '%s' specified", ccfg.buf); } -#line 954 "cfg.c" +#line 961 "cfg.c" goto _st291; _ctr174: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 965 "cfg.c" +#line 972 "cfg.c" { -#line 55 "cfg.rl" +#line 62 "cfg.rl" copy_cmdarg(client_config.interface, ccfg.buf, sizeof client_config.interface, "interface"); } -#line 974 "cfg.c" +#line 981 "cfg.c" goto _st291; _ctr183: { -#line 48 "cfg.rl" +#line 55 "cfg.rl" ccfg.ternary = -1; } -#line 982 "cfg.c" +#line 989 "cfg.c" { -#line 59 "cfg.rl" +#line 66 "cfg.rl" switch (ccfg.ternary) { case 1: client_config.abort_if_no_lease = true; break; @@ -989,18 +996,18 @@ static void parse_cfgfile(const char *fname) } } -#line 993 "cfg.c" +#line 1000 "cfg.c" goto _st291; _ctr184: { -#line 47 "cfg.rl" +#line 54 "cfg.rl" ccfg.ternary = 1; } -#line 1001 "cfg.c" +#line 1008 "cfg.c" { -#line 59 "cfg.rl" +#line 66 "cfg.rl" switch (ccfg.ternary) { case 1: client_config.abort_if_no_lease = true; break; @@ -1008,18 +1015,18 @@ static void parse_cfgfile(const char *fname) } } -#line 1012 "cfg.c" +#line 1019 "cfg.c" goto _st291; _ctr215: { -#line 48 "cfg.rl" +#line 55 "cfg.rl" ccfg.ternary = -1; } -#line 1020 "cfg.c" +#line 1027 "cfg.c" { -#line 95 "cfg.rl" +#line 102 "cfg.rl" switch (ccfg.ternary) { case 1: set_arp_relentless_def(true); break; @@ -1027,18 +1034,18 @@ static void parse_cfgfile(const char *fname) } } -#line 1031 "cfg.c" +#line 1038 "cfg.c" goto _st291; _ctr216: { -#line 47 "cfg.rl" +#line 54 "cfg.rl" ccfg.ternary = 1; } -#line 1039 "cfg.c" +#line 1046 "cfg.c" { -#line 95 "cfg.rl" +#line 102 "cfg.rl" switch (ccfg.ternary) { case 1: set_arp_relentless_def(true); break; @@ -1046,217 +1053,217 @@ static void parse_cfgfile(const char *fname) } } -#line 1050 "cfg.c" +#line 1057 "cfg.c" goto _st291; _ctr231: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1061 "cfg.c" +#line 1068 "cfg.c" { -#line 65 "cfg.rl" +#line 72 "cfg.rl" set_client_addr(ccfg.buf); } -#line 1067 "cfg.c" +#line 1074 "cfg.c" goto _st291; _ctr246: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1078 "cfg.c" +#line 1085 "cfg.c" { -#line 140 "cfg.rl" +#line 147 "cfg.rl" copy_cmdarg(resolv_conf_d, ccfg.buf, sizeof resolv_conf_d, "resolv-conf"); } -#line 1087 "cfg.c" +#line 1094 "cfg.c" goto _st291; _ctr261: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1098 "cfg.c" +#line 1105 "cfg.c" { -#line 150 "cfg.rl" +#line 157 "cfg.rl" uint32_t t = (uint32_t)atoi(ccfg.buf); client_config.rfkillIdx = t; client_config.enable_rfkill = true; } -#line 1108 "cfg.c" +#line 1115 "cfg.c" goto _st291; _ctr280: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1119 "cfg.c" +#line 1126 "cfg.c" { -#line 155 "cfg.rl" +#line 162 "cfg.rl" client_config.s6_notify_fd = atoi(ccfg.buf); client_config.enable_s6_notify = true; } -#line 1128 "cfg.c" +#line 1135 "cfg.c" goto _st291; _ctr296: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1139 "cfg.c" +#line 1146 "cfg.c" { -#line 88 "cfg.rl" +#line 95 "cfg.rl" copy_cmdarg(script_file, ccfg.buf, sizeof script_file, "script-file"); } -#line 1147 "cfg.c" +#line 1154 "cfg.c" goto _st291; _ctr316: { -#line 48 "cfg.rl" +#line 55 "cfg.rl" ccfg.ternary = -1; } -#line 1155 "cfg.c" +#line 1162 "cfg.c" { -#line 91 "cfg.rl" +#line 98 "cfg.rl" log_line("seccomp_enforce option is deprecated; please remove it"); log_line("In the meanwhile, it is ignored and seccomp is disabled."); } -#line 1164 "cfg.c" +#line 1171 "cfg.c" goto _st291; _ctr317: { -#line 47 "cfg.rl" +#line 54 "cfg.rl" ccfg.ternary = 1; } -#line 1172 "cfg.c" +#line 1179 "cfg.c" { -#line 91 "cfg.rl" +#line 98 "cfg.rl" log_line("seccomp_enforce option is deprecated; please remove it"); log_line("In the meanwhile, it is ignored and seccomp is disabled."); } -#line 1181 "cfg.c" +#line 1188 "cfg.c" goto _st291; _ctr336: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1192 "cfg.c" +#line 1199 "cfg.c" { -#line 78 "cfg.rl" +#line 85 "cfg.rl" if (nk_uidgidbyname(ccfg.buf, &sockd_uid, &sockd_gid)) suicide("invalid sockd user '%s' specified", ccfg.buf); } -#line 1201 "cfg.c" +#line 1208 "cfg.c" goto _st291; _ctr350: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1212 "cfg.c" +#line 1219 "cfg.c" { -#line 85 "cfg.rl" +#line 92 "cfg.rl" copy_cmdarg(state_dir, ccfg.buf, sizeof state_dir, "state-dir"); } -#line 1220 "cfg.c" +#line 1227 "cfg.c" goto _st291; _ctr360: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1231 "cfg.c" +#line 1238 "cfg.c" { -#line 70 "cfg.rl" +#line 77 "cfg.rl" if (nk_uidgidbyname(ccfg.buf, &ndhc_uid, &ndhc_gid)) suicide("invalid ndhc user '%s' specified", ccfg.buf); } -#line 1240 "cfg.c" +#line 1247 "cfg.c" goto _st291; _ctr374: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 1251 "cfg.c" +#line 1258 "cfg.c" { -#line 66 "cfg.rl" +#line 73 "cfg.rl" copy_cmdarg(client_config.vendor, ccfg.buf, sizeof client_config.vendor, "vendorid"); } -#line 1260 "cfg.c" +#line 1267 "cfg.c" goto _st291; _st291: @@ -1422,17 +1429,17 @@ static void parse_cfgfile(const char *fname) goto _ctr30; _ctr30: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1433 "cfg.c" +#line 1440 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1440,12 +1447,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1444 "cfg.c" +#line 1451 "cfg.c" goto _st16; _ctr33: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1453,7 +1460,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1457 "cfg.c" +#line 1464 "cfg.c" goto _st16; _st16: @@ -1467,17 +1474,17 @@ static void parse_cfgfile(const char *fname) goto _ctr33; _ctr31: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1478 "cfg.c" +#line 1485 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1485,7 +1492,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1489 "cfg.c" +#line 1496 "cfg.c" goto _st17; _st17: @@ -1550,17 +1557,17 @@ static void parse_cfgfile(const char *fname) goto _ctr38; _ctr38: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1561 "cfg.c" +#line 1568 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1568,12 +1575,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1572 "cfg.c" +#line 1579 "cfg.c" goto _st21; _ctr41: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1581,7 +1588,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1585 "cfg.c" +#line 1592 "cfg.c" goto _st21; _st21: @@ -1595,17 +1602,17 @@ static void parse_cfgfile(const char *fname) goto _ctr41; _ctr39: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1606 "cfg.c" +#line 1613 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1613,7 +1620,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1617 "cfg.c" +#line 1624 "cfg.c" goto _st22; _st22: @@ -1687,17 +1694,17 @@ static void parse_cfgfile(const char *fname) goto _ctr47; _ctr47: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1698 "cfg.c" +#line 1705 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1705,12 +1712,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1709 "cfg.c" +#line 1716 "cfg.c" goto _st27; _ctr50: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1718,7 +1725,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1722 "cfg.c" +#line 1729 "cfg.c" goto _st27; _st27: @@ -1732,17 +1739,17 @@ static void parse_cfgfile(const char *fname) goto _ctr50; _ctr48: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1743 "cfg.c" +#line 1750 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1750,7 +1757,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1754 "cfg.c" +#line 1761 "cfg.c" goto _st28; _st28: @@ -1833,17 +1840,17 @@ static void parse_cfgfile(const char *fname) goto _ctr57; _ctr57: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1844 "cfg.c" +#line 1851 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1851,12 +1858,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1855 "cfg.c" +#line 1862 "cfg.c" goto _st34; _ctr60: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1864,7 +1871,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1868 "cfg.c" +#line 1875 "cfg.c" goto _st34; _st34: @@ -1878,17 +1885,17 @@ static void parse_cfgfile(const char *fname) goto _ctr60; _ctr58: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 1889 "cfg.c" +#line 1896 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -1896,7 +1903,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 1900 "cfg.c" +#line 1907 "cfg.c" goto _st35; _st35: @@ -2002,17 +2009,17 @@ static void parse_cfgfile(const char *fname) goto _ctr70; _ctr70: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2013 "cfg.c" +#line 2020 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2020,12 +2027,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2024 "cfg.c" +#line 2031 "cfg.c" goto _st43; _ctr73: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2033,7 +2040,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2037 "cfg.c" +#line 2044 "cfg.c" goto _st43; _st43: @@ -2047,17 +2054,17 @@ static void parse_cfgfile(const char *fname) goto _ctr73; _ctr71: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2058 "cfg.c" +#line 2065 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2065,7 +2072,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2069 "cfg.c" +#line 2076 "cfg.c" goto _st44; _st44: @@ -2175,17 +2182,17 @@ static void parse_cfgfile(const char *fname) goto _ctr83; _ctr83: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2186 "cfg.c" +#line 2193 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2193,12 +2200,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2197 "cfg.c" +#line 2204 "cfg.c" goto _st53; _ctr86: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2206,7 +2213,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2210 "cfg.c" +#line 2217 "cfg.c" goto _st53; _st53: @@ -2220,17 +2227,17 @@ static void parse_cfgfile(const char *fname) goto _ctr86; _ctr84: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2231 "cfg.c" +#line 2238 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2238,7 +2245,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2242 "cfg.c" +#line 2249 "cfg.c" goto _st54; _st54: @@ -2634,17 +2641,17 @@ static void parse_cfgfile(const char *fname) goto _ctr126; _ctr126: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2645 "cfg.c" +#line 2652 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2652,12 +2659,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2656 "cfg.c" +#line 2663 "cfg.c" goto _st92; _ctr129: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2665,7 +2672,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2669 "cfg.c" +#line 2676 "cfg.c" goto _st92; _st92: @@ -2679,17 +2686,17 @@ static void parse_cfgfile(const char *fname) goto _ctr129; _ctr127: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2690 "cfg.c" +#line 2697 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2697,7 +2704,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2701 "cfg.c" +#line 2708 "cfg.c" goto _st93; _st93: @@ -2816,17 +2823,17 @@ static void parse_cfgfile(const char *fname) goto _ctr140; _ctr140: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2827 "cfg.c" +#line 2834 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2834,12 +2841,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2838 "cfg.c" +#line 2845 "cfg.c" goto _st103; _ctr143: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2847,7 +2854,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2851 "cfg.c" +#line 2858 "cfg.c" goto _st103; _st103: @@ -2861,17 +2868,17 @@ static void parse_cfgfile(const char *fname) goto _ctr143; _ctr141: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 2872 "cfg.c" +#line 2879 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -2879,7 +2886,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 2883 "cfg.c" +#line 2890 "cfg.c" goto _st104; _st104: @@ -3012,17 +3019,17 @@ static void parse_cfgfile(const char *fname) goto _ctr156; _ctr156: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3023 "cfg.c" +#line 3030 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3030,12 +3037,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3034 "cfg.c" +#line 3041 "cfg.c" goto _st115; _ctr159: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3043,7 +3050,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3047 "cfg.c" +#line 3054 "cfg.c" goto _st115; _st115: @@ -3057,17 +3064,17 @@ static void parse_cfgfile(const char *fname) goto _ctr159; _ctr157: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3068 "cfg.c" +#line 3075 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3075,7 +3082,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3079 "cfg.c" +#line 3086 "cfg.c" goto _st116; _st116: @@ -3194,17 +3201,17 @@ static void parse_cfgfile(const char *fname) goto _ctr170; _ctr170: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3205 "cfg.c" +#line 3212 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3212,12 +3219,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3216 "cfg.c" +#line 3223 "cfg.c" goto _st126; _ctr173: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3225,7 +3232,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3229 "cfg.c" +#line 3236 "cfg.c" goto _st126; _st126: @@ -3239,17 +3246,17 @@ static void parse_cfgfile(const char *fname) goto _ctr173; _ctr171: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3250 "cfg.c" +#line 3257 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3257,7 +3264,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3261 "cfg.c" +#line 3268 "cfg.c" goto _st127; _st127: @@ -3781,17 +3788,17 @@ static void parse_cfgfile(const char *fname) goto _ctr227; _ctr227: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3792 "cfg.c" +#line 3799 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3799,12 +3806,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3803 "cfg.c" +#line 3810 "cfg.c" goto _st175; _ctr230: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3812,7 +3819,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3816 "cfg.c" +#line 3823 "cfg.c" goto _st175; _st175: @@ -3826,17 +3833,17 @@ static void parse_cfgfile(const char *fname) goto _ctr230; _ctr228: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3837 "cfg.c" +#line 3844 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3844,7 +3851,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3848 "cfg.c" +#line 3855 "cfg.c" goto _st176; _st176: @@ -3972,17 +3979,17 @@ static void parse_cfgfile(const char *fname) goto _ctr242; _ctr242: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 3983 "cfg.c" +#line 3990 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -3990,12 +3997,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 3994 "cfg.c" +#line 4001 "cfg.c" goto _st187; _ctr245: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4003,7 +4010,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4007 "cfg.c" +#line 4014 "cfg.c" goto _st187; _st187: @@ -4017,17 +4024,17 @@ static void parse_cfgfile(const char *fname) goto _ctr245; _ctr243: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4028 "cfg.c" +#line 4035 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4035,7 +4042,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4039 "cfg.c" +#line 4046 "cfg.c" goto _st188; _st188: @@ -4163,17 +4170,17 @@ static void parse_cfgfile(const char *fname) goto _ctr257; _ctr257: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4174 "cfg.c" +#line 4181 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4181,12 +4188,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4185 "cfg.c" +#line 4192 "cfg.c" goto _st199; _ctr260: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4194,7 +4201,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4198 "cfg.c" +#line 4205 "cfg.c" goto _st199; _st199: @@ -4208,17 +4215,17 @@ static void parse_cfgfile(const char *fname) goto _ctr260; _ctr258: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4219 "cfg.c" +#line 4226 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4226,7 +4233,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4230 "cfg.c" +#line 4237 "cfg.c" goto _st200; _st200: @@ -4368,17 +4375,17 @@ static void parse_cfgfile(const char *fname) goto _ctr276; _ctr276: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4379 "cfg.c" +#line 4386 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4386,12 +4393,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4390 "cfg.c" +#line 4397 "cfg.c" goto _st211; _ctr279: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4399,7 +4406,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4403 "cfg.c" +#line 4410 "cfg.c" goto _st211; _st211: @@ -4413,17 +4420,17 @@ static void parse_cfgfile(const char *fname) goto _ctr279; _ctr277: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4424 "cfg.c" +#line 4431 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4431,7 +4438,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4435 "cfg.c" +#line 4442 "cfg.c" goto _st212; _st212: @@ -4568,17 +4575,17 @@ static void parse_cfgfile(const char *fname) goto _ctr292; _ctr292: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4579 "cfg.c" +#line 4586 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4586,12 +4593,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4590 "cfg.c" +#line 4597 "cfg.c" goto _st224; _ctr295: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4599,7 +4606,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4603 "cfg.c" +#line 4610 "cfg.c" goto _st224; _st224: @@ -4613,17 +4620,17 @@ static void parse_cfgfile(const char *fname) goto _ctr295; _ctr293: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 4624 "cfg.c" +#line 4631 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -4631,7 +4638,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 4635 "cfg.c" +#line 4642 "cfg.c" goto _st225; _st225: @@ -5000,17 +5007,17 @@ static void parse_cfgfile(const char *fname) goto _ctr332; _ctr332: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5011 "cfg.c" +#line 5018 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5018,12 +5025,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5022 "cfg.c" +#line 5029 "cfg.c" goto _st260; _ctr335: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5031,7 +5038,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5035 "cfg.c" +#line 5042 "cfg.c" goto _st260; _st260: @@ -5045,17 +5052,17 @@ static void parse_cfgfile(const char *fname) goto _ctr335; _ctr333: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5056 "cfg.c" +#line 5063 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5063,7 +5070,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5067 "cfg.c" +#line 5074 "cfg.c" goto _st261; _st261: @@ -5182,17 +5189,17 @@ static void parse_cfgfile(const char *fname) goto _ctr346; _ctr346: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5193 "cfg.c" +#line 5200 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5200,12 +5207,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5204 "cfg.c" +#line 5211 "cfg.c" goto _st271; _ctr349: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5213,7 +5220,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5217 "cfg.c" +#line 5224 "cfg.c" goto _st271; _st271: @@ -5227,17 +5234,17 @@ static void parse_cfgfile(const char *fname) goto _ctr349; _ctr347: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5238 "cfg.c" +#line 5245 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5245,7 +5252,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5249 "cfg.c" +#line 5256 "cfg.c" goto _st272; _st272: @@ -5328,17 +5335,17 @@ static void parse_cfgfile(const char *fname) goto _ctr356; _ctr356: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5339 "cfg.c" +#line 5346 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5346,12 +5353,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5350 "cfg.c" +#line 5357 "cfg.c" goto _st278; _ctr359: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5359,7 +5366,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5363 "cfg.c" +#line 5370 "cfg.c" goto _st278; _st278: @@ -5373,17 +5380,17 @@ static void parse_cfgfile(const char *fname) goto _ctr359; _ctr357: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5384 "cfg.c" +#line 5391 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5391,7 +5398,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5395 "cfg.c" +#line 5402 "cfg.c" goto _st279; _st279: @@ -5510,17 +5517,17 @@ static void parse_cfgfile(const char *fname) goto _ctr370; _ctr370: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5521 "cfg.c" +#line 5528 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5528,12 +5535,12 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5532 "cfg.c" +#line 5539 "cfg.c" goto _st289; _ctr373: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5541,7 +5548,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5545 "cfg.c" +#line 5552 "cfg.c" goto _st289; _st289: @@ -5555,17 +5562,17 @@ static void parse_cfgfile(const char *fname) goto _ctr373; _ctr371: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 5566 "cfg.c" +#line 5573 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -5573,7 +5580,7 @@ static void parse_cfgfile(const char *fname) suicide("line or option is too long"); } -#line 5577 "cfg.c" +#line 5584 "cfg.c" goto _st290; _st290: @@ -5888,7 +5895,7 @@ static void parse_cfgfile(const char *fname) _out: {} } -#line 246 "cfg.rl" +#line 253 "cfg.rl" if (ccfg.cs == file_cfg_error) @@ -5914,11 +5921,11 @@ static void parse_cfgfile(const char *fname) } -#line 316 "cfg.rl" +#line 323 "cfg.rl" -#line 5922 "cfg.c" +#line 5929 "cfg.c" static const int cmd_cfg_start = 248; static const int cmd_cfg_first_final = 248; static const int cmd_cfg_error = 0; @@ -5926,7 +5933,7 @@ static const int cmd_cfg_error = 0; static const int cmd_cfg_en_main = 248; -#line 318 "cfg.rl" +#line 325 "cfg.rl" void parse_cmdline(int argc, char *argv[]) @@ -5953,15 +5960,15 @@ void parse_cmdline(int argc, char *argv[]) const char *eof = pe; -#line 5957 "cfg.c" +#line 5964 "cfg.c" { ccfg.cs = (int)cmd_cfg_start; } -#line 343 "cfg.rl" +#line 350 "cfg.rl" -#line 5965 "cfg.c" +#line 5972 "cfg.c" { switch ( ccfg.cs ) { case 248: @@ -6467,16 +6474,16 @@ void parse_cmdline(int argc, char *argv[]) } _ctr58: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6477 "cfg.c" +#line 6484 "cfg.c" { -#line 120 "cfg.rl" +#line 127 "cfg.rl" int t = atoi(ccfg.buf); arp_probe_max = t; @@ -6487,21 +6494,21 @@ void parse_cmdline(int argc, char *argv[]) } } -#line 6491 "cfg.c" +#line 6498 "cfg.c" goto _st248; _ctr63: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6502 "cfg.c" +#line 6509 "cfg.c" { -#line 111 "cfg.rl" +#line 118 "cfg.rl" int t = atoi(ccfg.buf); arp_probe_min = t; @@ -6512,116 +6519,116 @@ void parse_cmdline(int argc, char *argv[]) } } -#line 6516 "cfg.c" +#line 6523 "cfg.c" goto _st248; _ctr69: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6527 "cfg.c" +#line 6534 "cfg.c" { -#line 106 "cfg.rl" +#line 113 "cfg.rl" int t = atoi(ccfg.buf); if (t >= 0) arp_probe_num = t; } -#line 6537 "cfg.c" +#line 6544 "cfg.c" goto _st248; _ctr76: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6548 "cfg.c" +#line 6555 "cfg.c" { -#line 101 "cfg.rl" +#line 108 "cfg.rl" int t = atoi(ccfg.buf); if (t >= 0) arp_probe_wait = t; } -#line 6558 "cfg.c" +#line 6565 "cfg.c" goto _st248; _ctr87: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6569 "cfg.c" +#line 6576 "cfg.c" { -#line 82 "cfg.rl" +#line 89 "cfg.rl" copy_cmdarg(chroot_dir, ccfg.buf, sizeof chroot_dir, "chroot"); } -#line 6577 "cfg.c" +#line 6584 "cfg.c" goto _st248; _ctr97: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6588 "cfg.c" +#line 6595 "cfg.c" { -#line 50 "cfg.rl" +#line 57 "cfg.rl" get_clientid_string(ccfg.buf, ccfg.buflen); } -#line 6594 "cfg.c" +#line 6601 "cfg.c" goto _st248; _ctr105: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6605 "cfg.c" +#line 6612 "cfg.c" { -#line 275 "cfg.rl" +#line 282 "cfg.rl" parse_cfgfile(ccfg.buf); } -#line 6611 "cfg.c" +#line 6618 "cfg.c" goto _st248; _ctr133: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6622 "cfg.c" +#line 6629 "cfg.c" { -#line 129 "cfg.rl" +#line 136 "cfg.rl" char *q; long mt = strtol(ccfg.buf, &q, 10); @@ -6634,259 +6641,259 @@ void parse_cmdline(int argc, char *argv[]) client_config.metric = (int)mt; } -#line 6638 "cfg.c" +#line 6645 "cfg.c" goto _st248; _ctr137: { -#line 160 "cfg.rl" +#line 167 "cfg.rl" show_usage(); exit(EXIT_SUCCESS); } -#line 6646 "cfg.c" +#line 6653 "cfg.c" goto _st248; _ctr147: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6657 "cfg.c" +#line 6664 "cfg.c" { -#line 51 "cfg.rl" +#line 58 "cfg.rl" copy_cmdarg(client_config.hostname, ccfg.buf, sizeof client_config.hostname, "hostname"); } -#line 6666 "cfg.c" +#line 6673 "cfg.c" goto _st248; _ctr160: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6677 "cfg.c" +#line 6684 "cfg.c" { -#line 74 "cfg.rl" +#line 81 "cfg.rl" if (nk_uidgidbyname(ccfg.buf, &ifch_uid, &ifch_gid)) suicide("invalid ifch user '%s' specified", ccfg.buf); } -#line 6686 "cfg.c" +#line 6693 "cfg.c" goto _st248; _ctr171: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6697 "cfg.c" +#line 6704 "cfg.c" { -#line 55 "cfg.rl" +#line 62 "cfg.rl" copy_cmdarg(client_config.interface, ccfg.buf, sizeof client_config.interface, "interface"); } -#line 6706 "cfg.c" +#line 6713 "cfg.c" goto _st248; _ctr201: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6717 "cfg.c" +#line 6724 "cfg.c" { -#line 65 "cfg.rl" +#line 72 "cfg.rl" set_client_addr(ccfg.buf); } -#line 6723 "cfg.c" +#line 6730 "cfg.c" goto _st248; _ctr213: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6734 "cfg.c" +#line 6741 "cfg.c" { -#line 140 "cfg.rl" +#line 147 "cfg.rl" copy_cmdarg(resolv_conf_d, ccfg.buf, sizeof resolv_conf_d, "resolv-conf"); } -#line 6743 "cfg.c" +#line 6750 "cfg.c" goto _st248; _ctr225: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6754 "cfg.c" +#line 6761 "cfg.c" { -#line 150 "cfg.rl" +#line 157 "cfg.rl" uint32_t t = (uint32_t)atoi(ccfg.buf); client_config.rfkillIdx = t; client_config.enable_rfkill = true; } -#line 6764 "cfg.c" +#line 6771 "cfg.c" goto _st248; _ctr241: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6775 "cfg.c" +#line 6782 "cfg.c" { -#line 155 "cfg.rl" +#line 162 "cfg.rl" client_config.s6_notify_fd = atoi(ccfg.buf); client_config.enable_s6_notify = true; } -#line 6784 "cfg.c" +#line 6791 "cfg.c" goto _st248; _ctr254: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6795 "cfg.c" +#line 6802 "cfg.c" { -#line 88 "cfg.rl" +#line 95 "cfg.rl" copy_cmdarg(script_file, ccfg.buf, sizeof script_file, "script-file"); } -#line 6803 "cfg.c" +#line 6810 "cfg.c" goto _st248; _ctr279: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6814 "cfg.c" +#line 6821 "cfg.c" { -#line 78 "cfg.rl" +#line 85 "cfg.rl" if (nk_uidgidbyname(ccfg.buf, &sockd_uid, &sockd_gid)) suicide("invalid sockd user '%s' specified", ccfg.buf); } -#line 6823 "cfg.c" +#line 6830 "cfg.c" goto _st248; _ctr290: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6834 "cfg.c" +#line 6841 "cfg.c" { -#line 85 "cfg.rl" +#line 92 "cfg.rl" copy_cmdarg(state_dir, ccfg.buf, sizeof state_dir, "state-dir"); } -#line 6842 "cfg.c" +#line 6849 "cfg.c" goto _st248; _ctr297: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6853 "cfg.c" +#line 6860 "cfg.c" { -#line 70 "cfg.rl" +#line 77 "cfg.rl" if (nk_uidgidbyname(ccfg.buf, &ndhc_uid, &ndhc_gid)) suicide("invalid ndhc user '%s' specified", ccfg.buf); } -#line 6862 "cfg.c" +#line 6869 "cfg.c" goto _st248; _ctr309: { -#line 43 "cfg.rl" +#line 50 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf) ccfg.buf[ccfg.buflen] = 0; } -#line 6873 "cfg.c" +#line 6880 "cfg.c" { -#line 66 "cfg.rl" +#line 73 "cfg.rl" copy_cmdarg(client_config.vendor, ccfg.buf, sizeof client_config.vendor, "vendorid"); } -#line 6882 "cfg.c" +#line 6889 "cfg.c" goto _st248; _ctr313: { -#line 159 "cfg.rl" +#line 166 "cfg.rl" print_version(); exit(EXIT_SUCCESS); } -#line 6890 "cfg.c" +#line 6897 "cfg.c" goto _st248; _st248: @@ -6911,10 +6918,10 @@ void parse_cmdline(int argc, char *argv[]) goto _out0; _ctr316: { -#line 276 "cfg.rl" +#line 283 "cfg.rl" ccfg.ternary = 1; } -#line 6918 "cfg.c" +#line 6925 "cfg.c" goto _st1; _st1: @@ -7284,17 +7291,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr55: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 7295 "cfg.c" +#line 7302 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7302,12 +7309,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7306 "cfg.c" +#line 7313 "cfg.c" goto _st17; _ctr57: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7315,7 +7322,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7319 "cfg.c" +#line 7326 "cfg.c" goto _st17; _st17: @@ -7380,17 +7387,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr60: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 7391 "cfg.c" +#line 7398 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7398,12 +7405,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7402 "cfg.c" +#line 7409 "cfg.c" goto _st21; _ctr62: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7411,7 +7418,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7415 "cfg.c" +#line 7422 "cfg.c" goto _st21; _st21: @@ -7491,17 +7498,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr66: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 7502 "cfg.c" +#line 7509 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7509,12 +7516,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7513 "cfg.c" +#line 7520 "cfg.c" goto _st26; _ctr68: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7522,7 +7529,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7526 "cfg.c" +#line 7533 "cfg.c" goto _st26; _st26: @@ -7617,17 +7624,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr73: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 7628 "cfg.c" +#line 7635 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7635,12 +7642,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7639 "cfg.c" +#line 7646 "cfg.c" goto _st32; _ctr75: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7648,7 +7655,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7652 "cfg.c" +#line 7659 "cfg.c" goto _st32; _st32: @@ -7781,17 +7788,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr84: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 7792 "cfg.c" +#line 7799 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7799,12 +7806,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7803 "cfg.c" +#line 7810 "cfg.c" goto _st40; _ctr86: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7812,7 +7819,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7816 "cfg.c" +#line 7823 "cfg.c" goto _st40; _st40: @@ -7952,17 +7959,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr94: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 7963 "cfg.c" +#line 7970 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7970,12 +7977,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7974 "cfg.c" +#line 7981 "cfg.c" goto _st49; _ctr96: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -7983,7 +7990,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 7987 "cfg.c" +#line 7994 "cfg.c" goto _st49; _st49: @@ -8093,17 +8100,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr102: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 8104 "cfg.c" +#line 8111 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -8111,12 +8118,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 8115 "cfg.c" +#line 8122 "cfg.c" goto _st56; _ctr104: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -8124,7 +8131,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 8128 "cfg.c" +#line 8135 "cfg.c" goto _st56; _st56: @@ -8399,7 +8406,7 @@ void parse_cmdline(int argc, char *argv[]) } _ctr121: { -#line 144 "cfg.rl" +#line 151 "cfg.rl" switch (ccfg.ternary) { case 1: allow_hostname = 1; break; @@ -8407,12 +8414,12 @@ void parse_cmdline(int argc, char *argv[]) } } -#line 8411 "cfg.c" +#line 8418 "cfg.c" goto _st249; _ctr173: { -#line 59 "cfg.rl" +#line 66 "cfg.rl" switch (ccfg.ternary) { case 1: client_config.abort_if_no_lease = true; break; @@ -8420,12 +8427,12 @@ void parse_cmdline(int argc, char *argv[]) } } -#line 8424 "cfg.c" +#line 8431 "cfg.c" goto _st249; _ctr193: { -#line 95 "cfg.rl" +#line 102 "cfg.rl" switch (ccfg.ternary) { case 1: set_arp_relentless_def(true); break; @@ -8433,26 +8440,26 @@ void parse_cmdline(int argc, char *argv[]) } } -#line 8437 "cfg.c" +#line 8444 "cfg.c" goto _st249; _ctr267: { -#line 91 "cfg.rl" +#line 98 "cfg.rl" log_line("seccomp_enforce option is deprecated; please remove it"); log_line("In the meanwhile, it is ignored and seccomp is disabled."); } -#line 8448 "cfg.c" +#line 8455 "cfg.c" goto _st249; _ctr315: { -#line 276 "cfg.rl" +#line 283 "cfg.rl" ccfg.ternary = 1; } -#line 8456 "cfg.c" +#line 8463 "cfg.c" goto _st249; _st249: @@ -8622,17 +8629,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr130: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 8633 "cfg.c" +#line 8640 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -8640,12 +8647,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 8644 "cfg.c" +#line 8651 "cfg.c" goto _st84; _ctr132: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -8653,7 +8660,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 8657 "cfg.c" +#line 8664 "cfg.c" goto _st84; _st84: @@ -8858,17 +8865,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr144: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 8869 "cfg.c" +#line 8876 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -8876,12 +8883,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 8880 "cfg.c" +#line 8887 "cfg.c" goto _st97; _ctr146: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -8889,7 +8896,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 8893 "cfg.c" +#line 8900 "cfg.c" goto _st97; _st97: @@ -9064,17 +9071,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr157: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 9075 "cfg.c" +#line 9082 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9082,12 +9089,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9086 "cfg.c" +#line 9093 "cfg.c" goto _st108; _ctr159: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9095,7 +9102,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9099 "cfg.c" +#line 9106 "cfg.c" goto _st108; _st108: @@ -9250,17 +9257,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr168: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 9261 "cfg.c" +#line 9268 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9268,12 +9275,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9272 "cfg.c" +#line 9279 "cfg.c" goto _st118; _ctr170: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9281,7 +9288,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9285 "cfg.c" +#line 9292 "cfg.c" goto _st118; _st118: @@ -9719,17 +9726,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr198: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 9730 "cfg.c" +#line 9737 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9737,12 +9744,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9741 "cfg.c" +#line 9748 "cfg.c" goto _st146; _ctr200: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9750,7 +9757,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9754 "cfg.c" +#line 9761 "cfg.c" goto _st146; _st146: @@ -9920,17 +9927,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr210: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 9931 "cfg.c" +#line 9938 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9938,12 +9945,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9942 "cfg.c" +#line 9949 "cfg.c" goto _st157; _ctr212: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -9951,7 +9958,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 9955 "cfg.c" +#line 9962 "cfg.c" goto _st157; _st157: @@ -10121,17 +10128,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr222: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 10132 "cfg.c" +#line 10139 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10139,12 +10146,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10143 "cfg.c" +#line 10150 "cfg.c" goto _st168; _ctr224: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10152,7 +10159,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10156 "cfg.c" +#line 10163 "cfg.c" goto _st168; _st168: @@ -10336,17 +10343,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr238: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 10347 "cfg.c" +#line 10354 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10354,12 +10361,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10358 "cfg.c" +#line 10365 "cfg.c" goto _st179; _ctr240: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10367,7 +10374,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10371 "cfg.c" +#line 10378 "cfg.c" goto _st179; _st179: @@ -10552,17 +10559,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr251: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 10563 "cfg.c" +#line 10570 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10570,12 +10577,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10574 "cfg.c" +#line 10581 "cfg.c" goto _st191; _ctr253: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10583,7 +10590,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10587 "cfg.c" +#line 10594 "cfg.c" goto _st191; _st191: @@ -10963,17 +10970,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr276: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 10974 "cfg.c" +#line 10981 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10981,12 +10988,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10985 "cfg.c" +#line 10992 "cfg.c" goto _st216; _ctr278: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -10994,7 +11001,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 10998 "cfg.c" +#line 11005 "cfg.c" goto _st216; _st216: @@ -11149,17 +11156,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr287: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 11160 "cfg.c" +#line 11167 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -11167,12 +11174,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 11171 "cfg.c" +#line 11178 "cfg.c" goto _st226; _ctr289: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -11180,7 +11187,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 11184 "cfg.c" +#line 11191 "cfg.c" goto _st226; _st226: @@ -11275,17 +11282,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr294: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 11286 "cfg.c" +#line 11293 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -11293,12 +11300,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 11297 "cfg.c" +#line 11304 "cfg.c" goto _st232; _ctr296: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -11306,7 +11313,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 11310 "cfg.c" +#line 11317 "cfg.c" goto _st232; _st232: @@ -11466,17 +11473,17 @@ void parse_cmdline(int argc, char *argv[]) } _ctr306: { -#line 32 "cfg.rl" +#line 39 "cfg.rl" memset(&ccfg.buf, 0, sizeof ccfg.buf); ccfg.buflen = 0; ccfg.ternary = 0; } -#line 11477 "cfg.c" +#line 11484 "cfg.c" { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -11484,12 +11491,12 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 11488 "cfg.c" +#line 11495 "cfg.c" goto _st242; _ctr308: { -#line 37 "cfg.rl" +#line 44 "cfg.rl" if (ccfg.buflen < sizeof ccfg.buf - 1) ccfg.buf[ccfg.buflen++] = *p; @@ -11497,7 +11504,7 @@ void parse_cmdline(int argc, char *argv[]) suicide("line or option is too long"); } -#line 11501 "cfg.c" +#line 11508 "cfg.c" goto _st242; _st242: @@ -11843,7 +11850,7 @@ void parse_cmdline(int argc, char *argv[]) _out: {} } -#line 344 "cfg.rl" +#line 351 "cfg.rl" if (ccfg.cs == cmd_cfg_error) diff --git a/cfg.rl b/cfg.rl index a048d3f..770ce49 100644 --- a/cfg.rl +++ b/cfg.rl @@ -15,9 +15,16 @@ #include "sockd.h" #include "nk/log.h" #include "nk/privs.h" -#include "nk/copy_cmdarg.h" #include "nk/io.h" +static void copy_cmdarg(char *dest, const char *src, + size_t destlen, const char *argname) +{ + ssize_t olen = snprintf(dest, destlen, "%s", src); + if (olen < 0 || (size_t)olen > destlen) + suicide("snprintf failed on %s", argname); +} + struct cfgparse { char buf[MAX_BUF]; size_t buflen; diff --git a/ndhc.c b/ndhc.c index 27d488d..a16a7d2 100644 --- a/ndhc.c +++ b/ndhc.c @@ -24,7 +24,6 @@ #include "nk/log.h" #include "nk/privs.h" #include "nk/io.h" -#include "nk/copy_cmdarg.h" #include "ndhc.h" #include "ndhc-defines.h" diff --git a/nk/copy_cmdarg.h b/nk/copy_cmdarg.h deleted file mode 100644 index e6594f1..0000000 --- a/nk/copy_cmdarg.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 Nicholas J. Kain -// SPDX-License-Identifier: MIT -#ifndef NCMLIB_COPY_CMDARG_H_ -#define NCMLIB_COPY_CMDARG_H_ - -#include -#include -#include "nk/log.h" - -static inline void copy_cmdarg(char *dest, const char *src, - size_t destlen, const char *argname) -{ - ssize_t olen = snprintf(dest, destlen, "%s", src); - if (olen < 0 || (size_t)olen > destlen) - suicide("snprintf failed on %s", argname); -} - -#endif -