Skip to content

Commit

Permalink
gnome-shell.in: Really never add empty elements to LD_LIBRARY_PATH
Browse files Browse the repository at this point in the history
This complements the fix from c6eb276, to make sure that we don't use
the pre-existing $LD_LIBRARY_PATH if it's set but empty.

Both commits fix CVE-2010-4000.

https://bugzilla.gnome.org/show_bug.cgi?id=638728
  • Loading branch information
vuntz committed Jan 5, 2011
1 parent ad67225 commit 7beb7e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gnome-shell.in
Expand Up @@ -152,7 +152,7 @@ def start_dconf_await_service():
# dconf is linked without libtool, so unlike other GNOME modules,
# won't have an embedded rpath for its library directory.
env = dict(os.environ)
if 'LD_LIBRARY_PATH' in env:
if 'LD_LIBRARY_PATH' in env and env['LD_LIBRARY_PATH']:
ld_library_path = '@libdir@:' + env['LD_LIBRARY_PATH']
else:
ld_library_path = '@libdir@'
Expand Down Expand Up @@ -246,7 +246,7 @@ def start_shell(perf_output=None):
if pkgconfig.returncode == 0:
mozjs_libdir = re.sub('-(sdk|devel)', '', mozjs_sdkdir)
if os.path.exists(mozjs_libdir + '/libmozjs.so'):
if 'LD_LIBRARY_PATH' in env:
if 'LD_LIBRARY_PATH' in env and env['LD_LIBRARY_PATH']:
ld_library_path = env['LD_LIBRARY_PATH'] + ':' + mozjs_libdir
else:
ld_library_path = mozjs_libdir
Expand Down

0 comments on commit 7beb7e0

Please sign in to comment.