I'm having problems with efs/.netrc under the current CVS code.
When XEmacs first attempts to connect to a server using efs, it reads the .netrc file.
This process takes upwards of 2 minutes on my system, which did not used to happen.
I've narrowed the delay down to the following code (in xemacs-base/passwd.el) which
attempts to clear the contents of .netrc from XEmacs's memory in the interests of
security:
(defun passwd-erase-buffer ()
;; First erase the buffer, which will simply enlarge the gap.
;; Then insert null characters until the gap is filled with them
;; to prevent the old text from being visible in core files or kmem.
;; (Actually use 3x the size of the buffer just to be safe - a longer
;; passwd might have been typed and backspaced over.)
(interactive)
(widen)
(let ((s (* (buffer-size) 3)))
(erase-buffer)
(while (> s 0)
(insert ?\000)
(setq s (1- s)))
(erase-buffer)))
The while/insert loop is the limiting factor, and each iteration takes progressively
longer as the size of the buffer grows. If I comment out the insert, the loop (as one
would expect) is lightning fast.
I was wondering whether the following code could be used to replace the
while loop, although I expect the answer is "no":
(insert (make-string s ?\000))
Otherwise, does anyone have any ideas as to why this might be taking so
long? It seems like it might have something to do with font-lock changes I've been
making recently, but I tried backing out the changes and compiling a clean CVS version
(and I'm fairly certain it wasn't using any of my new code) and got the same
behavior.