usr/bin/libreoffice script bad symlink following
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LibreOffice |
Fix Released
|
Medium
|
|||
libreoffice (Debian) |
Fix Released
|
Unknown
|
|||
libreoffice (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
1:4.0.0~
content of usr/bin/
sd_cwd=`pwd`
sd_res=$0
while [ -h "$sd_res" ] ; do
cd "`dirname "$sd_res"`"
sd_
sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
done
cd "`dirname "$sd_res"`"
sd_prog=`pwd`
cd "$sd_cwd"
sd_res is a symlink in ubuntu so it goes in there
please use something sane like readlink to get the target instead of that weird sed line
a user in #ubuntu+1 reports issues with it because he apparently has some invalid locale in the month part of ls -l:
he gets:
02:04 <Allard> /usr/bin/
02:04 <Allard> /usr/bin/
Changed in libreoffice (Debian): | |
status: | Unknown → New |
Changed in libreoffice (Ubuntu): | |
status: | Confirmed → Fix Committed |
Changed in df-libreoffice: | |
importance: | Unknown → Medium |
status: | Unknown → Incomplete |
Changed in df-libreoffice: | |
status: | Incomplete → Fix Released |
Changed in libreoffice (Ubuntu): | |
status: | Fix Committed → Fix Released |
Changed in libreoffice (Debian): | |
status: | New → Fix Released |
Problem description:
I ran into this problem last year, in the same month, and here I am again. This section of code is in /usr/lib/ libreoffice/ program/ soffice:
------- ------- ------- ------ basename= `basename "$0"` ------- ------- ----
# resolve installation directory
sd_cwd="`pwd`"
if [ -h "$0" ] ; then
sd_
sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
cd "`dirname "$0"`"
cd "`dirname "$sd_script"`"
else
cd "`dirname "$0"`"
fi
sd_prog=`pwd`
cd "$sd_cwd"
-------
The gentoo developers rightly refer to this code as "completely broken", as it causes LibreOffice to puke on launch when trying to determine the month string of its working directory if used on a system for which certain months use non-standard characters.
For instance, in Gremany, the current month is "März." Launching LO any time between now and 2013-04-01 will cause LO to fail with the following error:
------- ------- ------- ------- - libreoffice: line 58: cd: lrwxrwxrwx 1 root root 38 10. Mä/usr/ lib64/libreoffi ce/program: No such file or directory libreoffice: line 180: /usr/bin/oosplash: No such file or directory ------- ------- ------- ----
$ libreoffice
ls: error initializing month strings
/usr/bin/
/usr/bin/
-------
Steps to reproduce:
1. set the filesystem locale to German (any variant)
2. try to launch LO in the month of March
3. cry
Current behavior: the launcher pukes
Expected behavior: the launcher could maybe use a coreutil that is pretty good at reading month strings? In any case, it should launch properly.
Cheers,
Operating System: Linux (Other)
Version: 4.0.1.2 release