rpms/hplip/devel hplip-no-root-config.patch, 1.2, 1.3 hplip.spec, 1.133, 1.134
Tim Waugh (twaugh)
fedora-extras-commits at redhat.com
Thu Jun 28 15:34:30 UTC 2007
Author: twaugh
Update of /cvs/pkgs/rpms/hplip/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32420
Modified Files:
hplip-no-root-config.patch hplip.spec
Log Message:
* Thu Jun 28 2007 Tim Waugh <twaugh at redhat.com> 1.7.4a-3
- Another go at avoiding AVC messages on boot (bug #244205).
hplip-no-root-config.patch:
Index: hplip-no-root-config.patch
===================================================================
RCS file: /cvs/pkgs/rpms/hplip/devel/hplip-no-root-config.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- hplip-no-root-config.patch 14 Jun 2007 14:44:36 -0000 1.2
+++ hplip-no-root-config.patch 28 Jun 2007 15:34:25 -0000 1.3
@@ -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 2007-06-14 15:43:21.000000000 +0100
-@@ -88,6 +88,16 @@
++++ hplip-1.7.4a/base/g.py 2007-06-28 16:33:47.000000000 +0100
+@@ -88,6 +88,10 @@
dict.__setattr__(self, "config_obj", ConfigParser.ConfigParser())
dict.__setattr__(self, "filename", filename)
-+ if filename.startswith ("/root/"):
-+ import sys, posixpath
-+ argv0 = sys.argv[0]
-+ 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
++ if filename.startswith ("/root/") or os.getuid () == 0:
++ # Don't try opening a file in root's home directory.
++ return
+
try:
pathmode = os.stat(filename)[stat.ST_MODE]
if pathmode & 0022 != 0:
-@@ -129,7 +139,8 @@
+@@ -129,7 +133,9 @@
prop.sys_config_file = '/etc/hp/hplip.conf'
prop.user_config_file = os.path.expanduser('~/.hplip.conf')
-if not os.path.exists(prop.user_config_file):
+if (not prop.user_config_file.startswith ("/root/") and
++ not os.getuid () == 0 and
+ not os.path.exists(prop.user_config_file)):
try:
file(prop.user_config_file, 'w').close()
Index: hplip.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hplip/devel/hplip.spec,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- hplip.spec 14 Jun 2007 14:44:36 -0000 1.133
+++ hplip.spec 28 Jun 2007 15:34:25 -0000 1.134
@@ -1,7 +1,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 1.7.4a
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPL/MIT/BSD
Group: System Environment/Daemons
Conflicts: system-config-printer < 0.6.132
@@ -289,6 +289,9 @@
exit 0
%changelog
+* Thu Jun 28 2007 Tim Waugh <twaugh at redhat.com> 1.7.4a-3
+- Another go at avoiding AVC messages on boot (bug #244205).
+
* Thu Jun 14 2007 Tim Waugh <twaugh at redhat.com> 1.7.4a-2
- Don't try to write a /root/.hplip.conf file when running as a CUPS
backend (bug #244205).
More information about the fedora-extras-commits
mailing list