[#2139] Best way to install ri documentation — Dave Thomas <dave@...>

Folks:

69 messages 2004/01/04
[#2140] Re: Best way to install ri documentation — Gavin Sinclair <gsinclair@...> 2004/01/04

On Monday, January 5, 2004, 2:29:57 AM, Dave wrote:

[#2141] Re: Best way to install ri documentation — matz@... (Yukihiro Matsumoto) 2004/01/04

Hi,

[#2145] Re: Best way to install ri documentation — Richard Kilmer <rich@...> 2004/01/05

Perhaps make it available for mirrors and save ruby-lang's bandwidth?

[#2147] Re: Best way to install ri documentation — Dave Thomas <dave@...> 2004/01/05

[#2148] Re: Best way to install ri documentation -- please check this — Dave Thomas <dave@...> 2004/01/05

So, I'm thinking about doing the following? Is this OK with everyone?

[#2149] Re: Best way to install ri documentation -- please check this — "J.Herre" <jlst@...> 2004/01/05

[#2152] Re: Best way to install ri documentation -- please check this — Dave Thomas <dave@...> 2004/01/05

[#2153] Re: Best way to install ri documentation -- please check this — nobu.nokada@... 2004/01/05

Hi,

[#2154] Re: Best way to install ri documentation -- please check this — Dave Thomas <dave@...> 2004/01/05

[#2219] Re: Best way to install ri documentation -- please check this — "James F. Hranicky" <jfh@...> 2004/01/12

On Tue, 6 Jan 2004 00:47:41 +0900

[#2194] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...>

Hello,

27 messages 2004/01/09
[#2195] Re: [PATCH] File.readable_world? and File.writable_world? — Eivind Eklund <eivind@...> 2004/01/09

On Fri, Jan 09, 2004 at 06:02:07PM +0900, Ian Macdonald wrote:

[#2199] Re: [PATCH] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...> 2004/01/09

On Fri 09 Jan 2004 at 23:10:02 +0900, Eivind Eklund wrote:

[#2200] Re: [PATCH] File.readable_world? and File.writable_world? — matz@... (Yukihiro Matsumoto) 2004/01/10

Hi,

[#2203] Re: [PATCH] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...> 2004/01/11

On Sun 11 Jan 2004 at 00:47:33 +0900, Yukihiro Matsumoto wrote:

[#2206] Re: [PATCH] File.readable_world? and File.writable_world? — matz@... (Yukihiro Matsumoto) 2004/01/11

Hi,

[#2208] Re: [PATCH] File.readable_world? and File.writable_world? — Ian Macdonald <ian@...> 2004/01/11

On Sun 11 Jan 2004 at 21:40:22 +0900, Yukihiro Matsumoto wrote:

[#2209] Re: [PATCH] File.readable_world? and File.writable_world? — matz@... (Yukihiro Matsumoto) 2004/01/12

Hi,

[#2216] ruby aborts in data-handling applications — xsdg <xsdg@...>

I reported a similar bug about 2 or 3 months ago. The problem seemed to go

12 messages 2004/01/12

Re: [PATCH] File.readable_world? and File.writable_world?

From: Ian Macdonald <ian@...>
Date: 2004-01-09 22:00:46 UTC
List: ruby-core #2199
On Fri 09 Jan 2004 at 23:10:02 +0900, Eivind Eklund wrote:

> I see two problems with this:
> (1) There is no such thing as "readable world" in the permissions of
>     Unix; the closest I can think of is the combination of user, group
>     and other permissions.

World-readable _is_ a term applied very often in the UNIX world to the
a file readable by anyone. I think the term is commonly understood.

>     Note that these are grabbed in order;
>     the user that own it CAN NOT read a file with permissions -wxrwxrwx.
>     Using permissions rwx---rwx is a trick that sometimes is used to
>     make sure that a particular group cannot get at data.

Good point. I tend to think of 'world' as being synonymous with 'other',
but it's not, of course.

>     This is resolvable by renaming to readable_other? (which is the
>     correct Unix terminology - see
>     http://www.opengroup.org/onlinepubs/7908799/xbd/glossary.html#tag_004_000_107
>     for details).

I even wondered "Shall I use 'world' or 'other'?", but I decided that
'world' would be clearer to people. After all, we already have
readable_real, not readable_user, although that's a different case
again, as we need to distinguish between real and effective UIDs.

> (2) If renamed to readable_other?, this is tied very closely to the
>     ancient Unix permissions systems.  This isn't even correct for new
>     Unixes (ACLs are available), and definately not correct for Windows
>     et al.

Well, I coded it so that it would return false on Windows, but how do
you deal with the ACL issue without Ruby to link to yet more system
dependent libraries?

> Thinking a bit more about it while writing this, I wonder if the right
> thing to do wouldn't be to extend the API with four calls instead of
> two:
> 
> readable_world? - check for
> 	(perm & (S_IRUSR|S_IRGRP|S_IROTH)) == (S_IRUSR|S_IRGRP|S_IROTH)
> 	  (that's the same as)
> 	(perm & 0444) == 0444
> readable_other? - check for
> 	(perm & S_IROTH) == S_IROTH
> 	  (that's the same as)
> 	(perm & 0004) == 0004
> 
> writable_world? and writeable_other? do the same for the write flags.
> 
> Introducing both of them has a couple of advantages:
> 	- It make it obvious to people that there is a difference
> 	- It provide at one call with semantics that can be used on
> 	  different permission systems
> 	- It provide the functionality requested (which I agree would be
> 	  nice to have - I'd be annoyed if I discovered it was missing.)

I like the idea. Of course, then we should probably have readable_group?
and writable_group?, too.

Matz, do you like the idea or do you consider these methods unnecessary?

Ian
-- 
Ian Macdonald               | It is a hard matter, my fellow citizens, to
System Administrator        | argue with the belly, since it has no ears.
ian@caliban.org             | -- Marcus Porcius Cato 
http://www.caliban.org      | 

In This Thread