Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 150987 - Bugfix for qmailadmin-1.2.1 or 1.2.9 needed (MAX_BUFF differs with include order)
Summary: Bugfix for qmailadmin-1.2.1 or 1.2.9 needed (MAX_BUFF differs with include or...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-12 03:07 UTC by Erik Wasser
Modified: 2006-11-13 03:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Wasser 2006-10-12 03:07:23 UTC
In qmailadmin-1.2.1.tar.gz and qmailadmin-1.2.9.tar.gz is a a bug that could lead into a segfault if you want to change the password (or other attributes) of a user. The error lies in the include order of qmailadmin.h and vpopmail.h. Both files defines a MAX_BUFF contanst with different sizes:

qmailadmin.h:
#define MAX_BUFF 500

vpopmail.h:
#define MAX_BUFF 300

Depending on the include order of this files qmailadmin will use different sizes in different object files. So at compile time qmailadmin.c uses 300, command.c uses 300 and user.c uses 500 bytes. qmailadmin uses a lot of global buffers with MAX_BUFF so this backfires when you change a user (and even more).

These two posts are showing the problem. The first introduces the bug (IMHO) and 
the second fixes the bug:

http://www.mail-archive.com/qmailadmin@inter7.com/msg04133.html
http://www.mail-archive.com/qmailadmin@inter7.com/msg06301.html (last 
sentence)

So the problem is fixed with version with 'qmailadmin-1.2.10' but this version is not in the portage so gentoo has to do something. Either gentoo has to bump the version or someone should fix the bug for the stable qmailadmin-1.2.1.

I've made a quick fix/hack and replaced 500 value in qmailadmin.h with 300 and then everything was fine.

For a better patch someone should bring in the include commands of all *.c in one fixed order. I would do this if someone says 'Please do it'. B-)
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-11-13 03:03:40 UTC
1.2.10 is already in the tree.