[Mailman-Developers] file permissions

Michael McLay mclay@nist.gov
Fri, 5 Jun 1998 12:32:32 -0400 (EDT)


Either I screwed up when I followed the installation instructions or
else the file ownership set by "make install" incorrectly set the
group of the executables in $prefix/cgi-bin to that of the super user.
In order for the scripts to work the group had to be manually
set to "mailman".

I accidentally created a copy of $prefix/data/pending_subscriptions.db 
with the wrong group ownership which caused the subcribe script to
fail with an "Internal Server Error"  The script failed because of a
file access permission error.  In order to find the problem I did some 
code reorganization.  The $prefix/scripts/subscribe file was moved to
$prefix/Mailman/subscribe.py and the attached file was put in place of
the $prefix/scripts/subscribe file.

This change should also reduce the script execution time slightly
because the longer script will be compiled to a .pyc file.  I would
like to wrap all the other file in the $prefix/scripts/ in the same
manner. Once this is done the common.c program can be modified to
insert the PREFIX directory into the path rather than the MODULEDIR.
This will eliminate the need for the paths module in each of the
scripts and it would eliminate the need for the following lines in my
new wrapper script:

    sys.path.remove('/usr/local/mailman/Mailman')
    sys.path.insert(0, '/usr/local/mailman')

This generalized error wrapper would also eliminate some redundant
error reporting code in admin.

John, what do you think of removing the mm_ prefix from the module
names?  It's not really needed now that everything is pushed into the
Mailman package. 

-----------------------  $prefix/scripts/subscribe ---------------------

#! /usr/bin/env python
#
# Copyright (C) 1998 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

"""Process listinfo form submission, ie subscriptions or roster requests."""

import sys
from Mailman.subscribe import *
try:
    sys.path.remove('/usr/local/mailman/Mailman')
    sys.path.insert(0, '/usr/local/mailman')
    from Mailman.subscribe import *

except SystemExit:
    pass

except:
	  print "Content-type: text/html\n"

	  print "<p><h3>We're sorry, we hit a bug!</h3>\n"
	  print "If you would like to help us identify the problem, please "
	  print "email a copy of this page to the webmaster for this site"
	  print 'with a description of what happened.  Thanks!'
	  print "\n<PRE>"
	  print sys.argv
	  try:
	    import traceback
	    sys.stderr = sys.stdout
	    traceback.print_exc()
	  except:
	    print "[failed to get traceback]"
	  print "\n\n</PRE>"