This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: debugging an rexec() problem


Hi, Andreas.

I now understand this problem.

- passing NULL into rexec(3) _is_ allowable.  The HPUX rexec(3) man page
says

"If either user or passwd are NULL, rexec() searches for the appropriate
information in the .netrc file (see netrc(4)) in the user's home
directory.  If no user or passwd are found, rexec() prompts the user for
the remote user name and password, defaulting to the local user name and
a NULL password"

glibc rexec() calls ruserpass() which _does_ check for NULL pointers and
does the right thing. It returns the NULL pointers if it couldn't find a
match.   However rexec() blindly passes the null pointer into a write()
and dies.

To be compliant with the HPUX man page, either the glibc rexec() or the
glibc ruserpass() need to be taught to prompt the user for the
username/password.

I've reported this to bug-glibc@gnu.org.


Now, you say that glibc is built for debug by default.  Could you please
give me another hint?  If I wish to single-step my way through the C
library, precisely how should I link my application?  The Mandrake
/usr/lib/libc.a doesn't seem to be built for debug, so I assume I need
to build glibc myself??

Thanks.

Andreas Jaeger wrote:
> 
> >>>>> Andrew Morton writes:
> 
>  > Hi, folks.
>  > I'm running the latest Mandrake distribution (glibc2.1.1pre2).  The
>  > 'rexec' client is broken.  If I run it without '-l username -p password'
>  > then I get a segfault in rexec().
> 
>  > Here's a snippet from rexec.c:
> 
>  >   if ( user_name == NULL )
>  >     user_name = getenv("REXEC_USER");
>  >   if ( passwd == NULL )
>  >     passwd = getenv("REXEC_PASS");
> 
>  >   if ( (sock = rexec(&host, port_exec, user_name, passwd, command,
>  >                      p_to_aux_sock)) < 0 )
> 
>  > Now, passing in zero for user_name and passwd is valid, but a core dump
>  > isn't :-).
> passing in an empty string for user_name and passwd is valid but not
> passing in NULL AFAIK.
> 
>  > My question: what's the normal way of building a debugging glibc so I
>  > can step through and resolve this?
> glibc is build by default with the debug info in it.
> 
> Btw. read the source first.  rexec is implemented in inet/rexec.c.
> 
> Andreas
> --
>  Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
>   for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]