Univention Bugzilla – Attachment 6079 Details for
Bug 35368
Listener module cups-printers.py doesn't set uid(0) when loading UCR handlers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Skip writing cache if process has no write permission
35368_ucr-non-root-cache.diff (text/plain), 1.44 KB, created by
Philipp Hahn
on 2014-08-28 16:04:29 CEST
(
hide
)
Description:
Skip writing cache if process has no write permission
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2014-08-28 16:04:29 CEST
Size:
1.44 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/ucs-3.2-3/base/univention-config-registry/python/univention/config_registry/handler.py b/branches/ucs-3.2/ucs-3.2-3/base/univention-config-registry/python/univention/config_registry/handler.py >index da144fa..4a93a0a 100644 >--- a/branches/ucs-3.2/ucs-3.2-3/base/univention-config-registry/python/univention/config_registry/handler.py >+++ b/branches/ucs-3.2/ucs-3.2-3/base/univention-config-registry/python/univention/config_registry/handler.py >@@ -40,6 +40,7 @@ import random > import re > import subprocess > import cPickle >+import errno > from pwd import getpwnam > from grp import getgrnam > from univention.config_registry.misc import replace_umlaut, directory_files >@@ -739,13 +740,16 @@ class ConfigHandlers: > > def _save_cache(self): > """Write cache file.""" >- cache_file = open(ConfigHandlers.CACHE_FILE, 'w') >- cache_file.write(ConfigHandlers.VERSION_NOTICE) >- pickler = cPickle.Pickler(cache_file) >- pickler.dump(self._handlers) >- pickler.dump(self._subfiles) >- pickler.dump(self._multifiles) >- cache_file.close() >+ try: >+ with open(ConfigHandlers.CACHE_FILE, 'w') as cache_file: >+ cache_file.write(ConfigHandlers.VERSION_NOTICE) >+ pickler = cPickle.Pickler(cache_file) >+ pickler.dump(self._handlers) >+ pickler.dump(self._subfiles) >+ pickler.dump(self._multifiles) >+ except IOError as ex: >+ if ex.errno != errno.EACCES: >+ raise > > def register(self, package, ucr): > """Register new info file for package."""
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35368
: 6079