Deleted Added
sdiff udiff text old ( 263726 ) new ( 263729 )
full compact
1%{
2/*-
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * This software was developed by Edward Tomasz Napierala under sponsorship
7 * from the FreeBSD Foundation.
8 *

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * $FreeBSD: stable/10/usr.sbin/ctld/parse.y 263726 2014-03-25 12:16:52Z trasz $
31 */
32
33#include <sys/queue.h>
34#include <sys/types.h>
35#include <sys/stat.h>
36#include <assert.h>
37#include <stdio.h>
38#include <stdint.h>

--- 685 unchanged lines hidden (view full) ---

724
725 ag = auth_group_new(conf, "default");
726 assert(ag != NULL);
727
728 ag = auth_group_new(conf, "no-authentication");
729 assert(ag != NULL);
730 ag->ag_type = AG_TYPE_NO_AUTHENTICATION;
731
732 /*
733 * Here, the type doesn't really matter, as the group doesn't contain
734 * any entries and thus will always deny access.
735 */
736 ag = auth_group_new(conf, "no-access");
737 assert(ag != NULL);
738 ag->ag_type = AG_TYPE_CHAP;
739
740 pg = portal_group_new(conf, "default");
741 assert(pg != NULL);
742
743 yyin = fopen(path, "r");
744 if (yyin == NULL) {
745 log_warn("unable to open configuration file %s", path);
746 conf_delete(conf);

--- 13 unchanged lines hidden (view full) ---

760 return (NULL);
761 }
762
763 if (conf->conf_default_ag_defined == false) {
764 log_debugx("auth-group \"default\" not defined; "
765 "going with defaults");
766 ag = auth_group_find(conf, "default");
767 assert(ag != NULL);
768 ag->ag_type = AG_TYPE_CHAP;
769 }
770
771 if (conf->conf_default_pg_defined == false) {
772 log_debugx("portal-group \"default\" not defined; "
773 "going with defaults");
774 pg = portal_group_find(conf, "default");
775 assert(pg != NULL);
776 portal_group_add_listen(pg, "0.0.0.0:3260", false);
777 portal_group_add_listen(pg, "[::]:3260", false);
778 }
779
780 error = conf_verify(conf);
781 if (error != 0) {
782 conf_delete(conf);
783 return (NULL);
784 }
785
786 return (conf);
787}