"wrong" permissions on attachment files

Bug #265615 reported by Lniles
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Barry Warsaw

Bug Description

check_perms and whoever creates the files in
archives/.../attachments/ disagree on what the
permissions should be on those files --
check_perms wants the setgid bit on, but the files
are created without it.

[http://sourceforge.net/tracker/index.php?func=detail&aid=526519&group_id=103&atid=100103]

Revision history for this message
Barry Warsaw (barry) wrote :

Hmm, I can't verify this. Both the attachements directory
and its subdirs appear to have the right permissions. g+s
and check_perms gives no errors. Could it be a system or
set up problem? Try running check_perms -f a few times and
then send another message w/ an attachment. Does it work now?

Revision history for this message
Lniles (lniles) wrote :

This seems to be a problem with python 2.1.2 on FreeBSD
4.4. -- directories created by os.mkdir() don't get the
setgid or setuid bits.

Revision history for this message
Barry Warsaw (barry) wrote :

I just tried an experiment on the FreeBSD 4.5 system on the
SF compile farm, and indeed, creating a directory with

os.mkdir('dir', 02775)

did not set the setgid bit, however doing a subsequent

os.chmod('dir', 02770)

did set the setgid bit on the directory. This with Python
2.1.1.

I could be wrong, but I think this is a bug in Python.
Would you submit the bug report to the Python project's bug
tracker?

I'm wary of changing all os.mkdir() calls in Mailman to
os.mkdir(); os.chmod() calls, especially if this can be
fixed in a Python patch release. I'll leave this bug open
for now until a resolution is seen in Python.

Revision history for this message
Lniles (lniles) wrote :

It looks like Python is not going to take care of this --
here's the response to bug #539942. (BTW, the only place
I've seen this crop up is in the attachment files, so
maybe the explicit chmod() would only need to be added
there.)
-------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-04-06 01:50

Message:
Logged In: YES
user_id=21627

This is not a bug. The posix module exposes functions from
the OS as-is, not trying to unify them. The os module
re-exposes those functions where available. Minor details of
the behaviour of those functions across platforms are
acceptable. For example, on Windows, os.mkdir does not set
any bits. Instead, ACLs are inherited according to the OS
semantics (i.e. it does on NTFS, but doesn't on FAT32).

If you need a function that makes certain additional
guarantees, write a new function.

Revision history for this message
Barry Warsaw (barry) wrote :

Please try the attached patch. While this doesn't fix every
os.mkdir() in the system, it does I think fix this specific
problem.

Revision history for this message
Barry Warsaw (barry) wrote :

Since I haven't heard back from Les, I'm just going to go
ahead and commit this change.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.