parse.y (263726) | parse.y (263729) |
---|---|
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 * | 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 $ | 30 * $FreeBSD: stable/10/usr.sbin/ctld/parse.y 263729 2014-03-25 12:22:30Z 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 | 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); | 732 ag = auth_group_new(conf, "no-access"); 733 assert(ag != NULL); |
738 ag->ag_type = AG_TYPE_CHAP; | 734 ag->ag_type = AG_TYPE_DENY; |
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); | 735 736 pg = portal_group_new(conf, "default"); 737 assert(pg != NULL); 738 739 yyin = fopen(path, "r"); 740 if (yyin == NULL) { 741 log_warn("unable to open configuration file %s", path); 742 conf_delete(conf); --- 13 unchanged lines hidden (view full) --- 756 return (NULL); 757 } 758 759 if (conf->conf_default_ag_defined == false) { 760 log_debugx("auth-group \"default\" not defined; " 761 "going with defaults"); 762 ag = auth_group_find(conf, "default"); 763 assert(ag != NULL); |
768 ag->ag_type = AG_TYPE_CHAP; | 764 ag->ag_type = AG_TYPE_DENY; |
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} | 765 } 766 767 if (conf->conf_default_pg_defined == false) { 768 log_debugx("portal-group \"default\" not defined; " 769 "going with defaults"); 770 pg = portal_group_find(conf, "default"); 771 assert(pg != NULL); 772 portal_group_add_listen(pg, "0.0.0.0:3260", false); 773 portal_group_add_listen(pg, "[::]:3260", false); 774 } 775 776 error = conf_verify(conf); 777 if (error != 0) { 778 conf_delete(conf); 779 return (NULL); 780 } 781 782 return (conf); 783} |