- Fixed no-root-config patch (bug #489055).
This commit is contained in:
parent
245e2a707c
commit
ec8111936b
@ -1,30 +1,30 @@
|
|||||||
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 filename.startswith ("/root/") or filename.startswith ("/var/"):
|
|
||||||
+ # Don't try opening a file in root's home directory.
|
|
||||||
+ return
|
|
||||||
+
|
|
||||||
if self.filename is not None:
|
if self.filename is not None:
|
||||||
|
+ filename = self.filename
|
||||||
|
+ if filename.startswith ("/root/") or filename.startswith ("/var/"):
|
||||||
|
+ # Don't try opening a file in root's home directory.
|
||||||
|
+ return
|
||||||
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):
|
||||||
+ filename = self.filename
|
|
||||||
+ if filename.startswith ("/root/") or filename.startswith ("/var/"):
|
|
||||||
+ # Don't try writing a file in root's home directory.
|
|
||||||
+ return
|
|
||||||
+ elif filename.startswith ("/etc/"):
|
|
||||||
+ # Certainly don't try writing the system-wide config file!
|
|
||||||
+ # See bug #479178.
|
|
||||||
+ return
|
|
||||||
+
|
|
||||||
if self.filename is not None:
|
if self.filename is not None:
|
||||||
|
+ filename = self.filename
|
||||||
|
+ if filename.startswith ("/root/") or filename.startswith ("/var/"):
|
||||||
|
+ # Don't try writing a file in root's home directory.
|
||||||
|
+ return
|
||||||
|
+ elif filename.startswith ("/etc/"):
|
||||||
|
+ # Certainly don't try writing the system-wide config file!
|
||||||
|
+ # See bug #479178.
|
||||||
|
+ return
|
||||||
|
+
|
||||||
try:
|
try:
|
||||||
fp = open(self.filename, "w")
|
fp = open(self.filename, "w")
|
||||||
|
self.conf.write(fp)
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user