*** menesis has quit IRC | 00:25 | |
*** Tularis has joined #zope | 00:28 | |
Tularis | hey guys, I have a problem with Zope's security system. I'm trying to enable the re module in the PythonScript product, but I can't seem to enable it fully. Base methods work fine, but the subobjects don't. So I can match a string against a regexp, but I can't use any of the result object's methods for some weird reason. Could someone possibly enlighten me as to what I'm doing wrong? | 00:39 |
---|---|---|
Tularis | The script and error are on: http://paste.lisp.org/+30SK (and I'm using Zope 2.10.6) | 00:40 |
Tularis | Tried quite a few things... but nothing seems to work for me :s | 00:40 |
Tularis | Was hoping someone here could give me a hint :) | 00:40 |
kosh | geeze I have not played with that stuff in a long while | 00:44 |
kosh | let me look up what you need | 00:44 |
Tularis | I was pretty sure a simple import re allow_module('re') would be enough | 00:47 |
Tularis | but apparently it wasn't | 00:47 |
kosh | not it has to do with allowing access to unprotected subobjects | 00:47 |
Tularis | well, I did read that adding a | 00:48 |
Tularis | re.__allow_access_to_unprotected_subobjects__ = 1 | 00:48 |
Tularis | would allow access to them | 00:48 |
Tularis | but that's also automatically set by allow_module() | 00:48 |
Tularis | even a couple of simple: | 00:48 |
Tularis | allow_type(type(re.compile(''))) | 00:49 |
Tularis | allow_type(type(re.match('x','x'))) | 00:49 |
Tularis | didn't work :( | 00:49 |
kosh | normally what I do is just use an external method and have it do any security restricted things and just had a result back | 00:49 |
kosh | I convert to a list or tuple to hand back and that works for json, csv and a bunch of other stuff | 00:49 |
kosh | I never use regex for anything | 00:49 |
Tularis | one of my site maintainers requested it; he recieves a list of adresses, and has to split them up into street, housenumber and any additional info after it | 00:51 |
Tularis | easiest way would be using regexps | 00:51 |
kosh | for what I would do is just create an external method that you give it a string and it hands back the street,housenumber,additional stuff | 00:52 |
Tularis | I guess making it an external method would work... I was just hoping I could also give them access to regexps, so it would be eaier for em | 00:52 |
Tularis | *easier | 00:52 |
kosh | have you tried doing re.__allow_access_to_unprotected_subobjects__=1 ? | 00:52 |
Tularis | yes, to no avail :( | 00:53 |
Tularis | it's also part of the allow_module code, so it gets ran anyway | 00:53 |
kosh | overall it looks like one of the sites that used to have the way to do this I can't find anymore | 00:55 |
kosh | ah I think I know the problem | 00:57 |
kosh | allow_module works for pure python modules but re actually has a lot of c code and it does not work for that | 00:58 |
kosh | I think external methods will be the only way to do it | 00:58 |
Tularis | hmm | 01:01 |
Tularis | the strange thing is, this is even mentioned as an example in the PythonScripts source code :s | 01:01 |
Tularis | http://svn.zope.org/Zope/branches/2.10/lib/python/Products/PythonScripts/module_access_examples.py?revision=68400&view=markup&pathrev=68400 | 01:01 |
kosh | security changes have been made since then | 01:01 |
kosh | I forgot which version it was where the python script security model was rebuilt entirely | 01:02 |
Tularis | I see, too bad :( | 01:05 |
Tularis | for me that is | 01:05 |
Tularis | good thing security was enhanced obviously ;) | 01:05 |
kosh | it is just not something I have run into, it turns out all of the stuff I have needed to allow access to works | 01:05 |
Tularis | same here, but not with this so far... | 01:05 |
kosh | and I will not being doing new web dev for much longer | 01:05 |
*** fdrake has quit IRC | 01:22 | |
*** TresEquis has joined #zope | 01:39 | |
*** Tularis has quit IRC | 01:42 | |
*** supton has quit IRC | 01:43 | |
*** daMaestro has quit IRC | 02:45 | |
*** tiwula has quit IRC | 03:19 | |
*** Spanktar has quit IRC | 03:22 | |
*** tiwula has joined #zope | 03:35 | |
*** TresEquis has quit IRC | 04:15 | |
*** TresEquis has joined #zope | 04:18 | |
*** TresEquis has quit IRC | 04:21 | |
*** povbot_ has joined #zope | 04:29 | |
*** povbot has quit IRC | 04:29 | |
*** dayne has joined #zope | 04:59 | |
*** kosh has quit IRC | 05:54 | |
*** Percy has quit IRC | 06:49 | |
*** regebro has quit IRC | 07:55 | |
*** regebro has joined #zope | 07:55 | |
*** tiwula has quit IRC | 08:56 | |
*** eperez has joined #zope | 09:18 | |
*** __mac__ has joined #zope | 09:23 | |
*** tisto has joined #zope | 09:29 | |
*** PeterZ2 has joined #zope | 09:35 | |
*** avoinea has joined #zope | 09:39 | |
*** MaikDerstappen has quit IRC | 10:03 | |
*** __gotcha has joined #zope | 10:03 | |
*** giacomos has joined #zope | 10:20 | |
*** povbot has joined #zope | 10:32 | |
*** Spanktar has joined #zope | 10:46 | |
*** tmog has joined #zope | 10:48 | |
*** __gotcha has quit IRC | 10:52 | |
*** Spanktar has quit IRC | 10:56 | |
*** alecm has quit IRC | 11:04 | |
*** maurits has joined #zope | 11:05 | |
*** mitchell`off is now known as mitchell` | 11:17 | |
*** ajmitch has quit IRC | 11:21 | |
*** ajmitch has joined #zope | 11:21 | |
*** _mup_ has quit IRC | 11:28 | |
*** _mup_ has joined #zope | 11:28 | |
*** giacomos has quit IRC | 11:34 | |
*** giacomos has joined #zope | 11:37 | |
*** giacomos has quit IRC | 11:44 | |
*** giacomos has joined #zope | 11:48 | |
*** giacomos has quit IRC | 11:52 | |
*** giacomos has joined #zope | 11:53 | |
*** giacomos has quit IRC | 11:56 | |
*** giacomos has joined #zope | 11:59 | |
*** giacomos has quit IRC | 12:00 | |
*** MaikDerstappen has joined #zope | 12:11 | |
*** giacomos has joined #zope | 12:14 | |
*** giacomos has quit IRC | 12:16 | |
*** giacomos has joined #zope | 12:24 | |
*** MatthewWilkes is now known as mwilkes|away | 12:33 | |
*** maurits has quit IRC | 12:35 | |
*** maurits has joined #zope | 13:01 | |
*** __mac__ has quit IRC | 13:37 | |
*** __mac__ has joined #zope | 13:39 | |
*** fdrake has joined #zope | 14:08 | |
*** maurits has quit IRC | 14:30 | |
*** Fixader has joined #zope | 14:32 | |
*** tisto has quit IRC | 14:44 | |
*** PeterZ2 has left #zope | 14:55 | |
*** giacomos has quit IRC | 14:59 | |
*** giacomos has joined #zope | 15:07 | |
*** kosh has joined #zope | 15:11 | |
*** fdrake has quit IRC | 15:16 | |
*** maurits has joined #zope | 15:17 | |
*** kosh has quit IRC | 16:20 | |
*** eperez has quit IRC | 16:39 | |
*** tmog has quit IRC | 16:55 | |
*** __mac__ has quit IRC | 16:58 | |
*** dayne has quit IRC | 17:02 | |
*** fdrake has joined #zope | 17:23 | |
*** regebro_ has joined #zope | 17:55 | |
*** regebro has quit IRC | 17:55 | |
*** regebro_ is now known as regebro | 17:55 | |
*** maurits has quit IRC | 18:01 | |
*** alecm has joined #zope | 18:04 | |
*** supton has joined #zope | 18:40 | |
*** tiwula has joined #zope | 18:42 | |
*** m8 has joined #zope | 18:55 | |
*** rajesh has joined #zope | 19:07 | |
*** MaikDerstappen has quit IRC | 19:12 | |
*** giacomos has quit IRC | 19:22 | |
*** dayne has joined #zope | 19:33 | |
*** Spanktar has joined #zope | 19:40 | |
*** mitchell` is now known as mitchell`off | 19:43 | |
*** __mac__ has joined #zope | 20:59 | |
*** Pumukel has joined #zope | 21:16 | |
*** Wu has quit IRC | 21:19 | |
*** Wu has joined #zope | 21:19 | |
*** rajesh has quit IRC | 21:23 | |
*** carolsixfeetup has joined #zope | 21:39 | |
*** carolsixfeetup has left #zope | 21:40 | |
*** motto has joined #zope | 21:51 | |
*** m8 has quit IRC | 21:53 | |
*** calvinhp_ has joined #zope | 21:56 | |
*** calvinhp_ has left #zope | 21:56 | |
*** avoinea has quit IRC | 22:02 | |
*** ree has quit IRC | 22:27 | |
*** ree has joined #zope | 22:28 | |
*** alecm has quit IRC | 22:38 | |
*** alecm has joined #zope | 22:39 | |
*** __mac__ has quit IRC | 23:15 | |
*** alecm has quit IRC | 23:26 | |
*** alecm has joined #zope | 23:26 | |
*** alecm has joined #zope | 23:26 | |
*** benji has quit IRC | 23:27 | |
*** ccolorado has joined #zope | 23:29 | |
*** dayne has quit IRC | 23:30 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!