diff options
Diffstat (limited to 'dev-util/dogtail/files/dogtail-0.9.0-get-user.patch')
-rw-r--r-- | dev-util/dogtail/files/dogtail-0.9.0-get-user.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dev-util/dogtail/files/dogtail-0.9.0-get-user.patch b/dev-util/dogtail/files/dogtail-0.9.0-get-user.patch new file mode 100644 index 000000000000..07a6ad807467 --- /dev/null +++ b/dev-util/dogtail/files/dogtail-0.9.0-get-user.patch @@ -0,0 +1,28 @@ +Do not use USER as it can be unset. + +Use LOGNAME first as recommended by python documentation, then try alternatives. + +Also, use tempfile to respect environment variables changing tmpdir. + +Upstream: https://fedorahosted.org/dogtail/ticket/46 +Debian: http://bugs.debian.org/743500 + +--- a/dogtail/config.py 2015-06-08 22:59:08.664107350 +0200 ++++ b/dogtail/config.py 2015-06-08 22:57:54.433669729 +0200 +@@ -6,11 +6,15 @@ __author__ = "Zack Cerza <zcerza@redhat.com>, David Malcolm <dmalcolm@redhat.com + import os + import sys + import locale ++import tempfile + + + def _userTmpDir(baseName): + # i.e. /tmp/dogtail-foo +- return '-'.join(('/'.join(('/tmp', baseName)), os.environ['USER'])) ++ return '-'.join(( ++ '/'.join((tempfile.gettempdir(), baseName)), ++ os.getenv('LOGNAME', os.getenv('USER', os.getlogin())) ++ )) + + + class _Config(object): |