[Zope] FSSession buglette

2000-07-06 Thread Paul Gresham

Hi All,
I had some real problems with FSSession tonight. The first problem was
when the FSSession tried to load, it would get an error along the lines
of failed to import Acquisition. Next step was when the user session
tried to rename and the file wasn't there. This threw in error in a Zope
commit transaction, and rendered the site useless until a restart was
performed (this was correct action by Zope, i.e. all commits are blocked
to avoid the database becoming more screwed after a commit fails).

First thing I did was put a try around the dump to stop it from throwing
an error if the file doesn't exist. This is certainly a preferred option
for us, as it does not affect the function of the FSSession at all
(Except that one session is obviously now duff).

Second thing in tracking down the culprit, I finally figured out that
what I was doing was quite naughty. Basically creating an option for the
user to return to the site and have his/her name already entered into
the login screen. The mistake was putting AUTHENTICATED_USER into
FSSession, it basically tried to store the object, when all I wanted was
the string username! Oops!

Regards
Gresh

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Redirect when not authenticated

2000-07-06 Thread Paul Gresham

Hi All,
I have a secure directory (no Anon access) and when I access it, it will
throw me to a login screen in the GUF folder in that dir. What I really
want to happen is for the user to be thrown back up a level to the main
login/news etc etc screen which is a better place to start. however I
seem to be getting all sorts of security problems. Any ideas anyone?

Many thanks
Gresh

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Re: FSSession buglette

2000-07-06 Thread Paul Gresham

Pavlos Christoforou wrote:
 
 Paul
 
 Are you running FSSession0.4.0? If not please upgrade. The problems you
 mention below have been corrected. Nevertheless the first problem you
 descripe is not really related to FSSession. What happens is that certain
 Zope objects that can be pickled should not be stored in FSSession.
 Initially FSSession used marshal to serialize python objects, which is
 faster and does not allow storing of instances etc. I moved to pickle at
 the users request but one should be careful what he/she stores in
 FSSession.
 
 FSsession-0.4.0 should not raise an exception in tpc_finish. If I
 understand Zope's two phase commit mechanism, it is ok to raise an
 exception in tpc_begin (which corresponds to the 'polling' stage i
 believe) but not in tpc_finish. So now potential problems like full
 filesystem, unpicklable instances etc should be caught in tpc_begin.
 
 Pavlos
Pavlos Christoforou wrote:
 
 Paul
 
 Are you running FSSession0.4.0? If not please upgrade. The problems you
 mention below have been corrected. Nevertheless the first problem you
 descripe is not really related to FSSession. What happens is that certain
 Zope objects that can be pickled should not be stored in FSSession.
 Initially FSSession used marshal to serialize python objects, which is
 faster and does not allow storing of instances etc. I moved to pickle at
 the users request but one should be careful what he/she stores in
 FSSession.
 
 FSsession-0.4.0 should not raise an exception in tpc_finish. If I
 understand Zope's two phase commit mechanism, it is ok to raise an
 exception in tpc_begin (which corresponds to the 'polling' stage i
 believe) but not in tpc_finish. So now potential problems like full
 filesystem, unpicklable instances etc should be caught in tpc_begin.
 
 Pavlos

Hi, Yep, I'm definitely running 0-4-0, I think the fact that I did
something naughty caused the rename (and therefore the commit) to fail,
when it expected to work. An exception in the commit then caused Zope to
stop all commits. What is worrying is that someone much more naughty
than I am, may just do something similar on our live system (Once this
goes live)

Regards
Paul

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] WorldPilot - Regular messages are attachments?

2000-06-08 Thread Paul Gresham

Be careful here ... I think you'll also find that should you try to download
the attachement, It'll kill Zope. If you're running Zope with -D it'll
restart, otherwise you'll find you have no web site after trying to
download. I'm not sure what it does to kill Zope as there is no error, just
death. It seems to be a bit intermittent as well, which doesn't help.

I'm trying to fix the problem and will post the patch once it's ready,
hopefully next week when I get back from China. (I'm nothing to do with the
WorldPilot chaps, I just want to use the s/ware)

Gresh


  From: Dieter Maurer  [EMAIL PROTECTED]
  Date: Wed Jun 7, 2000 9:03pm
  Subject: Re: [Zope] WorldPilot - Regular messages are
attachments?


  Bryan Stillwell writes:

   Here's the traceback I received:
  
 Sorry, a Zope error occurred.p
   !--
   Traceback (innermost last):
 File
/usr/share/zope/lib/python/Products/WorldPilot/WorldPilot.py, line 1878, in
getpart
   (Object: RoleManager)
 File
/usr/share/zope/lib/python/Products/WorldPilot/WorldPilot.py, line 856, in
getPart
 File
/var/tmp/python/python-root/usr/lib/python1.5/mimetools.py, line 146, in
decode
   ValueError: unknown Content-Transfer-Encoding: 8bit
"mimetools.encode/decode" do not handle transfer encodings "7bit", "8bit"
and
  "binary", because there is nothing to do for them.

  "WordPilot" should check for them and not call "decode".


   Another strange thing is the path to the mimetools.py
file in the
   traceback:
/var/tmp/python/python-root/usr/lib/python1.5/.  The
   /var/tmp/python/python-root path should have only been
used during the
   creation of the python rpm, but it's showing up now. The
"*.pyc" files remember the name they have been compiled from.

  Dieter

 smime.p7s


Re: [Zope] WorldPilot - Regular messages are attachments? (PatchFix)

2000-06-08 Thread Paul Gresham

Excellent, thanks Bryan. I have another question? Do you have problems with
browsers not obtaining the correct filenames of attachments when they are
downloaded, i.e. the file becomes ATT0002.DAT or similar? I have this
problem and also if I choose to download a file and then cancel the dialog,
everything seems to get stuck, and I have to close the browser and start
again.

Regards
Paul

- Original Message -
From: Bryan Stillwell [EMAIL PROTECTED]
To: Paul Gresham [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, June 09, 2000 12:15 AM
Subject: Re: [Zope] WorldPilot - Regular messages are attachments?
(PatchFix)


 On Thu, 8 Jun 2000, Paul Gresham wrote:

  Be careful here ... I think you'll also find that should you try to
download
  the attachement, It'll kill Zope. If you're running Zope with -D it'll
  restart, otherwise you'll find you have no web site after trying to
  download. I'm not sure what it does to kill Zope as there is no error,
just
  death. It seems to be a bit intermittent as well, which doesn't help.

 Actually that traceback was from when I tried to view the
 message(attachment), and it didn't kill my Zope process.


  I'm trying to fix the problem and will post the patch once it's ready,
  hopefully next week when I get back from China. (I'm nothing to do with
the
  WorldPilot chaps, I just want to use the s/ware)

 I'm already ahead of you there.  I went ahead and debugged it myself and
 was able to fix the problem!  Here's the patch I came up with:

  CUT 
 --- WorldPilot.py~ Fri Mar 10 13:04:29 2000
 +++ WorldPilot.py Thu Jun  8 10:01:04 2000
 @@ -648,8 +648,8 @@
  ))
  else:
  offset=0
 - BodyType=ST[0]
 -BodySubtype=ST[1]
 +BodyType=string.upper(ST[0])
 +BodySubtype=string.upper(ST[1])
  BodyParameterList=ST[2]
  BodyId=ST[3]
  BodyDescription=ST[4]
  CUT 


 Enjoy!  I hope you had fun in China!

 Bryan




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )