[Q] support for the OS X keychain

Aidan Kehoe kehoea at parhasard.net
Thu Jan 3 07:42:19 EST 2008


 Ar an triú lá de mí Eanair, scríobh Eric Knauel: 

 > Thank you for your suggestions, Stephen!  Here's a new version of the
 > patch.
 > 
 > On Sat 22 Dec 2007 21:17, "Stephen J. Turnbull" <stephen at xemacs.org> writes:
 > 
 > > Which versions have you tested with?  Since it's a module, I suppose
 > > it can be built to be used with *any* XEmacs supporting modules,
 > > including 21.4?  (Vin alert!)
 > 
 > I've tested the module with a recent 21.5 XEmacs with Mule support.
 > The keychain code relies on TO_EXTERNAL_FORMAT to convert a Lisp
 > string to malloced UTF-8 encoded C string (Apple's Carbon API wants
 > strings encoded as UTF-8).  The lisp.h of 21.4 does not seem to have
 > this macro. 

It’s in buffer.h.

 > I couldn't figure out how to convert the string with macros of 21.4 yet
 > --- maybe one of the 21.4 developers could give me some advice?

UTF-8 is not available as a coding system by default on 21.4. One awkward
way to work around that would be to check for non-ASCII in the strings, and
only do the translation if a) there are non-ASCII characters and b)
Ffind_coding_system (intern ("utf-8")) gives non-nil. 

 > [...]
 > > (2) `keychain-add' *should* be given an interactive interface that
 > > calls `read-password' for the password.  While `read-password' is only
 > > "semi-secure" (as its documentation says), it does limit the risk
 > > quite a bit.  And if you use `read-password', then improvements to it
 > > will automatically be used in the future.
 > 
 > Good point.  Seems to work with the new patch.  However, one issue
 > remains: The `passwd' library must be loaded before calling
 > `keychain-add' for the first time.  I'm wondering whether I have to
 > "autoload" or "require" the `passwd' library in some sense.  I found a
 > C function called `do_autoload' but I couldn't figure out what this
 > function does.  What do the XEmacs developers suggest in this case?

Frequire (intern("passwd"));

should work. 

-- 
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?



More information about the XEmacs-Patches mailing list