cvs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-dev] Re: cvs-passwd patch


From: Mark D. Baushke
Subject: [Cvs-dev] Re: cvs-passwd patch
Date: Tue, 03 Oct 2006 09:56:48 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Prasad J Pandit <address@hidden> writes:

>    Hello Mark, thank you for the information. :)
> 
> On Tue, 3 Oct 2006, Mark D. Baushke wrote:
> > The lines which follow are the expected output of the program. I
> > probably got the real output wrong. You could see what really came out
> > by running going to the src directory and running the
> > ../contrib/debug_check_log script to see what comparisons were not
> > correct, or by just looking at the output found in the src/check.log
> > file itself.
> 
>    Well, I saw the 'check.log' file, it only says
> "I LOVE YOU
> exit status was 0"
> 
>    that's all.

An exit status of 0 is enough to fail the test because the test expected
a non-zero return code due to the fact it was sending bogus information.

> 
> > | BEGIN AUTH REQUEST
> > | END AUTH REQUEST
> 
> 
>    What is BEGIN/END VERIFICATION REQUEST? Some of the pserver checks
> use it.

This is how the :pserver: protocol performs the authentication of a
connection. The "I LOVE YOU" output is what is returned when the
password for the provided username was correct. The "I HATE YOU" output
is used when either the password or username is not correct.

> 
> > I hope this helps somewhat.
> 
>    ummn, it seems enough; But I don't know, not sure!
> 
> anyways, Thank you! :)

You could always run the code in a debugger. To figure out what to send
or not send, you might add more information for yourself right before
the test to have it print out the current working directory and the
command it is about to run

        echo 'Debugging info:'
        pwd
        echo $CVSROOT
        echo "$servercvs --allow-root=${CVSROOT_DIRNAME} pserver"
        exit

now, outside of the scripts, go to the directory given by the 'pwd'
command and run a debugger using the text echoed by the about

    % gdb $servercvs
    (gdb) b passwd
    (gdb) run --allow-root=${CVSROOT_DIRNAME} pserver
    ...at this point you get to type into the cvs input the text that
    ...the server is expecting to see:
BEGIN AUTH REQUEST
${CVSROOT_DIRNAME}
testme
Ay::'d
END AUTH REQUEST
    ...at this point the server should print "I LOVE YOU"
Root ${CVSROOT_DIRNAME}
passwd
    ...at this point you will probably be at the passwd() function
    ...breakpoint. If you do a 'bt' to get a backtrace you should
    ...find that passwd has been called from the server() function in 
    ...server.c which in turn has been called from main() in main.c
    ...Now you may begin playing with the program by looking at variables
    ...and doing 'step' (s) or 'next' (n) operations to step through
    ...the code base and debug your problem. Just doing a continue (c)
    ...will probably continue through to either a core dump (which we
    ...really are trying to avoid) or may put the server back into a
    ...read waiting for more input from you.

A different command you could have given instead of 'passwd' to test
that you understand how things are working might be the 'noop' command
which calls the serve_noop() function in server.c all it should really
do is print out "ok" as the result. Just as the 'version' command
wouild print out something like:

M Concurrent Versions System (CVS) 1.12.13.1 (client/server)
ok

Whatever you are typing is just like what your client would normally be
sending to the server. So, if you typed

Valid-responses ok error Valid-requests Force-gzip Referrer Redirect Checked-in 
New-entry Checksum Copy-file Updated Created Update-existing Merged Patched 
Rcs-diff Mode Mod-time Removed Remove-entry Set-static-directory 
Clear-static-directory Set-sticky Clear-sticky Edit-file Template 
Clear-template Notified Module-expansion Wrapper-rcsOption M Mbinary E F MT 
Base-checkout Temp-checkout Base-copy Base-merge Base-entry Base-merged 
Base-diff Base-signatures Base-clear-signatures OpenPGP-signature
valid-requests

You would expect something like:

Valid-requests Root Valid-responses valid-requests Command-prep Referrer 
Repository Directory Relative-directory Max-dotdot Static-directory Sticky 
Entry Kopt Checkin-time Modified Signature Base-diff Is-modified 
Empty-conflicts UseUnchanged Unchanged Notify Hostname LocalDir Questionable 
Argument Argumentx Global_option Gzip-stream wrapper-sendme-rcsOptions Set 
expand-modules ci co update diff log rlog list rlist global-list-quiet ls add 
remove update-patches gzip-file-contents sign status rdiff tag rtag import 
admin export history release watch-on watch-off watch-add watch-remove watchers 
editors edit init annotate rannotate noop version

to be returned. In your case, you will want to be sure you see "passwd"
in the list of Valid-requests that are returned from the server. This
means that the passwd command is actually legal.

If you wished to do what a 'cvs rlog CVSROOT/commitinfo' client would
do, you might use something like the following four lines:

UseUnchanged
Argument --
Argument CVSROOT/commitinfo
rlog

You may use the CVS_CLIENT_LOG environement variable to figure out
exactly how your new code is sending stuff along the wire, it will be in
the $CVS_CLIENT_LOG.in file with server responses in the
$CVS_CLIENT_LOG.out file.

I hope this helps to get you started.

        -- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFFIpZQCg7APGsDnFERAnPmAJ49ezfZmjn/dSOmcMdc829ynA7FnwCfdhw+
i09kprj8NI61nK8lTLYmsp8=
=yJ+n
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]