From owner-p4-projects@FreeBSD.ORG Wed Oct 25 20:46:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 01ABA16A4E1; Wed, 25 Oct 2006 20:46:45 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EC5916A4A0 for ; Wed, 25 Oct 2006 20:46:44 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05A8743D93 for ; Wed, 25 Oct 2006 20:46:01 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9PKk06g071896 for ; Wed, 25 Oct 2006 20:46:00 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9PKk0xT071891 for perforce@freebsd.org; Wed, 25 Oct 2006 20:46:00 GMT (envelope-from millert@freebsd.org) Date: Wed, 25 Oct 2006 20:46:00 GMT Message-Id: <200610252046.k9PKk0xT071891@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 108427 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Oct 2006 20:46:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=108427 Change 108427 by millert@millert_macbook on 2006/10/25 20:45:14 Update to libsemanage-1.8 from the NSA web site. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/ChangeLog#4 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/VERSION#4 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/conf-parse.y#3 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/conf-scan.l#3 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/direct_api.c#3 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/private.h#3 delete .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/semanage_store.c#4 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/ChangeLog#4 (text+ko) ==== @@ -1,3 +1,19 @@ +1.8 2006-10-17 + * Updated version for release. + +1.6.17 2006-09-29 + * Merged patch to skip reload if no active store exists and + the store path doesn't match the active store path from Dan Walsh. + * Merged patch to not destroy sepol handle on error path of + connect from James Athey. + * Merged patch to add genhomedircon path to semanage.conf from + James Athey. + +1.6.16 2006-08-14 + * Make most copy errors fatal, but allow exceptions for + file_contexts.local, seusers, and netfilter_contexts if + the source file does not exist in the store. + 1.6.15 2006-08-11 * Merged separate local file contexts patch from Chris PeBenito. ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/VERSION#4 (text+ko) ==== @@ -1,1 +1,1 @@ -1.6.15 +1.8 ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/conf-parse.y#3 (text+ko) ==== @@ -1,6 +1,7 @@ -/* Author: Jason Tang +/* Authors: Jason Tang + * James Athey * - * Copyright (C) 2004-2005 Tresys Technology, LLC + * Copyright (C) 2004-2006 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -55,7 +56,7 @@ } %token MODULE_STORE VERSION EXPAND_CHECK FILE_MODE -%token LOAD_POLICY_START SETFILES_START +%token LOAD_POLICY_START SETFILES_START GENHOMEDIRCON_START %token VERIFY_MOD_START VERIFY_LINKED_START VERIFY_KERNEL_START BLOCK_END %token PROG_PATH PROG_ARGS %token ARG @@ -136,6 +137,14 @@ YYABORT; } } + | GENHOMEDIRCON_START { + semanage_conf_external_prog_destroy(current_conf->genhomedircon); + current_conf->genhomedircon = NULL; + if (new_external_prog(¤t_conf->genhomedircon) == -1) { + parse_errors++; + YYABORT; + } + } ; verify_block: verify_start external_opts BLOCK_END { ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/conf-scan.l#3 (text+ko) ==== @@ -1,6 +1,7 @@ -/* Author: Jason Tang +/* Authors: Jason Tang + * James Athey * - * Copyright (C) 2004-2005 Tresys Technology, LLC + * Copyright (C) 2004-2006 Tresys Technology, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,6 +44,7 @@ file-mode return FILE_MODE; "[load_policy]" return LOAD_POLICY_START; "[setfiles]" return SETFILES_START; +"[genhomedircon]" return GENHOMEDIRCON_START; "[verify module]" return VERIFY_MOD_START; "[verify linked]" return VERIFY_LINKED_START; "[verify kernel]" return VERIFY_KERNEL_START; ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/direct_api.c#3 (text+ko) ==== @@ -217,7 +217,6 @@ err: ERR(sh, "could not establish direct connection"); - sepol_handle_destroy(sh->sepolh); return STATUS_ERR; } ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/libsemanage/src/semanage_store.c#4 (text+ko) ==== @@ -1056,37 +1056,38 @@ snprintf(store_hd, PATH_MAX, "%s%s", storepath, running_hd); if (semanage_copy_file(active_hd, store_hd, sh->conf->file_mode) == -1) { - INFO(sh, "Non-fatal error: Could not copy %s to %s.", - active_hd, store_hd); - /* Non-fatal; fall through */ + ERR(sh, "Could not copy %s to %s.", active_hd, store_hd); + goto cleanup; } snprintf(store_fc, PATH_MAX, "%s%s", storepath, running_fc); if (semanage_copy_file(active_fc, store_fc, sh->conf->file_mode) == -1) { - INFO(sh, "Non-fatal error: Could not copy %s to %s.", - active_fc, store_fc); - /* Non-fatal; fall through */ + ERR(sh, "Could not copy %s to %s.", active_fc, store_fc); + goto cleanup; } snprintf(store_fc_loc, PATH_MAX, "%s%s", storepath, running_fc_loc); - if (semanage_copy_file(active_fc_loc, store_fc_loc, sh->conf->file_mode) == -1) { - INFO(sh, "Non-fatal error: Could not copy %s to %s.", - active_fc_loc, store_fc_loc); - /* Non-fatal; fall through */ + if (semanage_copy_file(active_fc_loc, store_fc_loc, sh->conf->file_mode) + == -1 && errno != ENOENT) { + ERR(sh, "Could not copy %s to %s.", active_fc_loc, + store_fc_loc); + goto cleanup; } snprintf(store_seusers, PATH_MAX, "%s%s", storepath, running_seusers); if (semanage_copy_file - (active_seusers, store_seusers, sh->conf->file_mode) == -1) { - INFO(sh, "Non-fatal error: Could not copy %s to %s.", - active_seusers, store_seusers); - /* Non-fatal; fall through */ + (active_seusers, store_seusers, sh->conf->file_mode) == -1 + && errno != ENOENT) { + ERR(sh, "Could not copy %s to %s.", active_seusers, + store_seusers); + goto cleanup; } snprintf(store_nc, PATH_MAX, "%s%s", storepath, running_nc); - if (semanage_copy_file(active_nc, store_nc, sh->conf->file_mode) == -1) { - INFO(sh, "Non-fatal error: Could not copy %s to %s.", active_nc, store_nc); - /* Non-fatal; fall through */ + if (semanage_copy_file(active_nc, store_nc, sh->conf->file_mode) == -1 + && errno != ENOENT) { + ERR(sh, "Could not copy %s to %s.", active_nc, store_nc); + goto cleanup; } if (!sh->do_reload) @@ -1108,7 +1109,9 @@ /* They are not the same store */ goto skip_reload; } - } + } else if (errno == ENOENT && + strcmp(really_active_store, storepath) != 0) + goto skip_reload; if (semanage_reload_policy(sh)) { goto cleanup;