#25 Win32/cygwin GPG failure (filenames)

windows/nt
open
nobody
None
5
2014-12-24
2002-07-07
Jari Aalto
No

the cygwin.com installation comes with the Unix gpg
binary. Unfortunately Mailcrypt does not check whaich
gpg version it is using and thus feeds DOS filenames,
when it should use Unix filenames under Win32/Cygwin
gpg port.

Trace attached. System is Win32/2000 Pro / Sp2

root@W2KPICASSO:~/tmp$ gpg --version
gpg: Please note that you don't have secure memory on
this system
gpg (GnuPG) 1.0.4

Signaling: (file-error "Spawning child process" "invalid
argument")
start-process("*GPG*" #<buffer *mailcrypt stdout
temp> "/bin/sh" "-c" "gpg --status-fd 3
3>e:/tmp/mailcrypt-gpg-status-1448sCl
2>e:/tmp/mailcrypt-gpg-stderr-1448f4e --passphrase-fd
0 --comment 'Processed by Mailcrypt 3.5.5
<http://mailcrypt.sourceforge.net/>' --batch --armor --
local-user 0xAA921233F701D4B3 --clearsign")
start-process-shell-command("*GPG*" #<buffer
*mailcrypt stdout temp> "gpg" "--status-
fd" "3" "3>e:/tmp/mailcrypt-gpg-status-
1448sCl" "2>e:/tmp/mailcrypt-gpg-stderr-1448f4e" "--
passphrase-fd" "0" "--comment" "'Processed by
Mailcrypt 3.5.5 <http://mailcrypt.sourceforge.net/>'" "--
batch" "--armor" "--local-
user" "0xAA921233F701D4B3" "--clearsign")
apply(start-process-shell-command "*GPG*" #<buffer
*mailcrypt stdout temp> "gpg" ("--status-
fd" "3" "3>e:/tmp/mailcrypt-gpg-status-
1448sCl" "2>e:/tmp/mailcrypt-gpg-stderr-1448f4e" "--
passphrase-fd" "0" "--comment" "'Processed by
Mailcrypt 3.5.5 <http://mailcrypt.sourceforge.net/>'" "--
batch" "--armor" "--local-
user" "0xAA921233F701D4B3" "--clearsign"))
(setq proc (apply (quote start-process-shell-
command) "*GPG*" mybuf program args))
(progn (setq mybuf (get-buffer-create " *mailcrypt
stdout temp")) (set-buffer mybuf) (erase-buffer) (set-buffer
obuf) (buffer-disable-undo mybuf) (if passwd (setq
args ...)) (setq args (append ... args)) (setq args
(append ... args)) (setq args (append ... args)) (if mc-gpg-
extra-args (setq args ...)) (mc-gpg-debug-print
(format "prog is %s, args are %s" program ...)) (setq
proc (apply ... "*GPG*" mybuf program args)) (if passwd
(progn ... ...)) (process-send-region proc beg end)
(process-send-eof proc) (while (eq ... ...) (accept-
process-output proc 5)) (setq status (process-status
proc)) (setq rc (process-exit-status proc)) (mc-gpg-
debug-print (format "prog finished, rc=%s" rc)) (delete-
process proc) (set-buffer mybuf) (goto-char (point-max))
(if (re-search-backward "\nProcess \\*GPG.*\n\\'" nil t)
(delete-region ... ...)) (goto-char (point-min)) (while
(search-forward "
\n" nil t) (replace-match "\n")) (if (or ... ...) (error "%s
exited abnormally: '%s'" program rc)) (if (= 127 rc)
(error "%s could not be found" program)) (setq stderr-buf
(get-buffer-create " *mailcrypt stderr temp")) (buffer-
disable-undo stderr-buf) (set-buffer stderr-buf) (erase-
buffer) (insert-file-contents stderr-tempfilename) (setq
status-buf (get-buffer-create " *mailcrypt status temp"))
(buffer-disable-undo status-buf) (set-buffer status-buf)
(erase-buffer) (insert-file-contents status-tempfilename)
(set-buffer mybuf) (setq parser-result (funcall parser
mybuf stderr-buf status-buf rc parserdata)) (mc-gpg-
debug-print (format " parser returned %s" parser-result))
(if (car parser-result) (progn ... ... ... ...)) (cdr parser-
result))
(unwind-protect (progn (setq mybuf ...) (set-buffer
mybuf) (erase-buffer) (set-buffer obuf) (buffer-disable-
undo mybuf) (if passwd ...) (setq args ...) (setq args ...)
(setq args ...) (if mc-gpg-extra-args ...) (mc-gpg-debug-
print ...) (setq proc ...) (if passwd ...) (process-send-
region proc beg end) (process-send-eof proc)
(while ... ...) (setq status ...) (setq rc ...) (mc-gpg-debug-
print ...) (delete-process proc) (set-buffer mybuf) (goto-
char ...) (if ... ...) (goto-char ...) (while ... ...) (if ... ...)
(if ... ...) (setq stderr-buf ...) (buffer-disable-undo stderr-
buf) (set-buffer stderr-buf) (erase-buffer) (insert-file-
contents stderr-tempfilename) (setq status-buf ...) (buffer-
disable-undo status-buf) (set-buffer status-buf) (erase-
buffer) (insert-file-contents status-tempfilename) (set-
buffer mybuf) (setq parser-result ...) (mc-gpg-debug-
print ...) (if ... ...) (cdr parser-result)) (if (and proc ...)
(interrupt-process proc)) (set-buffer obuf) (delete-file
stderr-tempfilename) (delete-file status-tempfilename) (if
(or ... ...) (progn ... ... ...)))
(let ((obuf ...) (process-connection-type nil) (shell-file-
name "/bin/sh") mybuf stderr-tempfilename stderr-buf
status-tempfilename status-buf proc rc status parser-
result) (mc-gpg-debug-print (format "(mc-gpg-process-
region beg=%s end=%s passwd=%s program=%s
args=%s parser=%s bufferdummy=%s)" beg end
passwd program args parser bufferdummy)) (setq stderr-
tempfilename (make-temp-name ...)) (setq status-
tempfilename (make-temp-name ...)) (unwind-protect
(progn ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ..
. ... ... ...) (if ... ...) (set-buffer obuf) (delete-file stderr-
tempfilename) (delete-file status-tempfilename) (if ... ...)))
mc-gpg-process-region(#<marker at 85 in *mail*>
#<marker at 244 in *mail*> "takamine" "gpg" ("--
comment" "'Processed by Mailcrypt 3.5.5
<http://mailcrypt.sourceforge.net/>'" "--batch" "--armor" "-
-local-user" "0xAA921233F701D4B3" "--clearsign") mc-
gpg-insert-parser #<buffer *MailCrypt*>)
(setq result (mc-gpg-process-region start end passwd
mc-gpg-path args (quote mc-gpg-insert-parser) buffer))
(let ((process-environment process-environment)
(buffer ...) passwd args key result) (setq key (mc-gpg-
lookup-key ... ...)) (setq passwd (mc-activate-
passwd ... ...)) (setq args (list "--batch" "--armor" "--local-
user" ... ...)) (if mc-gpg-comment (setq args ...)) (if mc-
gpg-extra-args (setq args ...)) (message "Signing as %
s ..." (car key)) (setq result (mc-gpg-process-region start
end passwd mc-gpg-path args ... buffer)) (if (car result)
(message "Signing as %s ... Done." ...) (progn ... ...))
(car result))
mc-gpg-sign-region(#<marker at 85 in *mail*>
#<marker at 244 in *mail*> nil nil)
funcall(mc-gpg-sign-region #<marker at 85 in *mail*>
#<marker at 244 in *mail*> nil nil)
(if (funcall (cdr ...) start end withkey unclearsig) (progn
(run-hooks ...) t))
mc-sign-generic(nil nil #<marker at 85 in *mail*>
#<marker at 244 in *mail*> nil)
(let ((headers-end ...)) (or withkey (progn ... ... ...)) (or
start (setq start headers-end)) (or end (setq end ...)) (mc-
sign-generic withkey scheme start end unclearsig))
(save-excursion (let (...) (or withkey ...) (or start ...) (or
end ...) (mc-sign-generic withkey scheme start end
unclearsig)))
mc-sign-message(nil nil nil nil nil)
funcall(mc-sign-message nil nil nil nil nil)
(let* ((mode-alist ...) (func ...) from scheme) (if (>= arg
16) (setq scheme ...)) (if (>= arg 4) (setq from ...))
(funcall func from scheme start end (< arg 0)))
mc-sign-region(1 nil nil)
mc-sign(1)
call-interactively(mc-sign)

Discussion

  • Brian Warner
    Brian Warner
    2002-09-28

    Logged In: YES
    user_id=24186

    Hmm, don't know how to fix this one. Mailcrypt uses
    (temp-directory) or temporary-file-directory to pick the
    directory. Is the "e:" thing really per-program, not
    per-platform? So every external program has to be tested to
    see what kind of directory syntax it wants to see? Hmm, for
    that matter, how can you tell? Does gpg compiled against
    cygwin put something different in the --version output?

    Any windows folks out there want to tackle this one?
    -Brian

     
  • Brian Warner
    Brian Warner
    2002-09-29

    • milestone: --> windows/nt
     
  • nega
    nega
    2007-11-25

    Logged In: YES
    user_id=346358
    Originator: NO

    Considering closing this bug. I don't have a Cygwin setup, and there are no follow ups for this.