Issue 25615 - Spaces in username mean that LocalOfficeConnection won't connect
Summary: Spaces in username mean that LocalOfficeConnection won't connect
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC All
: P3 Trivial
Target Milestone: ---
Assignee: joachim.lingner
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-17 16:14 UTC by mhayes
Modified: 2013-02-24 21:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Run this application with the command line java -Duser.name="user name" to reproduce issue 25615 (491 bytes, text/plain)
2004-02-17 16:19 UTC, mhayes
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description mhayes 2004-02-17 16:14:26 UTC
I'm using LocalOfficeConnection to connect to staroffice. On Windows it is
possible to have a user name that contains spaces.
i.e. the value returned by java.lang.System.getProperty("user.name") can contain
spaces. 

LocalOfficeConnection uses this value to construct a URL for the pipe
connection, but of course if there are spaces in the URL then you have a
malformed url and an exception is thrown (which gets "swallowed" silently by
LocalOfficeConnection.
The LocalOfficeConnection is created but is not instantiated properly and the
instance of soffice is not launched.

You can test this by running java -Duser.name="user name" on any application
that instantiated LocalOfficeConnection
Comment 1 mhayes 2004-02-17 16:19:19 UTC
Created attachment 13234 [details]
Run this application with the command line java -Duser.name="user name" to reproduce issue 25615
Comment 2 stephan.wunderlich 2004-02-17 17:29:24 UTC
SW->MI: OfficeBean, sounds like something for you
Comment 3 stephan.wunderlich 2004-02-17 17:30:14 UTC
SW: reassigned
Comment 4 stephan.wunderlich 2004-02-17 17:35:00 UTC
SW->MI: something seems to go wrong in the method setUnoUrl. If the name
contains a space the returned url is NULL. If I set 
mURL	= url; 
at the beginning of this method all seems to work just fine.
Comment 5 ooo 2004-02-19 17:03:08 UTC
accepting
Comment 6 ooo 2004-05-13 15:11:43 UTC
verified in Linux (pro) + Windows (non-pro) version
Comment 7 ooo 2004-05-13 15:13:45 UTC
of course, its also fixed
Comment 8 ooo 2004-05-13 15:15:08 UTC
root cause: wrong API usage (format)
Comment 9 ooo 2004-05-17 12:00:02 UTC
reopening for forwarding to QA
Comment 10 ooo 2004-05-17 12:00:21 UTC
forwarding to QA
Comment 11 stephan.wunderlich 2004-05-19 10:10:08 UTC
SW: spaces are replaced by valid characters so that the gained url is valid. 
The name "user name" in the given sample is transformed to "user_20name_25B7Office" 
Comment 12 stephan.wunderlich 2004-05-19 10:11:12 UTC
SW: checked with the Bean-example that uses this class for connection => verified
Comment 13 stephan.wunderlich 2004-06-04 11:15:15 UTC
SW: ok in src680_m40 => closed
Comment 14 joachim.lingner 2006-04-20 13:18:40 UTC
Regression.
Comment 15 joachim.lingner 2006-04-20 13:19:29 UTC
.
Comment 16 joachim.lingner 2006-04-20 13:23:01 UTC
changed version to 2.0. OOo 1.x did not contain the OfficeBean. Then it was in
the SDK.
Comment 17 joachim.lingner 2006-04-20 13:27:04 UTC
suggested fix:
change in function LocalOfficeConnection.getPipeName
return replaceAll( replaceAll( java.net.URLEncoder.encode(aPipeName), "\\+",
"%20" ), "%", "_" );

to 
return replaceAll( replaceAll( java.net.URLEncoder.encode(aPipeName), "+", "%20"
), "%", "_" );
Comment 18 joachim.lingner 2006-05-22 14:50:57 UTC
Although the code worked before, the code that creates the pipename was slightly
wrong
Comment 19 joachim.lingner 2006-07-20 16:03:19 UTC
.
Comment 20 joachim.lingner 2006-08-10 08:23:46 UTC
Verified on m180.
Comment 21 Unknown 2010-11-10 16:55:11 UTC
Created attachment 73328