Menu

#7 Emacs package corrupts files in Cygwin/X under WinXP

closed
nobody
None
5
2006-08-11
2005-12-09
MikeB
No

When I use jka-compr-ccrypt in GNU Emacs 21.2.1,
running under Cygwin/X on a WinXP machine, it routinely
corrupts the files that I'm trying to edit. If I take a
simple one-line text file, encrypt it using ccrypt,
open the encrypted file in emacs and add another line
or two, save the file, and exit emacs, I will find that
I either cannot decrypt the resulting file (because
ccrypt will no longer accept the old key) or that once
the file is decrypted everything but the first few
lines is gibberish.

Fortunately I found this bug before I tried using
jka-compr-ccrypt on anything important.

I don't know what's wrong but here's a potential hint:
when I create a plain text file (either by using echo
from the command line in a Cygwin xterm, or with emacs
itself) and open it up again in emacs, it doesn't
register as a DOS text file; it comes up as a Unix text
file. If I now encrypt the file with ccrypt and then
open the encrypted version in emacs with
jka-compr-ccrypt, the opened file will now appear as a
DOS text file - the little (DOS) indicator comes on in
the emacs status bar at the bottom left. Another clue
along the same lines: my corrupted files are mostly
gibberish, but the first few lines are legible...
however, those lines appear with ^M characters at the
end which were not there before.

I fear that jka-compr-ccrypt, or the elisp it depends
on, may be making unwarranted assumptions about my text
files being in DOS format...

Discussion

  • Peter Selinger

    Peter Selinger - 2006-01-14

    Logged In: YES
    user_id=160301

    Hi, I don't think I have replied to your message in
    December, have I? I must have gotten very busy around that time.

    Some questions.

    - Does anything like this happen if you use ccrypt on the
    command line, rather than from emacs?

    - Could you please test opening/writing gzipped text files
    (with the .gz extension), using jka-compr-ccrypt?
    Theoretically, it should be liable to the same issues, since
    gzip compression uses exactly the same mechanism (from
    emacs's point of view) as encryption (except there is no
    password of course). If you get similar errors, this might
    be a good place to start trying to diagnose and solve the
    problem. On the other hand, if .gz works correctly, we might
    be dealing with a problem specific to encryption.

    Please post your results.

    Thanks, -- Peter

     
  • Peter Selinger

    Peter Selinger - 2006-08-11

    Logged In: YES
    user_id=160301

    Closed due to incomplete information; could not verify bug.

     
  • Peter Selinger

    Peter Selinger - 2006-08-11
    • status: open --> closed
     

Log in to post a comment.