bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Built in function 'user-login-name "does the wrong thing"


From: David Johnson
Subject: Built in function 'user-login-name "does the wrong thing"
Date: Thu, 15 Nov 2001 13:23:45 +0000

Hi.

In GNU Emacs 20.7.1 (i386-*-nt5.0.2195) of Tue Jun 13 2000 on buffy
configured using `configure NT'

When I use the function 'user-login-name' with no arguments to get the name
of the current user, it returns an all-lower-case result.  So in a Lisp
Interaction buffer I get this:

        (user-login-name)^J
        "djohnson"

When I use it with the current user UID as an argument, I get a string with
case mappings that match the username as reported by the Domain Controller:

        (user-login-name (user-uid))^J
        "DJohnson"

I think this should probably be considered a bug.  Even though it most
likely originates with Microsoft, I guess a work-around would be pretty
easy.

My system is a Pentium-III running Windows 2000 Server, Service Pack 2.  I
am logged in as a domain user (not a local user).



This "feature" has a knock-on effect on the vc-hooks package, causing it to
think that CVS files have been edited by a different user, and so locking
them.  I implemented a simple workaround in version 1.114
       $Id: vc-hooks.el,v 1.114 1999/06/30 07:10:20 spiegel Exp $

diff -c listing follows:

*** vc-hooks.el~        Wed Jan 26 13:40:00 2000
--- vc-hooks.el Thu Nov 15 12:41:32 2001
***************
*** 645,651 ****
    ;; This function does the same as `user-login-name', but unlike
    ;; that, it never returns nil.  If a UID cannot be resolved, that
    ;; UID is returned as a string.
!   (or (user-login-name uid)
        (and uid (number-to-string uid))
        (number-to-string (user-uid))))

--- 645,656 ----
    ;; This function does the same as `user-login-name', but unlike
    ;; that, it never returns nil.  If a UID cannot be resolved, that
    ;; UID is returned as a string.
!
!   ;; Modified by David Johnson - if uid is omitted, use (user-uid)
instead.
!   ;; This compensates for a deficiency in Win32 where (user-login-name)
!   ;; is a lowercase-only version of (user-login-name (user-uid)).
!
!   (or (user-login-name (or uid (user-uid)))
        (and uid (number-to-string uid))
        (number-to-string (user-uid))))


I hope this is a suitable subject for bug-reporting.  Sorry if it isn't!

Rs,
        David Johnson

        mailto:address@hidden

David Johnson

MDL-UK Limited
Norwich House
Knoll Road
Camberley
Surrey GU15 3PR

Sometimes I think the surest sign that intelligent life exists elsewhere in
the universe is that none of it has tried to contact us.
                                 -- Calvin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]