emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.0.60; uid problems on w32


From: Eli Zaretskii
Subject: Re: 23.0.60; uid problems on w32
Date: Sun, 30 Mar 2008 01:30:42 -0400

> Date: Sun, 30 Mar 2008 00:54:49 +0000
> From: Jason Rumney <address@hidden>
> Cc: address@hidden
> 
> Lennart Borgman (gmail) wrote:
> > I have got at bug report from Thierry Daucourt through
> >
> >   http://www.emacswiki.org/cgi-bin/wiki/EmacsW32
> >
> > It looks like this could be a bug in Emacs. The crucial part of that 
> > bug report are the values investigated at the end of 
> > `server-ensure-safe-dir' where the user get the following for 
> > file-attributes and user-id:
> >
> >  attrs (t 1 -14706 513 (18414 17797) (18414 17797) (18414 17797) 0 
> > drwxrwxrwx
> >  nil 34842 (7173 . 33003))
> >  nth 2 attrs **-14706**
> >  user id **50830**
> 
> It appears the directory in question was created by a different user.

Emacs currently doesn't query the filesystem about the true owner of
the files; instead, it gives each file uid and gid of the current
user, as determined at startup.  So even if the directory was created
by someone else, Emacs will currently pretend it belongs to the
current user.  Thus, both values should match exactly.

> I've got no idea what Cygwin does to emulate posix uids on Windows, so 
> it is not surprising that it gets different results.

AFAIK, Cygwin uses the same RID values that we now use in
init_user_info on the trunk.  Except that we also do this:

              /* Restrict to conventional uid range for normal users.  */
              the_passwd.pw_uid %= 60001;

Do you have any idea why this is done?  I'm inclined to remove this
line, unless we have a good reason to keep it.

I thought that perhaps this modulo operation can explain why Cygwin
shows 60830 whereas we show 50830, but it looks like modulo 60001
cannot explain this, can it?




reply via email to

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