From patchwork Thu Sep 8 20:30:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Cashman X-Patchwork-Id: 9322027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FE6460752 for ; Thu, 8 Sep 2016 20:34:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2065E29971 for ; Thu, 8 Sep 2016 20:34:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15201299DC; Thu, 8 Sep 2016 20:34:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (emsm-gh1-uea10.nsa.gov [8.44.101.8]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7391129971 for ; Thu, 8 Sep 2016 20:34:20 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,302,1470700800"; d="scan'208";a="17391876" IronPort-PHdr: =?us-ascii?q?9a23=3AccyNZRRp+F5H2eD1lCV2ry4gftpsv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa64YxON2/xhgRfzUJnB7Loc0qyN4vmmBzZLuMrQ+DBaKdoXBkdD0Z?= =?us-ascii?q?1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYn?= =?us-ascii?q?br+tQt2asc272qiI9oHJZE0Q3XzmMOo0ck/99FmA/olO2M05e/53kkOI6lJzOM?= =?us-ascii?q?1ujVtyIlySmxuuruyRx7VEtxpqhvQ66sRbWr/7dalrBZZRDTAhLnxnrJaz7UqL?= =?us-ascii?q?cBGLrkc4fi1W10MQQluN0BavRZr1sy3npsJhySKaOovwVrlyVjO8vIlxTxq9pC?= =?us-ascii?q?4BNjM9uErekcx1haQT9B6qrgd/xofSSIiTOOB5f6+bdtQfEzkSFv1NXjBMV9vv?= =?us-ascii?q?J7AECPAMaKMB94Q=3D?= X-IPAS-Result: =?us-ascii?q?A2HtAwCzytFX/wHyM5BdGgEBAQECAQEBARcBAQQBAYMOAQE?= =?us-ascii?q?BAQEegVO6PiOHY0wBAQEBAQEBAQIBAlsngjIEAxMFBTkQVQINXwIBAwECDxUTB?= =?us-ascii?q?gEBDCALAQIDCQEBFwghCAgDAS0DAQUBCxEOCwUYBAGIKKNHgTI+MopWhS4BAQW?= =?us-ascii?q?HWAELHQgQhBWCAQqIYBEBaIUQji92ij6PQolPJYVnjwoxgRFUgl8NG4FtUIVEe?= =?us-ascii?q?IEnAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 08 Sep 2016 20:34:17 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u88KYGn8002080; Thu, 8 Sep 2016 16:34:17 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u88KVJWt096606 for ; Thu, 8 Sep 2016 16:31:19 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u88KVIH0001789 for ; Thu, 8 Sep 2016 16:31:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1CtAwDkydFXhjLcVdFdHAEBBAEBgy0BAQEBAYFxtjaEEoYcAoFeTAECAQEBAQECEwEBAQgLCwkZhRECAQMSFRkBATcBDyAxNAEFARwZIogoo0WBMj4yilaFLgEBBYdYAQEBAQEBBAIBHAgQhBWCAQqJWoUQji92ij6PQolPhgyPCjGBEYMzDREKgW0cNIdjAQEB X-IPAS-Result: A1CtAwDkydFXhjLcVdFdHAEBBAEBgy0BAQEBAYFxtjaEEoYcAoFeTAECAQEBAQECEwEBAQgLCwkZhRECAQMSFRkBATcBDyAxNAEFARwZIogoo0WBMj4yilaFLgEBBYdYAQEBAQEBBAIBHAgQhBWCAQqJWoUQji92ij6PQolPhgyPCjGBEYMzDREKgW0cNIdjAQEB X-IronPort-AV: E=Sophos;i="5.30,302,1470715200"; d="scan'208";a="5693976" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 08 Sep 2016 16:31:20 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3A0z2wdxzzHzQEFSrXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?0ewUIJqq85mqBkHD//Il1AaPBtSCrawewLOK4uigATVGusfZ9ihaMdRlbFwssY?= =?us-ascii?q?0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8?= =?us-ascii?q?Kum9IIPOlcP/j7n0oMyKJVsSz2PhMPsydEzw9lSJ8JFOwMNLEeUY8lPxuHxGeu?= =?us-ascii?q?BblytDBGm4uFLC3Pq254Np6C9KuvgspIZqWKT+eLkkH/QDVGx1ezN92Mq+rhTH?= =?us-ascii?q?TA2S9lMAQ24WlVxOGAGD4xbkDbnrtS6vmuN72SSedeb/VrAxUDLqu6tgQQTojS?= =?us-ascii?q?4BHzc//HvQi8A2h6Ve9kHy7ydjypLZNdnGfMF1ebnQKIsX?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0E9AwBhydFXhjLcVdFdHAEBBAEBFwEBB?= =?us-ascii?q?AEBgw4BAQEBAYFxtjaEEoYcAoFeTAEBAQEBAQEBAgECEAEBAQgLCwkZL4IyGAw?= =?us-ascii?q?5EFUCDV8CAQMSFRkBATcBDyAxNAEFARwZIogoo0GBMj4yilaFLgEBBYdYAQEBA?= =?us-ascii?q?QEBBAIBHAgQhBWCAQqJWoUQji92ij6PQolPhgyPCjGBEYMzDREKgW0cNIdjAQE?= =?us-ascii?q?B?= X-IPAS-Result: =?us-ascii?q?A0E9AwBhydFXhjLcVdFdHAEBBAEBFwEBBAEBgw4BAQEBAYF?= =?us-ascii?q?xtjaEEoYcAoFeTAEBAQEBAQEBAgECEAEBAQgLCwkZL4IyGAw5EFUCDV8CAQMSF?= =?us-ascii?q?RkBATcBDyAxNAEFARwZIogoo0GBMj4yilaFLgEBBYdYAQEBAQEBBAIBHAgQhBW?= =?us-ascii?q?CAQqJWoUQji92ij6PQolPhgyPCjGBEYMzDREKgW0cNIdjAQEB?= X-IronPort-AV: E=Sophos;i="5.30,302,1470700800"; d="scan'208";a="17391672" Received: from mail-pa0-f50.google.com ([209.85.220.50]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 08 Sep 2016 20:31:18 +0000 Received: by mail-pa0-f50.google.com with SMTP id cm16so20661382pac.0 for ; Thu, 08 Sep 2016 13:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20120917; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e1KRnwqRAiDhChbsgPsZn1SAXfYamdUlHHkAWXKB2eg=; b=BxorsPIOin+i1ygE5TiIuPlvz3PpEp1TYiU9BGTizMFjJArnDhnFIJUJK3QTHfZejZ Iq80UZpZfkSgAE8tBd5SVjBGpP4YNfm4DNhThJk6pOQl4np6bJbWXW3xeAEaOtWs8OlH Qk0EZf/6lSjCLxa4+78kday7wCooRS1NTR/M6+SacWvjCjRoCmvrDDrZmPG2lkOazoKp 4RkVMOfLLSCWE8QmwuKRhlWjmr52WQrLUugTpFl1bL+ucBjq7+OSusQlS+DhBG8+DQ/0 tnglHIPdcK5gkPbua/W2kfQv+suuGpvkpx1UEOCJoSQ9nuDcWKkqra9zez1bHTs+8zRA FMsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e1KRnwqRAiDhChbsgPsZn1SAXfYamdUlHHkAWXKB2eg=; b=Oz0SpD/h5UrOZPPw8/+pp3K/6xj0S3/sHbFvwHhJG9a1D8k00EwDWUi8U1tX/MBHDT WpV8eDK0vGPYga1A7nYhtADTsVXqvZng9/WSzWHCGRwCcg1dI6PNFDZekNC18ROadRN6 WVqHyfvT+QvrBEITb7IP9kqVW9AWWkTVWXxi2UR4rC99Puo5TANt00a5U2bK2Aw5AfxE blO50kWPn57bX2hW8Zyy2d32cNnxVLYQnuS+HUPBnrGeLCJhPhfgbANYWhcgdArH66yo cQqrVMoWeB5j0h/KpqoZsNIEsu/4xmb50ybbnB3sYl6jxDkEZEyhZLkopKIX+KtOnbJh df+g== X-Gm-Message-State: AE9vXwPn69kDNu8IMC/ffKcKIWuhNKBNl5ePDKNraGNj8W4z3vS1cUMoKh7J2iLJWOGfLQ== X-Received: by 10.66.249.164 with SMTP id yv4mr895923pac.89.1473366677681; Thu, 08 Sep 2016 13:31:17 -0700 (PDT) Received: from dcashman.mtv.corp.google.com ([172.22.115.19]) by smtp.gmail.com with ESMTPSA id 3sm42199731pai.48.2016.09.08.13.31.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Sep 2016 13:31:16 -0700 (PDT) From: Daniel Cashman To: selinux@tycho.nsa.gov Subject: [PATCH 2/5] libsepol: cil: Remove duplicate sid policy declaration. Date: Thu, 8 Sep 2016 13:30:49 -0700 Message-Id: <1473366652-23929-3-git-send-email-dcashman@android.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1473366652-23929-2-git-send-email-dcashman@android.com> References: <1473366652-23929-1-git-send-email-dcashman@android.com> <1473366652-23929-2-git-send-email-dcashman@android.com> X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: sds@tycho.nsa.gov MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: dcashman cil_gen_policy() creates two sets of sid declarations from CIL policy due to the combination of sidorder iteration and the CIL_SID case in the AST walk. Remove the sidorder iteration. Signed-off-by: Daniel Cashman --- libsepol/cil/src/cil_policy.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libsepol/cil/src/cil_policy.c b/libsepol/cil/src/cil_policy.c index 324becc..d8ef151 100644 --- a/libsepol/cil/src/cil_policy.c +++ b/libsepol/cil/src/cil_policy.c @@ -1272,10 +1272,6 @@ int cil_gen_policy(struct cil_db *db) policy_file = fopen("policy.conf", "w+"); - cil_list_for_each(item, db->sidorder) { - fprintf(file_arr[ISIDS], "sid %s ", ((struct cil_sid*)item->data)->datum.name); - } - cil_list_for_each(item, db->classorder) { struct cil_class *class = item->data; struct cil_tree_node *node = class->datum.nodes->head->data;