Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9CB8C282C0 for ; Sat, 26 Jan 2019 02:49:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32FBD21855 for ; Sat, 26 Jan 2019 02:49:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="GSPDETjx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726256AbfAZCt5 (ORCPT ); Fri, 25 Jan 2019 21:49:57 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43764 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbfAZCt5 (ORCPT ); Fri, 25 Jan 2019 21:49:57 -0500 Received: by mail-qt1-f194.google.com with SMTP id i7so12882082qtj.10 for ; Fri, 25 Jan 2019 18:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=SVSN9oBllk3UvhypxpZOBGDWK6BTFaz39yfWTcYtLGA=; b=GSPDETjxn7uoIXfBVA2eXTCD5kQ3XOVCqf/dky+vvbApMV1tgKiiixX5EEj7OqwCUn OK6SMe4CQSPIv5kCh9HuFpo24FUy3hOiCWOZ5xB88O862zVK6ep9RQcxM3oIU5G7612t 2VFYCd+PA97qYug5yriSRWDPPYjuVV1wLeEIU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SVSN9oBllk3UvhypxpZOBGDWK6BTFaz39yfWTcYtLGA=; b=qK7Th4DrHgHSAIxK3RWGvzN3TgMiNJtRZrIDCRh/0hlS4WJE2jdcKRmmA5S02NtEEm GdbqPZNt+U452zHh1U15JxGOvt/EId7R6oqA5DsZPC7fptedPN1Mbdq3iw4u76Gp2ZzT zMTcrMmVsHcTYI6pn+lKfOouRevDGD2eWXnRVzmxYCrUkvyOBXB5tn3JvwFpR3jrLXcd R2gdm+l7zhQ/FYFYNsm2XKXRzygLyUOvdU66/OEMkyXFsAmVzCihlNxFJsXjZ9xdkJdg 07anxdSekrOASqX8vCkN5hR8yF9yqfOXCOa9GGGCIBeceW1YIBcB9PUBqDrPC6utV1DF zkEA== X-Gm-Message-State: AJcUukcQ2zaTxNgh92bAMmoJbI+jOPpLbWZfw9Jvf7wT6QeJZPt6IW3L CPKeQNEG2PQzHmpiD2IODx1eVLZnn1k= X-Google-Smtp-Source: ALg8bN6CunOxP1qMcHOkV6+WNaQW/WJzIrylewppzQ4Z0xVaRtF6Hg9SPP5K01vqTgmZ+haHiv3S5w== X-Received: by 2002:ac8:3a22:: with SMTP id w31mr13293689qte.302.1548470996532; Fri, 25 Jan 2019 18:49:56 -0800 (PST) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id y70sm61630110qka.75.2019.01.25.18.49.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 18:49:55 -0800 (PST) Subject: Re: __pycache__ To: Russell Coker , "selinux-refpolicy@vger.kernel.org" References: <1857551.fKAPn0m0Tg@liv> From: Chris PeBenito Message-ID: <4b058ca2-e3b5-e8c8-1c1a-2e90b766cb08@ieee.org> Date: Fri, 25 Jan 2019 21:49:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1857551.fKAPn0m0Tg@liv> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/25/19 5:55 PM, Russell Coker wrote: > type=AVC msg=audit(1548301606.546:586): avc: denied { write } for pid=8055 > comm="semanage" name="__pycache__" dev="vda" ino=147333 > scontext=unconfined_u:unconfined_r:semanage_t:s0-s0:c0.c1023 > tcontext=unconfined_u:object_r:lib_t:s0 tclass=dir permissive=0 > > What can we do about these __pycache__ write attempts? Is there something the > distribution should be doing in terms of automatically generating those cache > files when packages are installed? It is possible to precompile the bytecode (Gentoo does this). python -m py_compile file1.py file2.py ... or recursively do all .py files: python -m compileall /path/to/files If you wanted, you could disable writing the bytecode by adding -B to the python command, though that's probably not what distros want to do. https://docs.python.org/3/library/py_compile.html https://docs.python.org/3/library/compileall.html -- Chris PeBenito