Lines Matching full:if

72 #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */
74 #if 0 /* UNUSED */
88 #if defined(_PATH_LASTLOG) && defined(__linux__)
110 #if CCP_SUPPORT
113 #if ECP_SUPPORT
117 #if PAP_SUPPORT
120 #if CHAP_SUPPORT
123 #if EAP_SUPPORT
126 #if CBCP_SUPPORT
130 #if 0 /* UNUSED */
134 #if 0 /* UNUSED */
142 #if 0 /* UNUSED */
150 /* Remote telephone number, if available */
160 #if 0 /* UNUSED */
161 /* Set if we require authentication only because we have a default route. */
181 /* Hook for a plugin to say if we can possibly authenticate a peer using CHAP */
187 /* Hook for a plugin to say whether it is OK if the peer
200 #if PPP_NOTIFY
212 #if 0 /* MOVED TO ppp_settings */
219 #if MSCHAP_SUPPORT
230 bool explicit_user = 0; /* Set if "user" option supplied */
231 bool explicit_passwd = 0; /* Set if "password" option supplied */
240 #if PPP_IDLETIMELIMIT
243 #if PPP_MAXCONNECT
246 #if 0 /* UNUSED */
272 #if PPP_OPTIONS
296 #if MSCHAP_SUPPORT
314 #if 0
328 #if MSCHAP_SUPPORT
329 #if 0
348 #if EAP_SUPPORT
352 #if 0
365 #if 0
411 #if 0 /* UNUSED */
429 if (fname == NULL)
432 if (seteuid(getuid()) == -1) {
437 if (seteuid(euid) == -1)
439 if (ufile == NULL) {
447 if (fgets(u, MAXNAMELEN - 1, ufile) == NULL
457 if (l > 0 && u[l-1] == '\n')
460 if (l > 0 && p[l-1] == '\n')
463 if (override_value("user", option_priority, fname)) {
467 if (override_value("passwd", option_priority, fname)) {
486 if (g == 0) {
491 if (groups[i] == g->gr_gid) {
513 if (wp == NULL)
535 if (wp == NULL)
552 #if 0
568 if (devfd < 0)
581 if (fd_ppp < 0) {
586 if (!demand && ifunit >= 0)
593 if (ifunit >= 0)
606 if (the_channel->disconnect)
611 if (the_channel->cleanup)
621 if (pcb->phase == PPP_PHASE_DEAD in link_terminated()
629 #if 0 /* UNUSED */ in link_terminated()
630 if (pap_logout_hook) { in link_terminated()
636 if (!doing_multilink) { in link_terminated()
638 #if PPP_STATS_SUPPORT in link_terminated()
647 #if 0 in link_terminated()
653 if (!doing_multilink && !demand) in link_terminated()
657 * If we may want to bring the link up again, transfer in link_terminated()
661 if (fd_ppp >= 0) { in link_terminated()
665 if (doing_multilink) in link_terminated()
669 if (!hungup) in link_terminated()
671 if (!doing_multilink && !demand) in link_terminated()
675 * Run disconnector script, if requested. in link_terminated()
676 * XXX we may not be able to do this if the line has hung up! in link_terminated()
678 if (devfd >= 0 && the_channel->disconnect) { in link_terminated()
682 if (the_channel->cleanup) in link_terminated()
685 if (doing_multilink && multilink_master) { in link_terminated()
686 if (!bundle_terminating) in link_terminated()
699 #if PPP_NOTIFY in link_down()
703 if (!doing_multilink) { in link_down()
705 if (pcb->phase != PPP_PHASE_DEAD in link_down()
712 /* XXX if doing_multilink, should do something to stop in link_down()
721 if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) in upper_layers_down()
723 if (protp->protocol < 0xC000 && protp->close != NULL) in upper_layers_down()
735 #if PPP_AUTH_SUPPORT in link_established()
737 #if PPP_SERVER in link_established()
738 #if PAP_SUPPORT in link_established()
751 if (!doing_multilink) { in link_established()
753 if (protp->protocol != PPP_LCP in link_established()
758 #if PPP_AUTH_SUPPORT in link_established()
759 #if PPP_SERVER in link_established()
760 #if PPP_ALLOWED_ADDRS in link_established()
761 if (!auth_required && noauth_addrs != NULL) in link_established()
765 if (pcb->settings.auth_required && !(0 in link_established()
766 #if PAP_SUPPORT in link_established()
769 #if CHAP_SUPPORT in link_established()
772 #if EAP_SUPPORT in link_established()
777 #if PPP_ALLOWED_ADDRS in link_established()
780 * if we have some address(es) it can use without auth, fine, in link_established()
782 * a username of "" and a password of "". If that's not OK, in link_established()
785 if (noauth_addrs != NULL) { in link_established()
789 if (!pcb->settings.null_login in link_established()
790 #if PAP_SUPPORT in link_established()
795 #if 0 /* UNUSED */ in link_established()
807 #if PPP_SERVER in link_established()
808 #if EAP_SUPPORT in link_established()
809 if (go->neg_eap) { in link_established()
814 #if CHAP_SUPPORT in link_established()
815 if (go->neg_chap) { in link_established()
820 #if PAP_SUPPORT in link_established()
821 if (go->neg_upap) { in link_established()
829 #if EAP_SUPPORT in link_established()
830 if (ho->neg_eap) { in link_established()
835 #if CHAP_SUPPORT in link_established()
836 if (ho->neg_chap) { in link_established()
841 #if PAP_SUPPORT in link_established()
842 if (ho->neg_upap) { in link_established()
852 if (!auth) in link_established()
861 #if CBCP_SUPPORT in network_phase()
864 #if 0 /* UNUSED */ in network_phase()
868 #if 0 /* UNUSED */ in network_phase()
870 if (*remote_number) in network_phase()
874 #if PPP_NOTIFY in network_phase()
876 * If the peer had to authenticate, notify it now. in network_phase()
878 if (0 in network_phase()
879 #if CHAP_SUPPORT in network_phase()
882 #if PAP_SUPPORT in network_phase()
885 #if EAP_SUPPORT in network_phase()
893 #if CBCP_SUPPORT in network_phase()
895 * If we negotiated callback, do it now. in network_phase()
897 if (go->neg_cbcp) { in network_phase()
904 #if PPP_OPTIONS in network_phase()
908 if (extra_options) { in network_phase()
918 #if CCP_SUPPORT || ECP_SUPPORT in start_networks()
926 if (multilink) { in start_networks()
927 if (mp_join_bundle()) { in start_networks()
928 if (multilink_join_hook) in start_networks()
930 if (updetach && !nodetach) in start_networks()
938 if (!demand) in start_networks()
941 #if CCP_SUPPORT || ECP_SUPPORT in start_networks()
944 if ( in start_networks()
946 #if ECP_SUPPORT in start_networks()
949 #if CCP_SUPPORT in start_networks()
960 if (1 in start_networks()
961 #if ECP_SUPPORT in start_networks()
964 #if MPPE_SUPPORT in start_networks()
979 if (protp->protocol < 0xC000 in continue_networks()
980 #if CCP_SUPPORT in continue_networks()
983 #if ECP_SUPPORT in continue_networks()
991 if (pcb->num_np_open == 0) in continue_networks()
996 #if PPP_AUTH_SUPPORT
997 #if PPP_SERVER
1010 if (pcb->settings.user && pcb->settings.passwd) { in auth_check_passwd()
1013 if (secretuserlen == userlen in auth_check_passwd()
1036 #if 0 /* UNUSED */ in auth_peer_fail()
1054 #if CHAP_SUPPORT in auth_peer_success()
1061 #if MSCHAP_SUPPORT in auth_peer_success()
1074 #if PAP_SUPPORT in auth_peer_success()
1079 #if EAP_SUPPORT in auth_peer_success()
1093 if (namelen > (int)sizeof(pcb->peer_authname) - 1) in auth_peer_success()
1098 #if 0 /* UNUSED */ in auth_peer_success()
1106 * If there is no more authentication still to be done, in auth_peer_success()
1109 if ((pcb->auth_pending &= ~bit) == 0) in auth_peer_success()
1141 #if CHAP_SUPPORT in auth_withpeer_success()
1149 #if MSCHAP_SUPPORT in auth_withpeer_success()
1162 #if PAP_SUPPORT in auth_withpeer_success()
1168 #if EAP_SUPPORT in auth_withpeer_success()
1186 * If there is no more authentication still being done, in auth_withpeer_success()
1189 if ((pcb->auth_pending &= ~bit) == 0) in auth_withpeer_success()
1199 #if PPP_IDLETIMELIMIT in np_up()
1204 if (pcb->num_np_up == 0) { in np_up()
1210 #if PPP_IDLETIMELIMIT in np_up()
1211 #if 0 /* UNUSED */ in np_up()
1212 if (idle_time_hook != 0) in np_up()
1217 if (tlim > 0) in np_up()
1221 #if PPP_MAXCONNECT in np_up()
1226 if (pcb->settings.maxconnect > 0) in np_up()
1231 if (maxoctets > 0) in np_up()
1235 #if 0 /* Unused */ in np_up()
1237 * Detach now, if the updetach option was given. in np_up()
1239 if (updetach && !nodetach) in np_up()
1251 if (--pcb->num_np_up == 0) { in np_down()
1252 #if PPP_IDLETIMELIMIT in np_down()
1255 #if PPP_MAXCONNECT in np_down()
1270 if (--pcb->num_np_open <= 0) { in np_finished()
1281 #if PPP_STATS_SUPPORT
1302 if (used > maxoctets) {
1306 #if 0 /* UNUSED */
1316 #if PPP_IDLETIMELIMIT
1327 if (!get_idle_time(pcb, &idle)) in check_idle()
1329 #if 0 /* UNUSED */ in check_idle()
1330 if (idle_time_hook != 0) { in check_idle()
1336 #if 0 /* UNUSED */ in check_idle()
1339 if (tlim <= 0) { in check_idle()
1344 #if 0 /* UNUSED */ in check_idle()
1353 #if PPP_MAXCONNECT
1365 #if PPP_OPTIONS
1377 if (our_name[0] == 0 || usehostname) in auth_check_options()
1379 /* If a blank username was explicitly given as an option, trust in auth_check_options()
1381 if (ppp_settings.user[0] == 0 && !explicit_user) in auth_check_options()
1385 * If we have a default route, require the peer to authenticate in auth_check_options()
1388 if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { in auth_check_options()
1393 #if CHAP_SUPPORT in auth_check_options()
1394 /* If we selected any CHAP flavors, we should probably negotiate it. :-) */ in auth_check_options()
1395 if (wo->chap_mdtype) in auth_check_options()
1399 /* If authentication is required, ask peer for CHAP, PAP, or EAP. */ in auth_check_options()
1400 if (auth_required) { in auth_check_options()
1402 if (1 in auth_check_options()
1403 #if CHAP_SUPPORT in auth_check_options()
1406 #if PAP_SUPPORT in auth_check_options()
1409 #if EAP_SUPPORT in auth_check_options()
1413 #if CHAP_SUPPORT in auth_check_options()
1417 #if PAP_SUPPORT in auth_check_options()
1420 #if EAP_SUPPORT in auth_check_options()
1425 #if CHAP_SUPPORT in auth_check_options()
1429 #if PAP_SUPPORT in auth_check_options()
1432 #if EAP_SUPPORT in auth_check_options()
1443 #if PAP_SUPPORT in auth_check_options()
1448 if (!can_auth && (0 in auth_check_options()
1449 #if CHAP_SUPPORT in auth_check_options()
1452 #if EAP_SUPPORT in auth_check_options()
1456 #if CHAP_SUPPORT in auth_check_options()
1463 if (!can_auth in auth_check_options()
1464 #if EAP_SUPPORT in auth_check_options()
1472 if (auth_required && !can_auth && noauth_addrs == NULL) { in auth_check_options()
1473 if (default_auth) { in auth_check_options()
1478 } else if (explicit_remote) in auth_check_options()
1487 if (lacks_ip) in auth_check_options()
1497 if (!auth_number()) { in auth_check_options()
1504 #if 0 /* UNUSED */
1531 if (go->neg_upap && !uselogin && !have_pap_secret(NULL))
1533 if (go->neg_chap) {
1534 if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL),
1538 if (go->neg_eap &&
1549 * file. If requested, also check against the system password database,
1550 * and login the user if OK.
1577 * If there are unprintable characters in the password, make
1585 * Check if a plugin wants to handle this.
1587 if (pap_auth_hook) {
1589 if (ret >= 0) {
1592 if (ret)
1594 else if (opts != 0)
1596 if (addrs != 0)
1611 if (f == NULL) {
1616 if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) {
1620 * If the secret is "@login", it means to check
1625 if (uselogin || login_secret) {
1627 if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) {
1630 } else if (session_mgmt) {
1631 if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) {
1636 if (secret[0] != 0 && !login_secret) {
1638 if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0)
1646 if (ret == UPAP_AUTHNAK) {
1647 if (**msg == 0)
1655 if (attempts++ >= 10) {
1659 if (attempts > 3)
1661 if (opts != NULL)
1666 if (**msg == 0)
1671 if (addrs != NULL)
1680 * null_login - Check if a username of "" and a password of "" are
1695 * Check if a plugin wants to handle this.
1698 if (null_auth_hook)
1704 if (ret <= 0) {
1708 if (f == NULL)
1718 if (ret)
1720 else if (opts != 0)
1722 if (addrs != 0)
1730 * our peer using PAP. Returns 1 on success, 0 if no suitable password
1732 * Assumes passwd points to MAXSECRETLEN bytes of space (if non-null).
1746 if (pap_passwd_hook) {
1748 if (ret >= 0)
1754 if (f == NULL)
1761 if (ret < 0)
1763 if (passwd != NULL)
1782 /* let the plugin decide, if there is one */
1783 if (pap_check_hook) {
1785 if (ret >= 0)
1791 if (f == NULL)
1797 if (ret >= 0 && !some_ip_ok(addrs)) {
1798 if (lacks_ipp != 0)
1802 if (addrs != 0)
1826 if (chap_check_hook) {
1828 if (ret >= 0) {
1835 if (f == NULL)
1838 if (client != NULL && client[0] == 0)
1840 else if (server != NULL && server[0] == 0)
1845 if (ret >= 0 && need_ip && !some_ip_ok(addrs)) {
1846 if (lacks_ipp != 0)
1850 if (addrs != 0)
1876 if (f == NULL)
1879 if (client != NULL && client[0] == 0)
1881 else if (server != NULL && server[0] == 0)
1886 if (ret >= 0 && need_ip && !some_ip_ok(addrs)) {
1887 if (lacks_ipp != 0)
1891 if (addrs != 0)
1898 #if PPP_AUTH_SUPPORT
1909if (!client || !client[0] || !pcb->settings.user || !pcb->settings.passwd || strcmp(client, pcb->s… in get_secret()
1914 if (len > MAXSECRETLEN) { in get_secret()
1923 #if 0 /* UNUSED */ in get_secret()
1932 if (!am_server && ppp_settings.passwd[0] != 0) { in get_secret()
1934 } else if (!am_server && chap_passwd_hook) { in get_secret()
1935 if ( (*chap_passwd_hook)(client, secbuf) < 0) { in get_secret()
1946 if (f == NULL) { in get_secret()
1954 if (ret < 0) in get_secret()
1957 if (am_server) in get_secret()
1959 else if (opts != 0) in get_secret()
1961 if (addrs != 0) in get_secret()
1966 if (len > MAXSECRETLEN) { in get_secret()
1980 #if 0 /* UNUSED */
1999 if (!am_server && ppp_settings.passwd[0] != '\0') {
2006 if (fp == NULL) {
2016 if (ret < 0)
2019 if (am_server)
2021 else if (opts != NULL)
2023 if (addrs != NULL)
2051 if (addresses[unit] != NULL)
2054 if (extra_options != NULL)
2062 if (n == 0)
2065 if (ip == 0)
2077 if (strcmp(ptr_word, "-") == 0)
2079 if (strcmp(ptr_word, "*") == 0) {
2087 if (*ptr_word == '!') {
2095 if (ptr_mask != NULL) {
2100 if (bit_count <= 0 || bit_count > 32) {
2106 if (*endp == '+') {
2110 if (*endp != 0) {
2119 if (hp != NULL && hp->h_addrtype == AF_INET) {
2123 if (np != NULL && np->n_addrtype == AF_INET) {
2125 if (ptr_mask == NULL) {
2128 if (IN_CLASSA(ah))
2130 else if (IN_CLASSB(ah))
2132 else if (IN_CLASSC(ah))
2140 if (ptr_mask != NULL)
2143 if (a == (u32_t)-1L) {
2147 if (offset != 0) {
2148 if (offset >= ~mask) {
2159 if (~mask == 0 && suggested_ip == 0)
2171 * If the address given for the peer isn't authorized, or if
2173 * which is a single host, then use that if we find one.
2175 if (suggested_ip != 0
2179 * Do we insist on this address? No, if there are other
2182 if (n > 1)
2189 * a given IP address. Returns 1 if authorized, 0 otherwise.
2199 if (bad_ip_adrs(addr))
2202 if (allowed_address_hook) {
2204 if (ok >= 0) return ok;
2207 if (addresses[unit] != NULL) {
2209 if (ok >= 0)
2213 if (auth_required)
2224 if ((addr & addrs->mask) == addrs->base)
2229 * bad_ip_adrs - return 1 if the IP address is one we don't want
2243 * some_ip_ok - check a wordlist to see if it authorizes any
2251 if (addrs->word[0] == '-')
2253 if (addrs->word[0] != '!')
2261 * Returns 1 if authorized, 0 otherwise.
2269 /* Allow all if no authorization list. */
2270 if (!wp)
2273 /* Allow if we have a match in the authorization list. */
2277 if ((wp->word)[l - 1] == '*')
2279 if (!strncasecmp(wp->word, remote_number, l))
2288 * check_access - complain if a secret file has too-liberal permissions.
2297 if (fstat(fileno(f), &sbuf) < 0) {
2299 } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) {
2308 * if no secret is found, otherwise >= 0. The return value has
2309 * NONWILD_CLIENT set if the secret didn't have "*" for the client, and
2310 * NONWILD_SERVER set if the secret didn't have "*" for the server.
2316 * Flags are non-zero if we need two colons in the secret in order to
2339 if (addrs != NULL)
2341 if (opts != NULL)
2344 if (!getword(f, word, &newline, filename))
2354 if (!newline)
2358 * Got a client - check if it's a match or a wildcard.
2361 if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) {
2365 if (!ISWILD(word))
2369 * Now get a server and check if it matches.
2371 if (!getword(f, word, &newline, filename))
2373 if (newline)
2375 if (!ISWILD(word)) {
2376 if (server != NULL && strcmp(word, server) != 0)
2382 * Got some sort of a match - see if it's better than what
2385 if (got_flag <= best_flag)
2391 if (!getword(f, word, &newline, filename))
2393 if (newline)
2400 if (flags && ((cp = strchr(word, ':')) == NULL ||
2404 if (secret != NULL) {
2408 if (word[0] == '@' && word[1] == '/') {
2410 if ((sf = fopen(atfile, "r")) == NULL) {
2415 if (!getword(sf, word, &xxx, atfile)) {
2430 if (!getword(f, word, &newline, filename) || newline)
2434 if (ap == NULL)
2447 if (addr_list)
2450 if (secret != NULL)
2453 if (!newline)
2459 if (strcmp(ap->word, "--") == 0)
2462 if (ap != NULL) {
2467 if (opts != NULL)
2469 else if (ap != NULL)
2471 if (addrs != NULL)
2473 else if (addr_list != NULL)