List Info

Thread: 23.0.60; uid problems on w32




23.0.60; uid problems on w32
country flaguser name
Sweden
2008-03-29 17:09:07
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**

He also checked with Cygwin which gave other values than the
two 
different above for the uid:

  $ ls -ld server/
  drwxr-xr-x+ 2 my_user mkgroup-l-d 0 Mar 29 14:35 server/
  $ id
  uid=**60830**(my_user) gid=10545(mkgroup-l-d) 
groups=0(root),544(Administrators),545(Users),10545(mkgroup-
l-d)


If I do not misunderstand him he has got these values from
the unpatched 
version below.

In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
  of 2008-03-25



Re: 23.0.60; uid problems on w32
user name
2008-03-29 19:54:49
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.
Do you have the original report? There may be more
information in there.

>
> He also checked with Cygwin which gave other values
than the two 
> different above for the uid:

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



Re: 23.0.60; uid problems on w32
country flaguser name
Sweden
2008-03-29 20:07:42
Jason Rumney wrote:
> 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.
> Do you have the original report? There may be more
information in there.

This is what I got at the moment. I have asked for what
Windows Explorer 
shows too. If you want more information please see the web
page.

>> He also checked with Cygwin which gave other values
than the two 
>> different above for the uid:
> 
> I've got no idea what Cygwin does to emulate posix uids
on Windows, so 
> it is not surprising that it gets different results.

I tested with Cygwin on my pc and it looks like expected
there. All uid 
values are equal: (nth 2 attrs), (user-uid) in
server-ensure-safe-dir 
and the output from cygwin id. ls -l shows the same name as
cygwin id.



Re: 23.0.60; uid problems on w32
user name
2008-03-29 20:16:10
Lennart Borgman (gmail) wrote:
> This is what I got at the moment. I have asked for what
Windows 
> Explorer shows too. If you want more information please
see the web page.

If you have more information, please send it here.




Re: 23.0.60; uid problems on w32
country flaguser name
Sweden
2008-03-29 20:23:26
Jason Rumney wrote:
> Lennart Borgman (gmail) wrote:
>> This is what I got at the moment. I have asked for
what Windows 
>> Explorer shows too. If you want more information
please see the web page.
> 
> If you have more information, please send it here.

I have sent all information I have found relevant. If I get
more I will 
send it here.



Re: 23.0.60; uid problems on w32
user name
2008-03-29 23:14:35
>> 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.

Are you sure?  (+ 50830 14706) == 65536, so the two numbers
are
equal module 2^16.  I.e. one is "signed int16" and
the other is
"unsigned int16".


        Stefan



Re: 23.0.60; uid problems on w32
country flaguser name
United States
2008-03-30 00:23:58
> Date: Sat, 29 Mar 2008 23:09:07 +0100
> From: "Lennart Borgman (gmail)"
<lennart.borgmangmail.com>
> Cc: 
> 
> I have got at bug report from Thierry Daucourt through
> 
>    http:/
/www.emacswiki.org/cgi-bin/wiki/EmacsW32

Please ask that user to report problems here and participate
in this
discussion.  I don't have access to a Windows box where UID
is such a
large number, and talking through an intermediary is very
inefficient.

> 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**

Which versions of src/w32.c and src/dired.c were used in the
build of
EmacsW32 that this user used?  There were changes made there
recently,
so it's important to know precisely what code was used.

> He also checked with Cygwin which gave other values
than the two 
> different above for the uid:
> 
>   $ ls -ld server/
>   drwxr-xr-x+ 2 my_user mkgroup-l-d 0 Mar 29 14:35
server/
>   $ id
>   uid=**60830**(my_user) gid=10545(mkgroup-l-d) 
>
groups=0(root),544(Administrators),545(Users),10545(mkgroup-
l-d)

What do you mean by ``also checked with Cygwin''?  Does it
mean he
checked with Cygwin build of Emacs, or just that `ls' and
`id' used
above were Cygwin builds?



Re: 23.0.60; uid problems on w32
country flaguser name
United States
2008-03-30 00:30:42
> Date: Sun, 30 Mar 2008 00:54:49 +0000
> From: Jason Rumney <jasonrgnu.org>
> Cc: emacs-pretest-buggnu.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?



Re: 23.0.60; uid problems on w32
country flaguser name
United States
2008-03-30 00:31:34
> Date: Sun, 30 Mar 2008 03:07:42 +0200
> From: "Lennart Borgman (gmail)"
<lennart.borgmangmail.com>
> Cc: emacs-pretest-buggnu.org
> 
> I tested with Cygwin on my pc and it looks like
expected there. All uid 
> values are equal: (nth 2 attrs), (user-uid) in
server-ensure-safe-dir 
> and the output from cygwin id. ls -l shows the same
name as cygwin id.

What do you mean by ``tested with Cygwin''?  Was it a Cygwin
build of
Emacs or something else?



Re: 23.0.60; uid problems on w32
country flaguser name
United States
2008-03-30 00:40:02
> From: Stefan Monnier <monnieriro.umontreal.ca>
> Date: Sun, 30 Mar 2008 00:14:35 -0400
> Cc: emacs-pretest-buggnu.org,
> 	"Lennart Borgman (gmail)"
<lennart.borgmangmail.com>
> 
> >> 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.
> 
> Are you sure?  (+ 50830 14706) == 65536, so the two
numbers are
> equal module 2^16.  I.e. one is "signed
int16" and the other is
> "unsigned int16".

Actually, one (in `struct passwd') is `signed int', the
other (in
`struct stat') is `signed short'.  Darn that MS-supplied
stat.h!

Yes, this is probably the reason.

Jason, do we have any good reasons to use `struct stat' as
declared on
the system header?  If not, I'd say let's roll our own, and
be done
with this ugliness.  (It will also help us stop the
bit-juggling we do
to squeeze a 48-bit file index into a 16-bit st_ino.

I'm still clueless about why Cygwin shows 60830, while we
show 50830.
Ideas, anyone?



[1-10] [11-20] [21-22]

about | contact  Other archives ( Real Estate discussion Medical topics )