SELinux-Refpolicy Archive on lore.kernel.org
 help / Atom feed
* __pycache__
@ 2019-01-25 22:55 Russell Coker
  2019-01-26  2:49 ` __pycache__ Chris PeBenito
  0 siblings, 1 reply; 2+ messages in thread
From: Russell Coker @ 2019-01-25 22:55 UTC (permalink / raw)
  To: selinux-refpolicy

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?

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: __pycache__
  2019-01-25 22:55 __pycache__ Russell Coker
@ 2019-01-26  2:49 ` Chris PeBenito
  0 siblings, 0 replies; 2+ messages in thread
From: Chris PeBenito @ 2019-01-26  2:49 UTC (permalink / raw)
  To: Russell Coker, selinux-refpolicy

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 22:55 __pycache__ Russell Coker
2019-01-26  2:49 ` __pycache__ Chris PeBenito

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org selinux-refpolicy@archiver.kernel.org
	public-inbox-index selinux-refpolicy


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/ public-inbox