diff -Nur mailman-2.0.13.org/configure.in mailman-2.0.13/configure.in --- mailman-2.0.13.org/configure.in Thu Jul 11 23:50:36 2002 +++ mailman-2.0.13/configure.in Fri Dec 13 00:29:30 2002 @@ -296,8 +296,6 @@ gid = statdata[ST_GID] if mailmangid <> gid: problems.append("Directory must be owned by group mailman: " + prefix) - if (mode & S_ISGID) <> S_ISGID: - problems.append("Set-gid bit must be set for directory: " +prefix) perms = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH if (mode & perms) <> perms: problems.append("Permissions should be at least 02775: " + prefix) diff -Nur mailman-2.0.13.org/emx_emul.py mailman-2.0.13/emx_emul.py --- mailman-2.0.13.org/emx_emul.py Thu Jan 1 00:00:00 1970 +++ mailman-2.0.13/emx_emul.py Sat Jan 18 01:11:08 2003 @@ -0,0 +1,78 @@ +# emx_emul.py + +# Written by Andrew I MacIntyre, andymac@bullseye.apana.org.au, December 2002. +# Distributed under the same terms and conditions as Python 2.2. + +"""emx_emul.py is a simplistic emulation of the Unix link(2) library routine +for creating so-called hard links. + +We do this on OS/2 by implementing a file copy, with link(2) semantics:- + - the target cannot already exist; + - we hope that the actual file open (if successful) is actually + atomic... + +Limitations of this approach/implementation include:- + - no support for correct link counts (EMX stat(target).st_nlink + is always 1); + - thread safety undefined; + - default file permissions (r+w) used, can't be over-ridden; + - implemented in Python so comparatively slow, especially for large + source files; + - need sufficient free disk space to store the copy. + +Behaviour:- + - any exception should propagate to the caller; + - want target to be an exact copy of the source, so use binary mode; + - returns None, same as os.link() which is implemented in posixmodule.c; + - target removed in the event of a failure where possible; + - given the motivation to write this emulation came from trying to + support a Unix resource lock implementation, where minimal overhead + during creation of the target is desirable and the files are small, + we read a source block before attempting to create the target so that + we're ready to immediately write some data into it. +""" + +import os +import errno + +__all__ = ['link'] + +def link(source, target): + """link(source, target) -> None + + Attempt to hard link the source file to the target file name. + On OS/2, this creates a complete copy of the source file. + """ + + s = os.open(source, os.O_RDONLY | os.O_BINARY) + if os.isatty(s): + raise OSError, (errno.EXDEV, 'Cross-device link') + data = os.read(s, 1024) + + try: + t = os.open(target, os.O_WRONLY | os.O_BINARY | os.O_CREAT | os.O_EXCL) + except OSError: + os.close(s) + raise + + try: + while data: + os.write(t, data) + data = os.read(s, 1024) + except OSError: + os.close(s) + os.close(t) + os.unlink(target) + raise + + os.close(s) + os.close(t) + +if __name__ == '__main__': + import sys + try: + link(sys.argv[1], sys.argv[2]) + except IndexError: + print 'Usage: emx_link ' + except OSError: + print 'emx_link: %s' % str(sys.exc_info()[1]) diff -Nur mailman-2.0.13.org/Mailman/LockFile.py mailman-2.0.13/Mailman/LockFile.py --- mailman-2.0.13.org/Mailman/LockFile.py Thu Oct 12 04:03:56 2000 +++ mailman-2.0.13/Mailman/LockFile.py Sat Jan 18 01:06:04 2003 @@ -65,6 +65,11 @@ import random from stat import ST_NLINK, ST_MTIME +if os.name == 'os2': + from emx_emul import link as os2_link + os.link = os2_link + del os2_link + # Units are floating-point seconds. DEFAULT_LOCK_LIFETIME = 15 # Allowable a bit of clock skew @@ -325,7 +330,7 @@ else: raise # TBD: can the link count ever be > 2? - if self.__linkcount() <> 2: + if os.name != 'os2' and self.__linkcount() <> 2: return 0 return self.__read() == self.__tmpfname @@ -368,6 +373,12 @@ try: # TBD: We probably don't need to modify atime, but this is easier. os.utime(filename or self.__tmpfname, (t, t)) + # on OS/2, due to link() emulation need to update global lockfile + # too if it exists and belongs to us + if os.name == 'os2' and not filename: + if os.access(self.__lockfile, os.F_OK): + if self.__read() == self.__tmpfname: + os.utime(self.__lockfile, (t, t)) except OSError, e: if e.errno <> errno.ENOENT: raise diff -Nur mailman-2.0.13.org/Mailman/MailList.py mailman-2.0.13/Mailman/MailList.py --- mailman-2.0.13.org/Mailman/MailList.py Tue May 29 14:45:26 2001 +++ mailman-2.0.13/Mailman/MailList.py Wed Dec 25 10:38:00 2002 @@ -258,11 +258,18 @@ def InitTempVars(self, name): """Set transient variables of this and inherited classes.""" - self.__lock = LockFile.LockFile( - os.path.join(mm_cfg.LOCK_DIR, name or '') + '.lock', - # TBD: is this a good choice of lifetime? - lifetime = mm_cfg.LIST_LOCK_LIFETIME, - withlogging = mm_cfg.LIST_LOCK_DEBUGGING) + if os.name in ('os2',): + self.__lock = LockFile.LockFile( + os.path.join(mm_cfg.LOCK_DIR, name or '=site=') + '.lock', + # TBD: is this a good choice of lifetime? + lifetime = mm_cfg.LIST_LOCK_LIFETIME, + withlogging = mm_cfg.LIST_LOCK_DEBUGGING) + else: + self.__lock = LockFile.LockFile( + os.path.join(mm_cfg.LOCK_DIR, name or '') + '.lock', + # TBD: is this a good choice of lifetime? + lifetime = mm_cfg.LIST_LOCK_LIFETIME, + withlogging = mm_cfg.LIST_LOCK_DEBUGGING) self._internal_name = name self._ready = 0 if name: @@ -833,6 +840,8 @@ os.link(fname, fname_last) except OSError, e: if e.errno <> errno.ENOENT: raise + if os.name == 'os2' and os.access(fname, os.F_OK): + os.unlink(fname) os.rename(fname_tmp, fname) def Save(self): diff -Nur mailman-2.0.13.org/Mailman/Defaults.py.in mailman-2.0.13/Mailman/Defaults.py.in --- mailman-2.0.13.org/Mailman/Defaults.py.in Wed Jul 24 14:02:26 2002 +++ mailman-2.0.13/Mailman/Defaults.py.in Fri Apr 9 15:40:28 2004 @@ -177,7 +177,7 @@ # Command for direct command pipe delivery to sendmail compatible program, # when DELIVERY_MODULE is 'Sendmail'. -SENDMAIL_CMD = '/usr/lib/sendmail' +SENDMAIL_CMD = '/usr/sbin/sendmail' # Allow for handling of MTA-specific features (i.e. aliases). Most MTAs use # "sendmail" (including Sendmail, Postfix, and Exim). Qmail uses the "qmail" diff -Nur mailman-2.0.13.org/Mailman/mm_cfg.py.dist.in mailman-2.0.13/Mailman/mm_cfg.py.dist.in --- mailman-2.0.13.org/Mailman/mm_cfg.py.dist.in Thu May 4 22:49:44 2000 +++ mailman-2.0.13/Mailman/mm_cfg.py.dist.in Wed Dec 25 10:37:40 2002 @@ -42,3 +42,5 @@ ################################################## # Put YOUR site-specific settings below this line. + +ARCHIVE_TO_MBOX = -1 diff -Nur mailman-2.0.13.org/src/Makefile.in mailman-2.0.13/src/Makefile.in --- mailman-2.0.13.org/src/Makefile.in Thu Apr 4 22:34:52 2002 +++ mailman-2.0.13/src/Makefile.in Mon Mar 22 12:30:34 2004 @@ -112,13 +112,13 @@ for f in $(CGI_PROGS); \ do \ exe=$(CGIDIR)/$$f$(CGIEXT); \ - $(INSTALL_PROGRAM) $$f $$exe; \ - chmod g+s $$exe; \ + emxbind -q $$f; \ + $(INSTALL_PROGRAM) $$f.exe $$exe; \ done for f in $(MAIL_PROGS); \ do \ - $(INSTALL_PROGRAM) $$f $(MAILDIR); \ - chmod g+s $(MAILDIR)/$$f; \ + emxbind -q $$f; \ + $(INSTALL_PROGRAM) $$f.exe $(MAILDIR); \ done # @for f in $(ALIAS_PROGS); \ # do \ diff -Nur mailman-2.0.13.org/src/alias-wrapper.c mailman-2.0.13/src/alias-wrapper.c --- mailman-2.0.13.org/src/alias-wrapper.c Tue Mar 21 06:26:40 2000 +++ mailman-2.0.13/src/alias-wrapper.c Mon Mar 22 13:09:00 2004 @@ -26,7 +26,7 @@ const char* SENDMAIL_CMD = "/usr/sbin/sendmail"; const char* ALIAS_FILE = "/etc/aliases"; -const char* WRAPPER = "/home/mailman/mailman/mail/wrapper"; +const char* WRAPPER = "/usr/local/mailman/mail/wrapper"; /* ** is the parent process allowed to call us?