summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/edithtml.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-175/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Clean up file permissions and umask settings. Now we set the umask to 007bwarsaw2007-01-051-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | during early initialization so that we're guaranteed to get the right value regardless of the shell umask used to invoke the command line script. While we're at it, we can remove almost all individual umask settings previously in the code, and make file permissions consistently -rw-rw---- (IOW, files are no longer other readable). The only subsystem that wasn't changed was the archiver, because it uses its own umask settings to ensure that private archives have the proper permissions. Eventually we'll mess with this, but if it ain't broken... Note that check_perms complains about directory permissions, but I think check_perms can be fixed (or perhaps, even removed?!). If we decide to use LMTPRunner and HTTPRunner exclusively then no outside process will be touching our files potentially with the incorrect permissions, umask, owner, or group. If we control all of our own touch points then I think we can lock out 'other'. Another open question is whether Utils.set_global_password() can have its umask setting removed. It locks permissions down so even the group can't write to the site password file, but the default umask of 007 might be good enough even for this file. Utils.makedirs() now takes an optional mode argument, which defaults to 02775 for backward compatibility. First, the default mode can probably be changed to 02770 (see above). Second, all code that was tweaking the umask in order to do a platform compatible os.mkdir() has now been refactored to use Utils.makedirs(). Another tricky thing was getting SQLite via SQLAlchemy to create its data/mailman.db file with the proper permissions. From the comment in dbcontext.py: # XXX By design of SQLite, database file creation does not honor # umask. See their ticket #1193: # http://www.sqlite.org/cvstrac/tktview?tn=1193,31 More details in that file, but the work around is to essentially 'touch' the database file if 'sqlite' is the scheme of the SQLAlchemy URL. This little pre-touch sets the right umask honoring permission and won't hurt if the file already exists. SQLite will happily keep the existing permissions, and in fact that ticket referenced above recommends doing things this way. In the Mailman.database.initialize(), create a global lock that prevents more than one process from entering this init function at the same time. It's probably not strictly necessary given that I believe all the operations in dbcontext.connect() are multi-processing safe, but it also doesn't seem to hurt and prevents race conditions regardless of the database's own safeguards (or lack thereof). Make sure nightly_gzip.py calls initialize().
* We need to substitute the fully qualified list name in the public archive url.bwarsaw2006-11-121-3/+3
| | | | | | | Do this and switch PUBLIC_ARCHIVE_URL to use $-substitution strings instead of %-substitution strings (no backward compatibility is provided). Minor style nits.
* MailList.py ... GetScriptURL() absolute again because we need it for emailtkikuchi2006-11-091-4/+6
| | | | | | | | notifications. wsgi_app.py ... URI normalization by stripping trailing slash. We need Special care for 'private'. Strip dot only components in the PATH_INFO for sanitization.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* import re module.tkikuchi2006-01-091-1/+2
|
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-301-1/+2
|
* List admins should be disallowd to insert script tags.tkikuchi2005-11-301-0/+1
|
* back porting from 2.1.6tkikuchi2005-08-281-7/+12
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* QuoteHyperChars() -> websafe()bwarsaw2002-05-221-4/+3
| | | | | Also, use Utils.websafe() consistently throughout, instead of the inconsistent calls to cgi.escape().
* Update copyright years.bwarsaw2002-03-161-1/+1
|
* Forward port security patch from Mailman 2.0.8:bwarsaw2001-11-301-2/+6
| | | | | | | | | | Fixes to prevent cross-site scripting exploits. See http://www.cert.org/advisories/CA-2000-02.html Reported by zeno@cgisecurity.com Fix is to cgi.escape() any strings regurgitated from the url back to the browser in the html response.
* ChangeHTML(): Must make sure the language-specific directory for thebwarsaw2001-11-051-4/+12
| | | | list exists before we try to write the template file.
* main(): template_data: handle_opts.html is gone. Found by Tokiobwarsaw2001-10-261-1/+0
| | | | Kikuchi.
* main(): Forgot to re-install the real translation context after thebwarsaw2001-07-111-0/+1
| | | | | trick-out of template_data. Add back the definition of _ (provided by Juan Carlos Rey Anaya).
* main(): Fix this to use the new authentication machinery.bwarsaw2001-06-271-5/+13
|
* Better syslog() calling conventions. Also, don't mark syslog messagesbwarsaw2001-06-271-2/+1
| | | | as translatable.
* main(): We don't need to pass the document background color as anbwarsaw2001-05-311-5/+5
| | | | | argument anymore. Other colors are no longer hardcoded, but taken from mm_cfg.
* main(): Don't call HTMLFormatter.InitVars() since mlist._template_dirbwarsaw2001-05-181-9/+6
| | | | | | | | | | has been removed. FormatHTML(): Call Utils.maketext() instead of SnarfHTMLTemplate() since that's also been removed. ChangeHTML(): Don't use mlist._template_dir to find the path to the list-centric template. Instead use mlist.fullpath().
* Application of SF patch #420396, submitted by Tokio Kikuchi. Thisbwarsaw2001-05-161-5/+10
| | | | script was not setting up the i18n environment in the `blessed' way.
* De-string-module-ification.bwarsaw2001-05-031-4/+3
|
* Untabification.bwarsaw2001-02-281-4/+4
|
* Use Mailman.i18n_ instead of gettext.gettext for the translatingbwarsaw2001-02-281-6/+12
| | | | | | wrapper. Fix some _() wrappings to use local variables.
* jcrey's latest round of I18N changes.bwarsaw2000-12-261-1/+9
|
* First round integration of Juan Carlos's translatable string markings.bwarsaw2000-12-071-22/+23
|
* Fixes for a minor local security hole. Some of the CGI scripts couldbwarsaw2000-09-291-28/+16
| | | | | | | | | | | bomb with tracebacks if PATH_INFO environment variable wasn't defined. Fixed this by making them all use Utils.GetPathPieces() and "doing something sensible" when that returned a false value. Also, edithtml is now hidden behind a login screen, so there's no need to enter the list password to edit the html. You can't even get to the list of files to edit unless you've admin authenticated. Closes SF bug #114091, Jitterbug PR# 24.
* Cleanups to fix relative/absolute script url calculation in responsebwarsaw2000-08-011-4/+3
| | | | | | | to SF Bug #110753. Specifically, main(), FormatHTML(): Use GetScriptURL() instead of GetRelativeScriptURL().
* main(): syslog() requires first argument to be the logfile to log to.bwarsaw2000-06-261-1/+1
|
* Convert all uses of sys.stderr.write() and mlist.LogMsg() to the newbwarsaw2000-06-021-2/+2
| | | | syslog() interface.
* Some meager consistency in handling errors when trying to open thebwarsaw2000-04-041-3/+6
| | | | | | | | | | | | | | mailing list. In all cases, catch the base exception class MMListError, and output HTML indicating the specified list doesn't exist. A more detail message gets printed to logs/error (the str() of the actual exception details). Also: admin.py - Don't catch MMBadConfigError around mlist.parse_matching_header_opt() since this method doesn't ever raise that exception. Actually, that exception isn't raised anywhere in Mailman, so it's been removed.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-3/+1
|
* Some general cleanup of imports, globals (zapped 'em), and a few otherbwarsaw1999-11-111-108/+68
| | | | | | programming constructs. Could still use a lot more work. Background is finally #ffffff like all other pages! :)
* main(): MMBadPassword => MMBadPasswordErrorbwarsaw1999-06-101-1/+1
|
* change os.path.join to %s/%s for urlscotton1998-11-091-5/+4
| | | | | lines 95, 161 scott
* *** empty log message ***cotton1998-10-261-2/+7
|
* Convert all module names to their new names. Import all modules frombwarsaw1998-06-191-89/+106
| | | | | | | the Mailman package (using the semi-bogus, but quickly implemented from ... import style). main()-ify, but needed a few bogus global decls
* These are the files that used to be in ../cgi, except they no longerviega1998-06-141-0/+167
handle logging to an error file, and no longer import paths. Also, any checks for __main__ have been removed.