- Prevent hpfax trying to load configuration files as user lp.
This commit is contained in:
parent
d4173d21e8
commit
328ac77d5e
@ -1,17 +1,18 @@
|
|||||||
--- hplip-2.7.6/base/g.py.no-root-config 2007-06-18 17:56:32.000000000 +0100
|
diff -up hplip-2.7.7/base/g.py.no-root-config hplip-2.7.7/base/g.py
|
||||||
+++ hplip-2.7.6/base/g.py 2007-06-29 17:58:29.000000000 +0100
|
--- hplip-2.7.7/base/g.py.no-root-config 2007-06-18 17:56:32.000000000 +0100
|
||||||
@@ -105,6 +105,10 @@
|
+++ hplip-2.7.7/base/g.py 2007-09-25 15:23:23.000000000 +0100
|
||||||
|
@@ -105,6 +105,10 @@ class Config(dict):
|
||||||
|
|
||||||
log.debug("Reading config file %s" % filename)
|
log.debug("Reading config file %s" % filename)
|
||||||
|
|
||||||
+ if filename.startswith ("/root/"):
|
+ 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
|
||||||
+
|
+
|
||||||
try:
|
try:
|
||||||
f = file(filename, 'r')
|
f = file(filename, 'r')
|
||||||
self.config_obj.readfp(f)
|
self.config_obj.readfp(f)
|
||||||
@@ -134,23 +138,24 @@
|
@@ -134,23 +138,25 @@ class Config(dict):
|
||||||
# Config file: directories and ports
|
# Config file: directories and ports
|
||||||
prop.sys_config_file = '/etc/hp/hplip.conf'
|
prop.sys_config_file = '/etc/hp/hplip.conf'
|
||||||
prop.user_dir = os.path.expanduser('~/.hplip')
|
prop.user_dir = os.path.expanduser('~/.hplip')
|
||||||
@ -26,7 +27,8 @@
|
|||||||
prop.user_config_file = os.path.join(prop.user_dir, 'hplip.conf')
|
prop.user_config_file = os.path.join(prop.user_dir, '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/") or
|
||||||
|
+ prop.user_config_file.startswith ("/var/")) and
|
||||||
+ not os.getuid () == 0):
|
+ not os.getuid () == 0):
|
||||||
+ os.umask(0037)
|
+ os.umask(0037)
|
||||||
try:
|
try:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 2.7.7
|
Version: 2.7.7
|
||||||
Release: 4%{?dist}
|
Release: 5%{?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
|
||||||
@ -278,6 +278,9 @@ fi
|
|||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Sep 25 2007 Tim Waugh <twaugh@redhat.com> 2.7.7-5
|
||||||
|
- Prevent hpfax trying to load configuration files as user lp.
|
||||||
|
|
||||||
* Thu Sep 6 2007 Tim Waugh <twaugh@redhat.com> 2.7.7-4
|
* Thu Sep 6 2007 Tim Waugh <twaugh@redhat.com> 2.7.7-4
|
||||||
- Reverted udev rules change.
|
- Reverted udev rules change.
|
||||||
- Ship a HAL FDI file to get correct access control on the USB device
|
- Ship a HAL FDI file to get correct access control on the USB device
|
||||||
|
Loading…
Reference in New Issue
Block a user