unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What to do with too-large group ids?
@ 2002-07-27  9:33 Kai Großjohann
  2002-07-27 14:12 ` Simon Josefsson
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2002-07-27  9:33 UTC (permalink / raw)


Tramp does "ls -l" on the remote host to snarf all the info that's
needed for file-attributes.  But what do I do if the user id or group
id printed is too large for an Emacs integer?

Maybe I should just use -1 or something...

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-27  9:33 What to do with too-large group ids? Kai Großjohann
@ 2002-07-27 14:12 ` Simon Josefsson
  2002-07-27 15:47   ` Kai Großjohann
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Josefsson @ 2002-07-27 14:12 UTC (permalink / raw)
  Cc: emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Tramp does "ls -l" on the remote host to snarf all the info that's
> needed for file-attributes.  But what do I do if the user id or group
> id printed is too large for an Emacs integer?

The file-attributes documentation doesn't say that uid/gid can be cons
pairs when uid/gid is higher than the integer limit, is that a bug?

But I guess it would be possible to write a parser for big integers to
split it into a cons pairs, which probably is what file-attributes
returns if uid/gid is too large.  Perhaps there already is someone in
emacs?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-27 14:12 ` Simon Josefsson
@ 2002-07-27 15:47   ` Kai Großjohann
  2002-07-27 20:53     ` Simon Josefsson
  2002-07-29  1:12     ` Richard Stallman
  0 siblings, 2 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-07-27 15:47 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> The file-attributes documentation doesn't say that uid/gid can be cons
> pairs when uid/gid is higher than the integer limit, is that a bug?

The documentation appears to agree with the code: some numbers can be
conses, but uid/gid cannot.

I think I'll use -1 -- that's what Ange-FTP does.  Emacs is kind
enough to return -1 when parsing a too-large number already, so now I
only have to do a fix for XEmacs.  For that, I'll have to talk to some
other people, though :-)

Sorry for the line-noise,
kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-27 15:47   ` Kai Großjohann
@ 2002-07-27 20:53     ` Simon Josefsson
  2002-07-28 10:17       ` Kai Großjohann
  2002-07-29  1:12     ` Richard Stallman
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Josefsson @ 2002-07-27 20:53 UTC (permalink / raw)
  Cc: emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Simon Josefsson <jas@extundo.com> writes:
>
>> The file-attributes documentation doesn't say that uid/gid can be cons
>> pairs when uid/gid is higher than the integer limit, is that a bug?
>
> The documentation appears to agree with the code: some numbers can be
> conses, but uid/gid cannot.
>
> I think I'll use -1 -- that's what Ange-FTP does.  Emacs is kind
> enough to return -1 when parsing a too-large number already, so now I
> only have to do a fix for XEmacs.  For that, I'll have to talk to some
> other people, though :-)

Err, but isn't this a bug in file-attributes?  I believe there are
systems where uid/gid is 32bit.  Does Emacs just break on those
systems?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-27 20:53     ` Simon Josefsson
@ 2002-07-28 10:17       ` Kai Großjohann
  0 siblings, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-07-28 10:17 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
>
>> The documentation appears to agree with the code: some numbers can be
>> conses, but uid/gid cannot.
>
> Err, but isn't this a bug in file-attributes?  I believe there are
> systems where uid/gid is 32bit.  Does Emacs just break on those
> systems?

I don't know if it's a bug.  Anyone?

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-27 15:47   ` Kai Großjohann
  2002-07-27 20:53     ` Simon Josefsson
@ 2002-07-29  1:12     ` Richard Stallman
  2002-07-29  7:36       ` Kai Großjohann
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2002-07-29  1:12 UTC (permalink / raw)
  Cc: emacs-devel

You could return large uids as strings.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-29  1:12     ` Richard Stallman
@ 2002-07-29  7:36       ` Kai Großjohann
  2002-07-29  8:08         ` Paul Eggert
                           ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-07-29  7:36 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> You could return large uids as strings.

They might easily be confused for user names in that case.  Also, the
very same function uses the trick of using a cons for the device
number, so it might be an idea to use the same trick for the user id.

But if you prefer, I'll return them as strings and update the
documentation for file-attributes accordingly.  (Something like the
following, wording needs to be changed: If the user id is too large
for an int, it is returned as a string.  This never happens for normal
files, but it might happen when there is a filename handler.)

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-29  7:36       ` Kai Großjohann
@ 2002-07-29  8:08         ` Paul Eggert
  2002-07-29  9:11         ` Andreas Schwab
  2002-07-30  0:59         ` Richard Stallman
  2 siblings, 0 replies; 11+ messages in thread
From: Paul Eggert @ 2002-07-29  8:08 UTC (permalink / raw)
  Cc: emacs-devel

> From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai
> Date: Mon, 29 Jul 2002 09:36:58 +0200
> 
> Richard Stallman <rms@gnu.org> writes:
> 
> > You could return large uids as strings.
> 
> They might easily be confused for user names in that case.

Then why not return them as floating-point numbers instead?  This is
what's already done for file sizes, if they are out of range for an
integer.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-29  7:36       ` Kai Großjohann
  2002-07-29  8:08         ` Paul Eggert
@ 2002-07-29  9:11         ` Andreas Schwab
  2002-07-29 10:04           ` Kai Großjohann
  2002-07-30  0:59         ` Richard Stallman
  2 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2002-07-29  9:11 UTC (permalink / raw)
  Cc: rms, emacs-devel

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai writes:

|> But if you prefer, I'll return them as strings and update the
|> documentation for file-attributes accordingly.  (Something like the
|> following, wording needs to be changed: If the user id is too large
|> for an int, it is returned as a string.  This never happens for normal
|> files, but it might happen when there is a filename handler.)

Why can't this happen for normal files?  If the uid type has 32 bits then
Emacs may not be able represent a normal uid in a Lisp_Int.  Of course,
uid value larger then MOST_POSITIVE_FIXNUM are rather unlikely, but still
possible.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-29  9:11         ` Andreas Schwab
@ 2002-07-29 10:04           ` Kai Großjohann
  0 siblings, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2002-07-29 10:04 UTC (permalink / raw)
  Cc: rms, emacs-devel

Andreas Schwab <schwab@suse.de> writes:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai writes:
>
> |> But if you prefer, I'll return them as strings and update the
> |> documentation for file-attributes accordingly.  (Something like the
> |> following, wording needs to be changed: If the user id is too large
> |> for an int, it is returned as a string.  This never happens for normal
> |> files, but it might happen when there is a filename handler.)
>
> Why can't this happen for normal files?

Because the current file-attributes implementation never creates a
cons (or a string) for user/group id.

I don't know what happens when the id is too large for such a file.
But surely a cons/string is not what happens.

Maybe make_number automatically creates a float when the number is too
large for a Lisp int?  Then the handlers should do that, too, I guess.

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: What to do with too-large group ids?
  2002-07-29  7:36       ` Kai Großjohann
  2002-07-29  8:08         ` Paul Eggert
  2002-07-29  9:11         ` Andreas Schwab
@ 2002-07-30  0:59         ` Richard Stallman
  2 siblings, 0 replies; 11+ messages in thread
From: Richard Stallman @ 2002-07-30  0:59 UTC (permalink / raw)
  Cc: emacs-devel

Using floating point numbers for large uid values might be a good idea.
You may as well try that.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-07-30  0:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-27  9:33 What to do with too-large group ids? Kai Großjohann
2002-07-27 14:12 ` Simon Josefsson
2002-07-27 15:47   ` Kai Großjohann
2002-07-27 20:53     ` Simon Josefsson
2002-07-28 10:17       ` Kai Großjohann
2002-07-29  1:12     ` Richard Stallman
2002-07-29  7:36       ` Kai Großjohann
2002-07-29  8:08         ` Paul Eggert
2002-07-29  9:11         ` Andreas Schwab
2002-07-29 10:04           ` Kai Großjohann
2002-07-30  0:59         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).