Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 53533
Alias:
Product:
Component:
Status: RESOLVED
Resolution: TEST-REQUEST
Assigned To: Net-Mail Packages <net-mail@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jim Ramsay <lack@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
mailman-2.1.5-gentoo-check_perm.patch Patch to 'check_perm' script to make it ignore '.keep' files patch Jim Ramsay 2004-06-28 12:00 0000 1.76 KB Details | Diff
mailman-2.1.5-directory-check.patch mailman-2.1.5-directory-check.patch patch Brian Harring 2004-07-21 10:22 0000 606 bytes Details | Diff
mailman-2.1.5-directory-check.patch mailman-2.1.5-directory-check.patch patch Brian Harring 2004-07-21 15:29 0000 641 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 53533 depends on: Show dependency tree
Bug 53533 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-06-10 08:30 0000
Emerge of Mailman 2.1.5 fails when running check_perm.  Also, instructions urge
user to run check_perm as either root or mailman user.  In either case, the
script fails with this python stacktrace:

Traceback (most recent call last):
  File "bin/check_perms.orig", line 367, in ?
    checkdata()
  File "bin/check_perms.orig", line 321, in checkdata
    mode = statmode(path)
  File "bin/check_perms.orig", line 81, in statmode
    return os.stat(path)[ST_MODE]
OSError: [Errno 20] Not a directory:
'/usr/local/mailman/lists/.keep/config.pck'

Reproducible: Always
Steps to Reproduce:
1. Run bin/check_perms in /usr/local/mailman
Actual Results:  
Script failed and said:

Traceback (most recent call last):
  File "bin/check_perms.orig", line 367, in ?
    checkdata()
  File "bin/check_perms.orig", line 321, in checkdata
    mode = statmode(path)
  File "bin/check_perms.orig", line 81, in statmode
    return os.stat(path)[ST_MODE]
OSError: [Errno 20] Not a directory:
'/usr/local/mailman/lists/.keep/config.pck'

Expected Results:  
Checked permissions and completed successfully

This is because some directories have a .keep file added by the ebuild system
in
some directories that this script is not expecting.  The following patch seems
to fix it:

--- check_perms.orig    2004-06-10 09:26:22.717024396 -0600
+++ check_perms 2004-06-09 16:27:49.000000000 -0600
@@ -313,23 +313,24 @@
         print _('checking permissions on list data')
     # BAW: This needs to be converted to the Site module abstraction
     for dir in os.listdir(mm_cfg.LIST_DATA_DIR):
-        for file in checkfiles:
-            path = os.path.join(mm_cfg.LIST_DATA_DIR, dir, file)
-            if STATE.VERBOSE:
-                print _('    checking permissions on: %(path)s')
-            try:
-                mode = statmode(path)
-            except OSError, e:
-                if e.errno <> errno.ENOENT: raise
-                continue
-            if (mode & targetmode) <> targetmode:
-                STATE.ERRORS += 1
-                print _('file permissions must be at least 660: %(path)s'),
-                if STATE.FIX:
-                    print _('(fixing)')
-                    os.chmod(path, mode | targetmode)
-                else:
-                    print
+       if dir != '.keep':
+            for file in checkfiles:
+                path = os.path.join(mm_cfg.LIST_DATA_DIR, dir, file)
+                if STATE.VERBOSE:
+                    print _('    checking permissions on: %(path)s')
+                try:
+                    mode = statmode(path)
+                except OSError, e:
+                    if e.errno <> errno.ENOENT: raise
+                    continue
+                if (mode & targetmode) <> targetmode:
+                    STATE.ERRORS += 1
+                    print _('file permissions must be at least 660:
%(path)s'),
+                    if STATE.FIX:
+                        print _('(fixing)')
+                        os.chmod(path, mode | targetmode)
+                    else:
+                        print

------- Comment #1 From Matteo Settenvini 2004-06-25 01:56:16 0000 -------
Thank you, this works for me.

Could you create an attachment with the patch? It makes it easier to include it in portage / try it out / keep things in order.

------- Comment #2 From Jim Ramsay 2004-06-28 12:00:24 0000 -------
Created an attachment (id=34345) [details]
Patch to 'check_perm' script to make it ignore '.keep' files

------- Comment #3 From Jaco Kroon 2004-07-16 14:35:54 0000 -------
Wouldn't a simpler solution be to delete the .keep file from the lists
directory before calling the check_perms script?

------- Comment #4 From Jim Ramsay 2004-07-18 20:25:12 0000 -------
Yes, but I'm assuming that the .keep file is there for a reason... 

Probably to stop some gentoo-only process somewhere from deleting that directory if there aren't any lists yet.

------- Comment #5 From Tuan Van (RETIRED) 2004-07-21 09:47:01 0000 -------
the '.keep' file put in there to _keep_ the directory from wipeout by portage
during unmerge the older version if it's empty.
Jim, I don't know any python, so I asked. Will your patch skips check on the
file '.keep' or skips any directory that contains '.keep'?

------- Comment #6 From Brian Harring 2004-07-21 10:22:07 0000 -------
Created an attachment (id=35893) [details]
mailman-2.1.5-directory-check.patch

Problem with this code is that it assumes everything in mm_cfg.LIST_DATA_DIR is
going to be a directory (which the .keep file has disproven already).

I'm not much for singling out just the .keep file to ignore; in my books, if it
ain't a directory, don't try using it as one :)
Either way, this is a 2 line fix that checks to see if dir is actually a
directory; if so, do the checks in that directory, otherwise go on to the next
returned entry from os.listdir .

------- Comment #7 From Brian Harring 2004-07-21 15:29:07 0000 -------
Created an attachment (id=35923) [details]
mailman-2.1.5-directory-check.patch

...and I'm a tool for not concattenating the path :D

Corrected version.

------- Comment #8 From Tuan Van (RETIRED) 2004-07-21 17:36:34 0000 -------
fixed in mailman-2.1.5-r1 with ~arch keywords. Please test and report back you
experience any problem. Thanks everyone.

sparc: this is a minor fix. Please test stable this if you can. Thanks.

------- Comment #9 From Tuan Van (RETIRED) 2004-07-21 17:41:01 0000 -------
*** Bug 56250 has been marked as a duplicate of this bug. ***

------- Comment #10 From Jim Ramsay 2004-08-05 09:25:52 0000 -------
Works here.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug