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:
Xin Ouyang 2013-01-17 16:32:51 +08:00
parent 4766a54dd8
commit 8d481d76a9
2 changed files with 31 additions and 0 deletions

View 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()

View 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}:')}"