- Fixed no-root-config patch (bug #489055).

This commit is contained in:
Tim Waugh 2009-03-09 17:45:23 +00:00
parent 245e2a707c
commit ec8111936b
2 changed files with 22 additions and 19 deletions

View File

@ -1,21 +1,21 @@
diff -up hplip-3.9.2/base/g.py.no-root-config hplip-3.9.2/base/g.py diff -up hplip-3.9.2/base/g.py.no-root-config hplip-3.9.2/base/g.py
--- hplip-3.9.2/base/g.py.no-root-config 2009-02-20 00:36:51.000000000 +0000 --- hplip-3.9.2/base/g.py.no-root-config 2009-02-20 00:36:51.000000000 +0000
+++ hplip-3.9.2/base/g.py 2009-02-20 11:13:28.000000000 +0000 +++ hplip-3.9.2/base/g.py 2009-03-09 17:43:15.000000000 +0000
@@ -110,6 +110,10 @@ class ConfigBase(object): @@ -111,6 +111,10 @@ class ConfigBase(object):
keys = options
def read(self): def read(self):
if self.filename is not None:
+ filename = self.filename
+ if filename.startswith ("/root/") or filename.startswith ("/var/"): + if filename.startswith ("/root/") or filename.startswith ("/var/"):
+ # Don't try opening a file in root's home directory. + # Don't try opening a file in root's home directory.
+ return + return
+
if self.filename is not None:
try: try:
fp = open(self.filename, "r") fp = open(self.filename, "r")
@@ -119,6 +123,15 @@ class ConfigBase(object): self.conf.readfp(fp)
log.debug("Unable to open file %s for reading." % self.filename) @@ -120,6 +124,15 @@ class ConfigBase(object):
def write(self): def write(self):
if self.filename is not None:
+ filename = self.filename + filename = self.filename
+ if filename.startswith ("/root/") or filename.startswith ("/var/"): + if filename.startswith ("/root/") or filename.startswith ("/var/"):
+ # Don't try writing a file in root's home directory. + # Don't try writing a file in root's home directory.
@ -25,6 +25,6 @@ diff -up hplip-3.9.2/base/g.py.no-root-config hplip-3.9.2/base/g.py
+ # See bug #479178. + # See bug #479178.
+ return + return
+ +
if self.filename is not None:
try: try:
fp = open(self.filename, "w") fp = open(self.filename, "w")
self.conf.write(fp)

View File

@ -1,7 +1,7 @@
Summary: HP Linux Imaging and Printing Project Summary: HP Linux Imaging and Printing Project
Name: hplip Name: hplip
Version: 3.9.2 Version: 3.9.2
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv2+ and MIT License: GPLv2+ and MIT
Group: System Environment/Daemons Group: System Environment/Daemons
Conflicts: system-config-printer < 0.6.132 Conflicts: system-config-printer < 0.6.132
@ -326,6 +326,9 @@ fi
exit 0 exit 0
%changelog %changelog
* Mon Mar 9 2009 Tim Waugh <twaugh@redhat.com> 3.9.2-4
- Fixed no-root-config patch (bug #489055).
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9.2-3 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild