- Another go at avoiding AVC messages on boot (bug #244205).
This commit is contained in:
parent
3aab01c3fd
commit
26d55153b4
@ -1,28 +1,23 @@
|
|||||||
--- hplip-1.7.4a/base/g.py.no-root-config 2007-06-14 15:40:43.000000000 +0100
|
--- hplip-1.7.4a/base/g.py.no-root-config 2007-06-14 15:40:43.000000000 +0100
|
||||||
+++ hplip-1.7.4a/base/g.py 2007-06-14 15:43:21.000000000 +0100
|
+++ hplip-1.7.4a/base/g.py 2007-06-28 16:33:47.000000000 +0100
|
||||||
@@ -88,6 +88,16 @@
|
@@ -88,6 +88,10 @@
|
||||||
dict.__setattr__(self, "config_obj", ConfigParser.ConfigParser())
|
dict.__setattr__(self, "config_obj", ConfigParser.ConfigParser())
|
||||||
dict.__setattr__(self, "filename", filename)
|
dict.__setattr__(self, "filename", filename)
|
||||||
|
|
||||||
+ if filename.startswith ("/root/"):
|
+ if filename.startswith ("/root/") or os.getuid () == 0:
|
||||||
+ import sys, posixpath
|
+ # Don't try opening a file in root's home directory.
|
||||||
+ argv0 = sys.argv[0]
|
+ return
|
||||||
+ name = posixpath.basename (argv0)
|
|
||||||
+ if name == "hp" or name == "hpfax":
|
|
||||||
+ # Don't try opening a file in root's home directory. We are
|
|
||||||
+ # running as a CUPS backend, and doing so would cause an
|
|
||||||
+ # SELinux AVC message (bug #241776).
|
|
||||||
+ return
|
|
||||||
+
|
+
|
||||||
try:
|
try:
|
||||||
pathmode = os.stat(filename)[stat.ST_MODE]
|
pathmode = os.stat(filename)[stat.ST_MODE]
|
||||||
if pathmode & 0022 != 0:
|
if pathmode & 0022 != 0:
|
||||||
@@ -129,7 +139,8 @@
|
@@ -129,7 +133,9 @@
|
||||||
prop.sys_config_file = '/etc/hp/hplip.conf'
|
prop.sys_config_file = '/etc/hp/hplip.conf'
|
||||||
prop.user_config_file = os.path.expanduser('~/.hplip.conf')
|
prop.user_config_file = os.path.expanduser('~/.hplip.conf')
|
||||||
|
|
||||||
-if not os.path.exists(prop.user_config_file):
|
-if not os.path.exists(prop.user_config_file):
|
||||||
+if (not prop.user_config_file.startswith ("/root/") and
|
+if (not prop.user_config_file.startswith ("/root/") and
|
||||||
|
+ not os.getuid () == 0 and
|
||||||
+ not os.path.exists(prop.user_config_file)):
|
+ not os.path.exists(prop.user_config_file)):
|
||||||
try:
|
try:
|
||||||
file(prop.user_config_file, 'w').close()
|
file(prop.user_config_file, 'w').close()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 1.7.4a
|
Version: 1.7.4a
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: GPL/MIT/BSD
|
License: GPL/MIT/BSD
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Conflicts: system-config-printer < 0.6.132
|
Conflicts: system-config-printer < 0.6.132
|
||||||
@ -289,6 +289,9 @@ fi
|
|||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 28 2007 Tim Waugh <twaugh@redhat.com> 1.7.4a-3
|
||||||
|
- Another go at avoiding AVC messages on boot (bug #244205).
|
||||||
|
|
||||||
* Thu Jun 14 2007 Tim Waugh <twaugh@redhat.com> 1.7.4a-2
|
* Thu Jun 14 2007 Tim Waugh <twaugh@redhat.com> 1.7.4a-2
|
||||||
- Don't try to write a /root/.hplip.conf file when running as a CUPS
|
- Don't try to write a /root/.hplip.conf file when running as a CUPS
|
||||||
backend (bug #244205).
|
backend (bug #244205).
|
||||||
|
Loading…
Reference in New Issue
Block a user