Here's a patch, from the FreeBSD port of 5.4.17, to
avoid a race condition in scanning a domain directory
for .qmail-style aliases. In the current code, there is
a time of check vs. time of use race condition: the
valias_select_names() routine does an opendir / readdir
/ closedir loop, counts the files, allocates memory,
and then does another opendir / readdir / closedir
loop. If anybody should create a new alias in the
(admittedly small) interval between the two loops, bad
things might happen. This patch does everything in a
single loop, dynamically realloc(3)'ing the aliases
buffer as necessary.
If the patch does not come through for any reason, it
is also available at
http://people.freebsd.org/~roam/patches/vpopmail/vpalias-dynalloc-names.pat
ch
Rick Widmer
None
None
Public
|
Date: 2006-11-24 02:43
|
| Filename | Description | Download |
|---|---|---|
| vpalias-dynalloc-names.patch | Dynamically allocate memory for listing the .qmail-style aliases | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| summary | Avoid a vpalias race condition | 2006-11-24 16:00 | tomcollins |
| status_id | Open | 2006-11-24 02:43 | rwidmer |
| assigned_to | nobody | 2006-11-24 02:43 | rwidmer |
| close_date | - | 2006-11-24 02:43 | rwidmer |
| File Added | 197186: vpalias-dynalloc-names.patch | 2006-10-08 18:36 | roamer |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use