Subject: Bug#4107: emacs leaves stale lockfiles and publishes pathnames

From: Ian Jackson <[email-masked]>
Date: Mon, 12 Aug 96 03:47 BST

Package: emacs
Version: 19.29-3

My /var/lib/emacs/lock directory contains many old lock files.

I'm quite happy to believe that the occasional leftover lock is
unavoidable, but steps should be taken to clean them up.

Furthermore, all the pathnames for the lockfiles are world-readable.
This is not what one would expect, and confidential information is not
infrequently present in filenames.  The best solution might be to put
the filename or other information about the file through a
cryptographically strong one-way function (eg SHA-1 or MD5) and only
include the filename in the file itself (which should be readable
only by owner).

I don't think all the files should be world-writeable, either.

Ian.

---

From: [email-masked] (Mark W. Eichin)
Date: 11 Aug 1996 23:48:02 -0400

first of all, 19.29 is way old -- 19.31 is the current package, and
19.32 is imminent. 

Second, the lock file names *have* to be world visible, in order for
locking to actually work among users... hmm, your suggestion of a
one-way hash make sense, I'll pass it upstream and see if it goes
anywhere (xemacs has built in md5 support, but emacs19 doesn't.)
Oddly enough, if you don't have long filename support, emacs uses a
CRC to create a short-enough hash of the filename...

I guess they don't need to be world writable either -- world readable
would suffice (the files contain the pid, and that's needed to
determine if the ostensibly locking process is still around...)

If you have particular security concerns, you could also set
EMACSLOCKDIR in your environment (setting it to something nonexistent
should defeat locking altogether; not sure though. It *won't* fall
back to the compiled in value.)

---

From: [email-masked] (Mark W. Eichin)
Date: 11 Aug 1996 23:48:23 -0400

---

From: Michael Shields <[email-masked]>
Date: Wed, 14 Aug 1996 20:00:42 +0000

>anywhere (xemacs has built in md5 support, but emacs19 doesn't.)

Since it doesn't need to be cryptographically secure, why not MD4?

--
Shields, CrossLink.