~xav0989/ubuntu/vivid/mailman/ubuntu-logo

« back to all changes in this revision

Viewing changes to contrib/check_perms_grsecurity.py

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2008-04-24 19:30:49 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080424193049-jy5fa9tus40tjbmn
Tags: 1:2.1.10-2
Apply upstream patch to fix regression in cmd_subscribe
so that email subscribe to the -subscribe or -join address or the
-request address with a bare 'subscribe' command results in the message
being shunted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! @PYTHON@
2
2
#
3
 
# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
 
3
# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
4
4
#
5
5
# This program is free software; you can redistribute it and/or
6
6
# modify it under the terms of the GNU General Public License
14
14
#
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 
18
# USA.
18
19
 
19
20
"""Fixes for running Mailman under the `secure-linux' patch or grsecurity.
20
21
 
102
103
from Mailman.mm_cfg import MAILMAN_USER, MAILMAN_GROUP
103
104
 
104
105
class CheckFixUid:
 
106
    uid = pwd.getpwnam(MAILMAN_USER)[2]
 
107
    gid = grp.getgrnam(MAILMAN_GROUP)[2]
105
108
    if os.geteuid() == 0:
106
 
        uid = pwd.getpwnam(MAILMAN_USER)[2]
107
 
        gid = grp.getgrnam(MAILMAN_GROUP)[2]
108
109
        os.setgid(gid)
109
110
        os.setuid(uid)
110
111
    if os.geteuid() != uid: