mirror of
git://git.yoctoproject.org/meta-selinux
synced 2026-01-01 13:58:04 +00:00
python: disable exit handler to rw history file
oe-core adds a exit handler to rw python command history file (~/.python-history). There are no allow rules for every user&role to use create/read/write ~/.python-history, and it is also improper to add rules because these rules would blow up the user&role's scope of authority. So disable the handler, if selinux enabled. Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
This commit is contained in:
parent
4766a54dd8
commit
8d481d76a9
26
recipes-devtools/python/python/sitecustomize.py
Normal file
26
recipes-devtools/python/python/sitecustomize.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
|
||||
# GPLv2 or later
|
||||
# Version: 20081123
|
||||
# Features:
|
||||
# * set proper default encoding
|
||||
# Features removed for SELinux:
|
||||
# * enable readline completion in the interactive interpreter
|
||||
# * load command line history on startup
|
||||
# * save command line history on exit
|
||||
|
||||
import os
|
||||
|
||||
def __enableDefaultEncoding():
|
||||
import sys
|
||||
try:
|
||||
sys.setdefaultencoding( "utf8" )
|
||||
except LookupError:
|
||||
pass
|
||||
|
||||
import sys
|
||||
try:
|
||||
import rlcompleter, readline
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
__enableDefaultEncoding()
|
||||
5
recipes-devtools/python/python_2.7.2.bbappend
Normal file
5
recipes-devtools/python/python_2.7.2.bbappend
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
PR .= ".1"
|
||||
|
||||
inherit selinux
|
||||
# If selinux enabled, disable handlers to rw command history file
|
||||
FILESEXTRAPATHS_prepend := "${@target_selinux(d, '${THISDIR}/${PN}:')}"
|
||||
Loading…
Reference in New Issue
Block a user