cvs-dev
[Top][All Lists]
Advanced

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

[Cvs-dev] Re: cvs-passwd patch: weird problem


From: Mark D. Baushke
Subject: [Cvs-dev] Re: cvs-passwd patch: weird problem
Date: Thu, 17 Aug 2006 07:43:53 -0700

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

Prasad J Pandit <address@hidden> writes:

>    Hello Mark :) hello Derek :)
> 
> Hello all :). Finally, onec again, I'm working on the cvs-passwd
> patch. But, for last couple of days I'm observing a very weird
> behaviour of it.
> 
>    see, on the cvs server side, my function spasswd () receives the
> user credentials as argument, and calls another function change_pass
> (). The problem is, it works properly, IF and ONLY IF, I print value
> of variable 'str (a char *)' or encrypted password 'pass (a char *)'
> before calling change_pass ().

That sounds very odd indeed. It sounds to me as though you are getting
bit by aliasing with local variables. If you are doing any casting
between types and you are using a very recent gcc, then you may find
that adding -fno-strict-aliasing to your CFLAGS will fix your problem.

However, if this does indeed fix your problem, then you need to change
how you are using casing completely as what you are doing is not really
portable.

A quick google on strict aliasing turns up this document:

http://www.cellperformance.com/mike_acton/2006/06/understanding_strict_aliasing.html

which you may find useful in understanding what is happening.

        Enjoy!
        -- Mark

>    And if I don't do that, I've observed, value of variable 'usr (a
> char *) changes to empty string ""(actually it points to some
> different address all together), and the same is received by function
> chage_pass (), which in turn causes it to fail. :(
> 
> I recently upgraded to a new machine with FC5 running on it. And it's
> on this machine I fist saw this problem, back then, it's like if I
> print "\n" before calling change_pass (), it would work, otherwise it
> wouldn't; Using fflush (stdout) solved it then, but now it's not
> enough. I'm not able to figure out what am I doing wrong.
> 
> Could you please look into it? You can get this unstable source at
> 
> http://www.cdacbangalore.in/~prasad/tools/cvs-1.12.13.unstable.tar.bz2
> 
> file: passwd.c, passwd.h
> function: spasswd ();
> 
> Thank you! :)
> -- 
> regards
>     -Prasad
> PS: Please don't send me html/attachment/Fwd mails
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFE5ICoCg7APGsDnFERApoAAJ4vs6r+mOSZw7CbbcLKD+CcIH+s0gCg3oKN
BA/eAKB46n8lNgh6fbK/g6o=
=GrMj
-----END PGP SIGNATURE-----




reply via email to

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