diff --git a/hplip-no-root-config.patch b/hplip-no-root-config.patch index 20f2cc4..5ad3bbe 100644 --- a/hplip-no-root-config.patch +++ b/hplip-no-root-config.patch @@ -1,7 +1,23 @@ diff -up hplip-2.8.12/base/g.py.no-root-config hplip-2.8.12/base/g.py --- hplip-2.8.12/base/g.py.no-root-config 2008-12-17 20:41:12.000000000 +0000 -+++ hplip-2.8.12/base/g.py 2008-12-23 10:19:44.000000000 +0000 -@@ -107,6 +107,10 @@ class Config(dict): ++++ hplip-2.8.12/base/g.py 2009-01-12 12:22:31.000000000 +0000 +@@ -91,6 +91,15 @@ class ConfigSection(dict): + + self.config_obj.set(self.section_name, option, val) + ++ 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: + f = file(self.filename, 'w') + self.config_obj.write(f) +@@ -107,6 +116,10 @@ class Config(dict): log.debug("Reading config file %s" % filename) diff --git a/hplip.spec b/hplip.spec index 2020996..424e4f4 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 2.8.12 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -313,6 +313,9 @@ fi exit 0 %changelog +* Mon Jan 12 2009 Tim Waugh 2.8.12-2 +- Don't write to system-wide configuration file (bug #479178). + * Tue Dec 23 2008 Tim Waugh 2.8.12-1 - 2.8.12.