diff options
Diffstat (limited to 'bin/mailmanctl')
-rw-r--r-- | bin/mailmanctl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/mailmanctl b/bin/mailmanctl index 473c9470..613f909f 100644 --- a/bin/mailmanctl +++ b/bin/mailmanctl @@ -1,6 +1,6 @@ #! @PYTHON@ -# Copyright (C) 2001-2006 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2010 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 @@ -417,6 +417,13 @@ def main(): # won't be opening any terminal devices, don't do the ultra-paranoid # suggestion of doing a second fork after the setsid() call. os.setsid() + + # Be sure to close any open std{in,out,err} + devnull = os.open('/dev/null', 0) + os.dup2(devnull, 0) + os.dup2(devnull, 1) + os.dup2(devnull, 2) + # Instead of cd'ing to root, cd to the Mailman installation home os.chdir(mm_cfg.PREFIX) # Set our file mode creation umask |