* [PATCH] org-mobile.org: Properly escape checksum binary path
@ 2015-04-07 18:33 Jacob Matthews
2015-04-10 8:28 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Jacob Matthews @ 2015-04-07 18:33 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 318 bytes --]
Hi ---
After lots of debugging last night on why MobileOrg wasn't seeing org-mode
files I pushed from my Windows computer, I found a bug in org-mobile.el
that appears to affect all platforms -- if the full path to the checksum
binary contains a space then checksumming will silently fail.
Attached is a fix.
-jacob
[-- Attachment #1.2: Type: text/html, Size: 420 bytes --]
[-- Attachment #2: 0001-org-mobile.org-Properly-escape-checksum-binary-path.patch --]
[-- Type: text/x-patch, Size: 1276 bytes --]
From 3a92b2a5411aabb096ad592efe7d2dc085653ee6 Mon Sep 17 00:00:00 2001
From: Jacob Matthews <matthewsj@google.com>
Date: Tue, 7 Apr 2015 12:52:25 -0500
Subject: [PATCH] org-mobile.org: Properly escape checksum binary path
* lisp/org-mobile.org (org-mobile-copy-agenda-files): Escape org-mobile-checksum-binary.
Fix a bug where if the checksum binary is in a non shell-safe path, then
the shell invocation silently fails. This can happen on any platform but
is probably worst on Windows where it's common to put programs in
"C:/Program Files".
---
lisp/org-mobile.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index c2828a9..2c13802 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -499,7 +499,8 @@ agenda view showing the flagged items."
(org-mobile-encrypt-and-move file target-path)
(copy-file file target-path 'ok-if-exists))
(setq check (shell-command-to-string
- (concat org-mobile-checksum-binary " "
+ (concat (shell-quote-argument org-mobile-checksum-binary)
+ " "
(shell-quote-argument (expand-file-name file)))))
(when (string-match "[a-fA-F0-9]\\{30,40\\}" check)
(push (cons link-name (match-string 0 check))
--
2.2.0.rc0.207.ga3a616c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] org-mobile.org: Properly escape checksum binary path
2015-04-07 18:33 [PATCH] org-mobile.org: Properly escape checksum binary path Jacob Matthews
@ 2015-04-10 8:28 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2015-04-10 8:28 UTC (permalink / raw)
To: Jacob Matthews; +Cc: emacs-orgmode
Hello,
Jacob Matthews <matthewsj@google.com> writes:
> After lots of debugging last night on why MobileOrg wasn't seeing org-mode
> files I pushed from my Windows computer, I found a bug in org-mobile.el
> that appears to affect all platforms -- if the full path to the checksum
> binary contains a space then checksumming will silently fail.
>
> Attached is a fix.
Applied. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-10 8:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-07 18:33 [PATCH] org-mobile.org: Properly escape checksum binary path Jacob Matthews
2015-04-10 8:28 ` Nicolas Goaziou
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).