Red Hat Bugzilla – Bug 55738
xinted truncates environment variable list if many variables are added
Last modified: 2007-04-18 12:38:02 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12 i686)
Description of problem:
There is a bug in the xinetd source that causes xinetd to truncate the list
variables. The bug occurs if xinetd attempts to grow the environment
variable list. What
happens is that after growing the list, xinetd attempts to set to NULL all
pointers; unfortunately, there is an off-by-one error in the indexing that
causes it to
set to NULL the last set environment variable. As all new environment
added after this, they will never be seen by the exec'ed child (the env var
list is NULL-
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Modify the xinetd configuration file for one of the services that must
2. Add several new environment variables to be passed to the service (say
to be safe).
3. strace xinetd and then contact the service. You will notice in the
strace that the exec
of the service does not contain all the environment variables that you
Actual Results: some environment variables are missing from the
environment of the child server.
Expected Results: all specified additional environment variables should
have been present.
The bug lies in libs/src/misc/m_env.c:grow(). The memset() at the end of
function should begin at index &ep->vars[ep->n_vars], not at
&ep->vars[ep->n_vars-1]. The actual size of this array at any point in time
ep->max_vars + 1.
The change looks sane to me... bbraun, any comments??
Looks fine. It's included in the current development release. Can someone
try the latest development version at http://www.xinetd.org/devel and see if
you still have the problem. Should be fixed, but a verification would be good.
An rpm can be found at http://people.redhat.com/teg/xinetd/ - can the reporter
I've checked the rpm/srpm that you prepared. The source contains the fix, and
testing on my
machine shows the problem solved.