From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.60; uid problems on w32 Date: Sun, 30 Mar 2008 01:30:42 -0400 Message-ID: References: <47EEBE03.9030104@gmail.com> <47EEE4D9.9090600@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1206855065 32227 80.91.229.12 (30 Mar 2008 05:31:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 05:31:05 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, lennart.borgman@gmail.com To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 30 07:31:35 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jfq8k-0001dw-Ot for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 07:31:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jfq88-0006bL-RX for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 01:30:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jfq81-0006ZP-UW for emacs-devel@gnu.org; Sun, 30 Mar 2008 01:30:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jfq7w-0006V5-3G for emacs-devel@gnu.org; Sun, 30 Mar 2008 01:30:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jfq7v-0006V2-US for emacs-devel@gnu.org; Sun, 30 Mar 2008 01:30:44 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jfq7v-0001xd-LU for emacs-devel@gnu.org; Sun, 30 Mar 2008 01:30:43 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Jfq7u-0002Dg-VJ; Sun, 30 Mar 2008 01:30:43 -0400 In-reply-to: <47EEE4D9.9090600@gnu.org> (message from Jason Rumney on Sun, 30 Mar 2008 00:54:49 +0000) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93872 gmane.emacs.pretest.bugs:21789 Archived-At: > Date: Sun, 30 Mar 2008 00:54:49 +0000 > From: Jason Rumney > Cc: emacs-pretest-bug@gnu.org > > 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?