[Zope] Re: Re: Changing file ownership

Daryl Tester dt@picknowl.com.au
Fri, 07 Apr 2000 09:17:24 +0930


mindlace wrote:

> In general, unpriveledged users cannot change group ownership to a group
> they are not in.  Add nobody to the group you want to change it to, and
> it should work.

Double eeek!  Ethan's right (slaps morning-brain around the head).
In addition, chgrp will report an error to stderr (although you
won't see it from within Zope), and os.system() will have returned
chgrp's return code status.  Something like:

def alterwithprejudice(self):
    "Another test function"
    import os

    res = os.system('chgrp -R extranet /path/to/whereever')
    if res:
        raise "chgrp", res      # Naughty! Strings are deprecated.

    return None

This gives you the added benefit of being able to trap the error
from within DTML (with use of <dtml-try> and <dtml-except> tags).

"Never, I mean, always check your references."


Regards,
  Daryl Tester