Re: [PUSHED] Fixes fdo#60701 by escaping uri-encode path correctly

2013-03-11 Thread Stephan Bergmann

On 03/09/2013 12:05 PM, Stephan Bergmann wrote:

On 03/08/2013 08:47 PM, Arnaud Versini wrote:

My mistake, the good way I think is %q, not %b, is it correct or not ?


While that would solve the second part of the problem at least for Linux
(as %q is not Posix) I guess, the much simpler and more idiomatic
solution is to properly quote all uses of ${URI_ENCODE} in the script as
${URI_ENCODE}.

And, for the first part of the problem, you still need to properly quote
the argument to dirname, as given below.


Took the liberty to do that fix myself now, 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c32ac5104e9cade52c8a373033644282de9ceff 
fdo#60701: Properly quote shell parameter expansions, to increase 
chances to get this little low-risk fix into LO 4.0.2 still, 
https://gerrit.libreoffice.org/#/c/2661/.


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PUSHED] Fixes fdo#60701 by escaping uri-encode path correctly

2013-03-10 Thread Stephan Bergmann

On 03/09/2013 12:05 PM, Stephan Bergmann wrote:

On 03/08/2013 08:47 PM, Arnaud Versini wrote:

My mistake, the good way I think is %q, not %b, is it correct or not ?


While that would solve the second part of the problem at least for Linux
(as %q is not Posix) I guess,


Ach, come to think of it, even %q would not work---the backslashes it 
introduces into the value of URI_ENCODE would not be considered as 
quoting when expanding $URI_ENCODE.  Developing a working intuition for 
how the shell works is admittedly difficult.


Stephan

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PUSHED] Fixes fdo#60701 by escaping uri-encode path correctly

2013-03-09 Thread Stephan Bergmann

On 03/08/2013 08:47 PM, Arnaud Versini wrote:

My mistake, the good way I think is %q, not %b, is it correct or not ?


While that would solve the second part of the problem at least for Linux 
(as %q is not Posix) I guess, the much simpler and more idiomatic 
solution is to properly quote all uses of ${URI_ENCODE} in the script as 
${URI_ENCODE}.


And, for the first part of the problem, you still need to properly quote 
the argument to dirname, as given below.


Stephan


2013/3/8 Stephan Bergmann sberg...@redhat.com mailto:sberg...@redhat.com

On 03/08/2013 05:32 AM, Fridrich Strba (via Code Review) wrote:

Thank you for your patch!  It has been merged to LibreOffice.

If you are interested in details, please visit

https://gerrit.libreoffice.__org/2588
https://gerrit.libreoffice.org/2588

Approvals:
Fridrich Strba: Verified; Looks good to me, approved


But how does


diff --git a/shell/source/unix/misc/__senddoc.sh
b/shell/source/unix/misc/__senddoc.sh
index 0ff1594..a2c53fd 100644
--- a/shell/source/unix/misc/__senddoc.sh
+++ b/shell/source/unix/misc/__senddoc.sh
@@ -18,6 +18,7 @@
  #

  URI_ENCODE=`dirname $0`/uri-encode
+URI_ENCODE=$(printf %b $(URI_ENCODE))
  FOPTS=
  sd_platform=`uname -s`


fix https://bugs.freedesktop.org/__show_bug.cgi?id=60701
https://bugs.freedesktop.org/show_bug.cgi?id=60701 Send Document
as email fails, when application is installed to a directory with a
space in any way?

The solution should be to properly quote the argument to dirname,

URI_ENCODE=`dirname $0`/uri-encode


What the printf '%b' does is break things if the path to LO contains
character sequences like \n.


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PUSHED] Fixes fdo#60701 by escaping uri-encode path correctly

2013-03-08 Thread Stephan Bergmann

On 03/08/2013 05:32 AM, Fridrich Strba (via Code Review) wrote:

Thank you for your patch!  It has been merged to LibreOffice.

If you are interested in details, please visit

 https://gerrit.libreoffice.org/2588

Approvals:
   Fridrich Strba: Verified; Looks good to me, approved


But how does


diff --git a/shell/source/unix/misc/senddoc.sh 
b/shell/source/unix/misc/senddoc.sh
index 0ff1594..a2c53fd 100644
--- a/shell/source/unix/misc/senddoc.sh
+++ b/shell/source/unix/misc/senddoc.sh
@@ -18,6 +18,7 @@
 #

 URI_ENCODE=`dirname $0`/uri-encode
+URI_ENCODE=$(printf %b $(URI_ENCODE))
 FOPTS=
 sd_platform=`uname -s`



fix https://bugs.freedesktop.org/show_bug.cgi?id=60701 Send Document 
as email fails, when application is installed to a directory with a 
space in any way?


The solution should be to properly quote the argument to dirname,


URI_ENCODE=`dirname $0`/uri-encode


What the printf '%b' does is break things if the path to LO contains 
character sequences like \n.


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PUSHED] Fixes fdo#60701 by escaping uri-encode path correctly

2013-03-08 Thread Arnaud Versini
Hello

My mistake, the good way I think is %q, not %b, is it correct or not ?

Thanks in advance


2013/3/8 Stephan Bergmann sberg...@redhat.com

 On 03/08/2013 05:32 AM, Fridrich Strba (via Code Review) wrote:

 Thank you for your patch!  It has been merged to LibreOffice.

 If you are interested in details, please visit

  
 https://gerrit.libreoffice.**org/2588https://gerrit.libreoffice.org/2588

 Approvals:
Fridrich Strba: Verified; Looks good to me, approved


 But how does


  diff --git a/shell/source/unix/misc/**senddoc.sh
 b/shell/source/unix/misc/**senddoc.sh
 index 0ff1594..a2c53fd 100644
 --- a/shell/source/unix/misc/**senddoc.sh
 +++ b/shell/source/unix/misc/**senddoc.sh
 @@ -18,6 +18,7 @@
  #

  URI_ENCODE=`dirname $0`/uri-encode
 +URI_ENCODE=$(printf %b $(URI_ENCODE))
  FOPTS=
  sd_platform=`uname -s`


 fix 
 https://bugs.freedesktop.org/**show_bug.cgi?id=60701https://bugs.freedesktop.org/show_bug.cgi?id=60701
 Send Document as email fails, when application is installed to a directory
 with a space in any way?

 The solution should be to properly quote the argument to dirname,

  URI_ENCODE=`dirname $0`/uri-encode


 What the printf '%b' does is break things if the path to LO contains
 character sequences like \n.

 Stephan
 __**_
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.**org LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/**mailman/listinfo/libreofficehttp://lists.freedesktop.org/mailman/listinfo/libreoffice




-- 
Arnaud Versini
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PUSHED] Fixes fdo#60701 by escaping uri-encode path correctly

2013-03-07 Thread Fridrich Strba (via Code Review)
Hi,

Thank you for your patch!  It has been merged to LibreOffice.

If you are interested in details, please visit

https://gerrit.libreoffice.org/2588

Approvals:
  Fridrich Strba: Verified; Looks good to me, approved


-- 
To view, visit https://gerrit.libreoffice.org/2588
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If1242623f4954c0cb8c6c938608cd3185e652259
Gerrit-PatchSet: 3
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Arnaud Versini arnaud.vers...@gmail.com
Gerrit-Reviewer: Arnaud Versini arnaud.vers...@gmail.com
Gerrit-Reviewer: Fridrich Strba fridr...@documentfoundation.org

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice