You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by tser <te...@worldonline.nl> on 1999/04/17 12:57:24 UTC

defening vars not used inside Ports.?

hi!

While (trying :o)) to compile apache with visual studio 6, it reported 
that there was some kind of unused var inside the ap/ap_md5c.c source

So i looked up into the source and saw :

--------
API_EXPORT(char *) ap_validate_password(const char *passwd, const char
*hash)
{
    char sample[120];
    char *crypt_pw;

    if (!strncmp(hash, apr1_id, strlen(apr1_id))) {
        /*
         * The hash was created using our custom algorithm.
         */
        ap_MD5Encode(passwd, hash, sample, sizeof(sample));
    }
    else {
        /*
         * It's not our algorithm, so feed it to crypt() if possible.
         */
#ifdef WIN32
        return "crypt() unavailable on Win32, cannot validate password";
#else
        crypt_pw = crypt(passwd, hash);
        ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1);
#endif
    }
    return (strcmp(sample, hash) == 0) ? NULL : "password mismatch";
}


------------

obiously we a declaring here a char *crpyt_pw which is not used inside
the WIN32 Port. 
Shouldn't  we also put the char decleration inside #define's or was this
by design ?

eg :
------------


API_EXPORT(char *) ap_validate_password(const char *passwd, const char
*hash)
{
    char sample[120];
#ifndef WIN32
    char *crypt_pw;
#endif
    if (!strncmp(hash, apr1_id, strlen(apr1_id))) {

 (....)
}
--------------


    Greetings from the land of water,
						- Reinder Kraaij

Re: crypt ( was :defening vars not used inside Ports.?)

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Supra Genius wrote:
> 
>   why does apache not use crypt on NT?
> there is at least one freeware library
> with a crypt function that works on it
> (that would be ufc_crypt...)

Because of international export issues concerning encryption
technology.
-- 
#ken    P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Software Foundation  <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

crypt ( was :defening vars not used inside Ports.?)

Posted by Supra Genius <su...@curasoft.com>.
hi,
  why does apache not use crypt on NT?
there is at least one freeware library
with a crypt function that works on it
(that would be ufc_crypt...)

		see ya |} zed
--