Re: Access Control Lists and Functions

2001-01-16 Thread Philip Newton

Robin Houston wrote:
> On Tue, Jan 16, 2001 at 08:47:52AM +0100, Philip Newton wrote:
> > Yes. I converted a little script I have that puts some 
> > stuff into a database to use LRP.
> 
> Can we see the result? I'm fascinated...

Well, you asked for it. Here it is, cleaned up just a little bit (mostly
line length reformatting -- hopefully Outlook doesn't break it that way) and
with username and password XXX'd out. Enjoy! (I note while looking at it
that it isn't a rewrite of the other script as I had imagined it to be -- it
only selects instead of inserting. But the DBI code is roughly the same.)

(I had to "use DBI" ahead of LRP because "ute DBI" failed due to the -I
ending; and the "doneq" at the end is the English word "done" with a random
letter to mask the -e ending.)

Cheers,
Philip


#!/vmp/app/ActivePerl-5.6/bin/perl -w

use DBI;

use Lingua::Romana::Perligata;

ute mysql intra DBD.

Looking tum up inquementum tum biguttam tum novumversum
  oraculo scribe.

meo blanko lacunam da.
praecide blanko.

wordere sic
  coniungementum blankum tum applicamentum sic indementum hoc cis haec
cis

meo dsno da wordementum
  LXVIII tum LXVI tum LXXIII tum LVIII tum
  CIX tum CXXI tum CXV tum CXIII tum CVIII tum LVIII tum
  C tum XCVII tum CXVI tum XCVII tum XCVIII tum XCVII tum CXV tum
CI tum LXI tum
  CX tum CI tum CXIX tum CXVI tum CXI tum CX tum LIX tum
  CIV tum CXI tum CXV tum CXVI tum LXI tum
  CII tum CV tum XCIX tum CXVII tum CXV tum XLVI tum
  CII tum CXIV tum CXI tum CIII tum CXV tum CXII tum XCVII tum
XCIX tum CI tum XLVI tum
  CX tum CI tum CXVI.

meo usernameo da wordementum XXX tum XXX tum XXX.
meo passwordo da wordementum XXX tum XXX tum XXX.
meo attributibus.
RaiseError inquemento attributuum da unum.
AutoCommit inquemento attributuum da unum.
meo classo da wordementum LXVIII tum LXVI tum LXXIII.

meo dbho da classum tum
dsnum tum
usernameum tum
passwordum tum
ad attributibus
  connectementum intra DBI
  morive errstrum intra DBI.

oraculo scribe Selecting inquementum tum novumversum.

meo selecto da wordementum
  LXXXIII tum LXIX tum LXXVI tum LXIX tum LXVII tum LXXXIV tum XXXII
  tum CV tum C tum XLIV tum XXXII tum C tum XCVII tum CXVI tum CXVII
  tum CIX tum XLIV tum XXXII tum XCVII tum CX tum CXXII tum XCVII
  tum CIV tum CVIII tum XLIV tum XXXII tum CI tum CXV tum CXV tum CI
  tum CXIV tum XXXII tum LXX tum LXXXII tum LXXIX tum LXXVII tum
  XXXII tum CI tum CXV tum CXV tum CI tum CX tum XXXII tum LXXXVII
  tum LXXII tum LXIX tum LXXXII tum LXIX tum XXXII tum C tum XCVII
  tum CXVI tum CXVII tum CIX tum XXXII tum LXI tum XXXII tum LXIII. 

meo todayo da wordementum
  L tum XLVIII tum XLVIII tum XLVIII tum XLV tum XLIX tum L tum XLV
  tum XLVIII tum LVI. 

meo stho da selectum prepareementum apud dbhum.
todayum executee apud sthum.
meo rowo da fetchementum apud sthum.

nisi non confirmamentum rowum fac sic
  oraculo scribe nullimum rowum arcessementorum tum biguttam tum
  lacunam tum tertium rowum arcessementorum tum novumversum.
cis

finishe apud sthum.
disconnecte apud dbhum.

oraculo scribe doneq inquementum tum novumversum.



Re: Access Control Lists and Functions

2001-01-16 Thread Robin Houston

On Tue, Jan 16, 2001 at 08:47:52AM +0100, Philip Newton wrote:
> Yes. I converted a little script I have that puts some stuff into a database
> to use LRP.
> 
> [snip interesting discussion]

Can we see the result? I'm fascinated...

 .robin.

-- 
"You are bound to be in a state of mental unrest, even turmoil.
 And of course there can be no inner peace: be proud of it!"



Speaking Welsh (Re: Speaking Japanese (Re: Access Control Lists and Functions))

2001-01-16 Thread Robin Houston

On Tue, Jan 16, 2001 at 11:47:44AM +, Redvers Davies wrote:
> And possibly some welsh...  The welsh word "drwg" (pronounced the english
> way is "droog") and means 'Bad, naughty, evil, wicked' etc.

Anthony Burgess spoke fluent Welsh (his first wife was Welsh),
so I'd have thought that was quite likely.

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-16 Thread Redvers Davies

> Isn't it a pidgin mix of Russian and English?

And possibly some welsh...  The welsh word "drwg" (pronounced the english
way is "droog") and means 'Bad, naughty, evil, wicked' etc.



Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-16 Thread Aaron Trevena

On Tue, 16 Jan 2001, Simon Wistow wrote:

> Dave Cross wrote:
>  
> > The language spoken by the droogs in 'A Clockwork Orange'.
> 
> Isn't it a pidgin mix of Russian and English?

It is a mix of schoolboy slang (from soem school that Burgess went to, cos
I sure didn't speak like that at school, probably one of those public
shcools or summit), ryhming slang (not cockney), misc slang from all over
the place, malay & malay slang, olde english and pidgin russian.

see (the horribly laid out and currently being
redesigned) http://droogs.org/lit/ for some interesting links on ACO,
Nadsat and Artificial languages.

A.
-- 
http://termisoc.org/~betty"> Betty @ termisoc.org 
"As a youngster Fred fought sea battles on the village pond using a 
complex system of signals he devised that was later adopted by the Royal 
Navy. " (this email has nothing to do with any organisation except me)






Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-16 Thread Simon Wistow

Dave Cross wrote:
 
> The language spoken by the droogs in 'A Clockwork Orange'.

Isn't it a pidgin mix of Russian and English?



RE: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-16 Thread Matthew Freake

Dave wrote:
> > does lingua::nadsat exist yet? or anything along those lines?
> 
> Er, what's nadsat?

> The language spoken by the droogs in 'A Clockwork Orange'.

> Dave...
> [who got the video for xmas and hasn't got round to watching it yet]

The film's pretty good, but what a soundtrack! Walter/Wendy Carlos Moog
mayhem!



Matt Freake



Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-16 Thread Dave Cross

At Tue, 16 Jan 2001 08:50:57 +0100, Philip Newton <[EMAIL PROTECTED]> 
wrote:
> Aaron Trevena wrote:
> > does lingua::nadsat exist yet? or anything along those lines?
> 
> Er, what's nadsat?

The language spoken by the droogs in 'A Clockwork Orange'.

Dave...
[who got the video for xmas and hasn't got round to watching it yet]



Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-15 Thread Philip Newton

Aaron Trevena wrote:
> does lingua::nadsat exist yet? or anything along those lines?

Er, what's nadsat?

Cheers,
Philip



Re: Access Control Lists and Functions

2001-01-15 Thread Philip Newton

Robin Houston wrote:
> Lingua::Romana::Perligata   :-)
> 
> I don't know when the module was actually released onto CPAN,
> but I saw it for the first time at the weekend. It is ...
> staggering ...
> 
> Anyone written any programs using it?

Yes. I converted a little script I have that puts some stuff into a database
to use LRP.

The two main snags I came across were its abysmal string handling
(basically, none at all) and the fact that word endings are a liability in
bareword or quoted context.

The first problem is probably caused by the second; the "official" way to
quote things is to use "inquementum" -- but if the thing you're trying to
quote has a "magic" ending for LRP (such as -i -ementum -e etc.), you'll run
into problems. And things that aren't made up of letters are also difficult
to get into strings.

I ended up making subrouting called "wordere" that takes a list of numbers
and returns a string composed of characters with those code points. Of
course, pack('C*') wouldn't work, since I couldn't produce the string 'C*'
to feed to pack (chicken and egg problem), so I used join '', map { chr $_
}, @_. And I got '' by assigning "lacunam" (space, i.e. ' ') to a variable
and chop()ing it. Slightly ick. Now my string assignments ended up being
something like "da varo wordementum XLVII tum LIX tum XL tum CI tum LXXXIV
tum X" (pulling numbers out of a hat here, just for example).

And the other problem was with DBI->connect. Since DBI ends in I, LRP thinks
it's dative or something and didn't like it before the equivalent of ->
(apud? don't have the docs handy just now). However, before :: it took it.
So DBI->connect(...) ended up turning into DBI::connect('DBI', ...). More
ick. But at least it "works".

(And I also uncovered a bug in the version I downloaded -- si 'if' doesn't
work, but nisi 'unless' does. After using "nisi non" all the time, I had a
look at the source; it seemed to me that "si" was being assigned the wrong
class. After giving it what "nisi" had, it seemed to work. But I didn't test
it extensively.)

And I miss time() and localtime() (though "$a = localtime" can be translated
as something like "da ao localtimeementum timeementum", but I consider that
cheating slightly).

Cheers,
Philip



Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-15 Thread David H. Adler

On Mon, Jan 15, 2001 at 04:51:38PM +, Aaron Trevena wrote:
> On Mon, 15 Jan 2001, Andy Wardley wrote:
> 
> > On Jan 15,  4:24pm, Robin Houston wrote:
> > > Lingua::Romana::Perligata   :-)
> > 
> > Conway-san, your programming challenge for this week is:
> > 
> >Lingua::Nihon::Perldes
> > 
> > (but with an English <-> Japanese translation interface for those of
> > us who didn't last out the Japanese classes)
> > 
> 
> does lingua::nadsat exist yet? or anything along those lines?

Never mind all that.  Does anyone speak enough (I think) Klingon to
understand what the status of the Lingua::tlhIngan::yIghun module is
(see http://yetanother.org/damian/projects.html)???

dha

-- 
David H. Adler - <[EMAIL PROTECTED]> - http://www.panix.com/~dha/
I drink to my coming cirrhosis...   - Charles Aznavour



Re: Access Control Lists and Functions

2001-01-15 Thread Mark Fowler

> Dieing's probably a bad idea. The idea was for it to set an error stack
> so that even if you were using this module you would do stuff like
>
>   my $do = new DO;
>   $do->something();
>   warn ACL::last_error()."\n" if ACL::error();
>
> which would print out something like "Access to DO::something denied for
> user x";

Why can't you do this with the standard die semantics?

eval
{
my $do = new DO;
$do->something();
}
if ($@)
{
warn $@;
}

(will work if both $@ is a string or a object that is overriden)

Of course if you were using Error.pm you could even use 'try' and 'catch'
as syntatic suger.  See the Error perldoc.

Later.

Mark.

-- 
print "\n",map{my$a="\n"if(length$_>6);' 'x(36-length($_)/2)."$_\n$a"} (
   Name  => 'Mark Fowler',Title => 'Technology Developer'  ,
   Firm  => 'Profero Ltd',Web   => 'http://www.profero.com/'   ,
   Email => '[EMAIL PROTECTED]',   Phone => '+44 (0) 20 7700 9960'  )










Re: Access Control Lists and Functions

2001-01-15 Thread Greg McCarroll

* Tony Bowden ([EMAIL PROTECTED]) wrote:
> On Mon, Jan 15, 2001 at 04:53:57PM +, Greg McCarroll wrote:
> > I started learning Japanese when the NI administration decided to teach
> > it to joint classes of catholic children and protestant children. Hence
> > it was a good way to meet a brand new batch of girls. I stopped soon after.
> 
> Hey ... I never got opportunities like that!
> 

well you had to a particular ``sensitive'' and ``caring'' individual,
able to deal with the harsh realities of the ``enforced prejudices''

> Was this only out in strange places? 

Ballymena is not a strange place! But i think it was across N.I. even
the more backward places such as Cullybacy, Carnlough and of course
Belfast

> Or just after/before my time?
> 

way after your time Tony, way way way after --- just the hip young
things like me got this sort of thing (this is my attempt to hang
on the every slipping idea that i am still young)

anyway back to watching Detroit Rock City

Greg

-- 
Greg McCarroll  http://www.mccarroll.uklinux.net



Re: Access Control Lists and Functions

2001-01-15 Thread Tony Bowden

On Mon, Jan 15, 2001 at 04:53:57PM +, Greg McCarroll wrote:
> I started learning Japanese when the NI administration decided to teach
> it to joint classes of catholic children and protestant children. Hence
> it was a good way to meet a brand new batch of girls. I stopped soon after.

Hey ... I never got opportunities like that!

Was this only out in strange places? Or just after/before my time?

Tony
-- 
-
 Tony Bowden | Belfast, NI | [EMAIL PROTECTED] | www.tmtm.com | www.blackstar.co.uk
  paradox & contrast variety & change history repeats but it's never the same
-



Re: Speaking Japanese (Re: Access Control Lists and Functions)

2001-01-15 Thread Aaron Trevena

On Mon, 15 Jan 2001, Andy Wardley wrote:

> On Jan 15,  4:24pm, Robin Houston wrote:
> > Lingua::Romana::Perligata   :-)
> 
> Conway-san, your programming challenge for this week is:
> 
>Lingua::Nihon::Perldes
> 
> (but with an English <-> Japanese translation interface for those of
> us who didn't last out the Japanese classes)
> 

does lingua::nadsat exist yet? or anything along those lines?

might work on it if doesn't already exist - along with all the other
stuff..

A.


-- 
http://termisoc.org/~betty"> Betty @ termisoc.org 
"As a youngster Fred fought sea battles on the village pond using a 
complex system of signals he devised that was later adopted by the Royal 
Navy. " (this email has nothing to do with any organisation except me)






Re: Access Control Lists and Functions

2001-01-15 Thread Robin Houston

On Mon, Jan 15, 2001 at 05:17:08PM +, Marcel Grunauer wrote:
> 
> Sounds like the business. There have been quite a number of Perl modules
> lately that are more about the syntax and the way the language is being
> used than for any specific tasks, such as:

Lingua::Romana::Perligata   :-)

I don't know when the module was actually released onto CPAN,
but I saw it for the first time at the weekend. It is ...
staggering ...

Anyone written any programs using it?

 .robin.

-- 
"do not assume that you are in control of your own actions,
 but take responsibility for them anyway."



Re: Access Control Lists and Functions

2001-01-15 Thread Leon Brocard

Marcel Grunauer sent the following bits through the ether:

> Do it like Memoize.pm (i.e., generalize the wrapper mechanism or just nick

... http://search.cpan.org/doc/JDPORTER/Hook-WrapSub-0.03/lib/Hook/WrapSub.pm

Leon
-- 
Leon Brocard.http://www.astray.com/
yapc::Europehttp://yapc.org/Europe/

... All new improved Brocard, now with Template Toolkit!



Re: Access Control Lists and Functions

2001-01-15 Thread Greg McCarroll

* Matthew Jones ([EMAIL PROTECTED]) wrote:
> >In my case, Japanese was very much the latter.  I have deep respect 
> >for anyone who can master it.
> 
> The only Japanese I know:
> 
> "Anata no zubon wa taihen kirena desu!"
> 

the only japanese i know is - 

hi, i don't think i've spoke to you before, i'm greg 
X
why thats a lovely name
X
oh really, what do you think of this japanese class
X
yes i have exactly the same opinion as you
X
etc 

-- 
Greg McCarroll  http://www.mccarroll.uklinux.net



RE: Access Control Lists and Functions

2001-01-15 Thread Matthew Jones

>In my case, Japanese was very much the latter.  I have deep respect 
>for anyone who can master it.

The only Japanese I know:

"Anata no zubon wa taihen kirena desu!"

Not many applications.

-- 
matt
"What? I don't speak your crazy moon-language." 



Re: Access Control Lists and Functions

2001-01-15 Thread Greg McCarroll

* Andy Wardley ([EMAIL PROTECTED]) wrote:
> On Jan 15,  1:50pm, Simon Wistow wrote:
> > Something like that, probably called it Symbol::ACL or summat. I'll
> > stick it in my todo list right after Flash stuff, Mail::Hotmail,
> > Net::IP2LL, Fuky widget set thingy, WMLScript compiler in Perl and
> > learning Japanese.
> 
> I started learning Japanese when I joined Canon as they were offering
> free lessons to all research staff.  I stopped soon after.
> 

I started learning Japanese when the NI administration decided to teach
it to joint classes of catholic children and protestant children. Hence
it was a good way to meet a brand new batch of girls. I stopped soon after.
 

-- 
Greg McCarroll  http://www.mccarroll.uklinux.net



Re: Access Control Lists and Functions

2001-01-15 Thread Andy Wardley

On Jan 15,  1:50pm, Simon Wistow wrote:
> Something like that, probably called it Symbol::ACL or summat. I'll
> stick it in my todo list right after Flash stuff, Mail::Hotmail,
> Net::IP2LL, Fuky widget set thingy, WMLScript compiler in Perl and
> learning Japanese.

I started learning Japanese when I joined Canon as they were offering
free lessons to all research staff.  I stopped soon after.


Success is (partly) about being able to differentiate between the things
you're good at and the things that you'll never be good at. Spend time
on the former and don't waste time getting nowhere with the latter.


In my case, Japanese was very much the latter.  I have deep respect for
anyone who can master it.


A



-- 
Andy Wardley <[EMAIL PROTECTED]>   Signature regenerating.  Please remain seated.
 <[EMAIL PROTECTED]>   For a good time: http://www.kfs.org/~abw/



Re: Access Control Lists and Functions

2001-01-15 Thread Simon Wistow

Mark Fowler wrote:

> May I suggest that we die at this point?  And throw a Error::AccessDenyed
> object or something?

Dieing's probably a bad idea. The idea was for it to set an error stack
so that even if you were using this module you would do stuff like

   my $do = new DO;
   $do->something();
   warn ACL::last_error()."\n" if ACL::error();

which would print out something like "Access to DO::something denied for
user x";



Re: Access Control Lists and Functions

2001-01-15 Thread Robin Houston

On Mon, Jan 15, 2001 at 02:29:38PM +, Simon Wistow wrote:
> How would the user get round this? I mean sure they could if they had
> access to the source code but ...
> 
> 
> I'm writing something at the moment that's got lots of 
> 
> 
> sub do_summat
> {
>   my ($self, $userid, $arg1, $arg2) = @_;
>   
>   return access_denied('do_summat') unless (grep {/^$userid$/}
> $self->acl->{do_summat});
> }
> 
> so this was just a way of automating that.

I think I misunderstood you before. I thought you were trying
to restrict what could be done by code which uses your module.
Obviously that's not what you're doing; because in the code
above, anyone could pass in any userid (not necessarily their own).

OTOH, if your program is running locally then it can't do
anything that the user couldn't do directly anyway (unless
it's SUID, which is too frightening to contemplate). So
presumably it's some sort of network-available service.

I think I see where you're coming from now. Sorry for the
confusion.

 .robin.

-- 
"Have you been certain you came to me the real reason explain anything
else that I came to you the real reason explain anything else that I
came to you the real reason explain anything else?" --eliza



Re: Access Control Lists and Functions

2001-01-15 Thread Simon Wistow

Robin Houston wrote:
> 
> On Mon, Jan 15, 2001 at 12:31:17PM +, Simon Wistow wrote:
> > basically it automagically intercepts subroutine calls and checks to see
> > if the current user has permissions for the subroutine and returns undef
> > if you don't have access to it.  You could also extend it to variables.
> 
> There are loads of ways that a user could get round this though.
> It's not secure at all, but maybe it's not meant to be (?)

How would the user get round this? I mean sure they could if they had
access to the source code but ...


I'm writing something at the moment that's got lots of 


sub do_summat
{
my ($self, $userid, $arg1, $arg2) = @_;

return access_denied('do_summat') unless (grep {/^$userid$/}
$self->acl->{do_summat});
}

so this was just a way of automating that. Can't think how Symbol::ACL
would be less secure than the example above.

But then I'm unbelievably hungover at the moment.

Puzzled of Battersea



Re: Access Control Lists and Functions

2001-01-15 Thread Simon Wistow

David Cantrell wrote:

> Let me guess, you're thinking of adapting our Illustrious Leader's
> Sub::Whateveritscalledthisweek to do this?  Sounds ... interesting.

Something like that, probably called it Symbol::ACL or summat. I'll
stick it in my todo list right after Flash stuff, Mail::Hotmail,
Net::IP2LL, Fuky widget set thingy, WMLScript compiler in Perl and
learning Japanese.

Simon



Re: Access Control Lists and Functions

2001-01-15 Thread David Cantrell

On Mon, Jan 15, 2001 at 12:31:17PM +, Simon Wistow wrote:

> Sorry to go off topic and talk about Perl briefly but I need some
> opinions about something I had an idea about when going home pissed last
> night and I'm still too hungover to decide whether I'm crack fuelled or
> not.

Yep, definitely crack fuelled, but ...

>   use Sub::ACL;
>   use Another::Module.
> 
>   my $acl = get_acl_from_somewhere(); 
>   my $userid = get_current_userid();
>   ACL::init($userid, $acl);
> 
>   my $am = new AnotherModule();
> 
>   # do_something has an entry next to this userid 
>   # in the acl we passed and so works normally
>   $am->do_something(); 
> 
>   #do_somethingelse howvere doesn't and so returns undef
>   $am->do_soemthingelse();
> 
> basically it automagically intercepts subroutine calls and checks to see
> if the current user has permissions for the subroutine and returns undef
> if you don't have access to it.  You could also extend it to variables.

Let me guess, you're thinking of adapting our Illustrious Leader's
Sub::Whateveritscalledthisweek to do this?  Sounds ... interesting.

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david

  Any technology distinguishable from magic is insufficiently advanced