Re: [Exim] Help on OS variations : Redhat 6.0 Linux Reply

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Adrian J Bool
Date:  
À: Philip Hazel
CC: exim-users
Anciens-sujets: [Exim] Help on OS variations, please
Sujet: Re: [Exim] Help on OS variations : Redhat 6.0 Linux Reply

Hi Phil,

To compile your test code on a RedHat 6.0 Linux box I needed to use,

gcc -Wall prog.c -lcrypt

on the file,


#include <stdio.h>
#ifdef I_CRYPT
#include <crypt.h>
#endif
#ifdef I_UNISTD
#include <unistd.h>
#endif

#define __USE_XOPEN 1
#include <unistd.h>

int main(void)
{
printf("%s\n", crypt("MySecret", "az"));
return 0;
}


Without the two added lines the file would only complite with implicit
declartion of funtion 'crypt' warnings.

I'm sure how on this box to tell if unistd.h is suitable without
first inculding the unistd.h file. If you wanna borrow a login to this
box (only my desktop ;-)) for a short while you are welcome...

Cheers,

aid


-- 
Adrian J Bool            | http://www.noc.u-net.net/
Network Manager            | tel://44.1925.484061/
U-NET Ltd            | fax://44.1925.484055/



On Fri, 20 Aug 1999, Philip Hazel wrote:

> The new code supporting AUTH in Exim includes a call to the crypt()
> function. It appears that different OS handle this differently. I have
> been able to check the following operating systems:
>
> Solaris, RedHat 4.2, IRIX 6, Digital Unix 4, HP-UX 9 & 11, BSDI, NetBSD,
> FreeBSD, and SCO 5.
>
> Please can those of you running any other operating systems run a little
> test for me. What I need to know, for each OS, is which #include is
> needed for crypt(), and whether -lcrypt is needed for linking. Here is a
> little test program:
>
> #include <stdio.h>
> #ifdef I_CRYPT
> #include <crypt.h>
> #endif
> #ifdef I_UNISTD
> #include <unistd.h>
> #endif
>
> int main(void)
> {
> printf("%s\n", crypt("MySecret", "az"));
> return 0;
> }
>
> Please compile this with maximum warnings turned on, e.g.
>
> gcc -Wall testprog.c
>
> If you get warnings about an implicitly declared function, try
>
> gcc -Wall -DI_UNISTD testprog.c
>
> and if that also warns, try
>
> gcc -Wall -DI_CRYPT testprog.c
>
> If the program fails to link, try adding -lcrypt to the end of the
> command. NetBSD and FreeBSD need this - can anybody test OpenBSD? BSDI
> does not. I have also heard that some versions of Linux need it. RedHat
> 4.2 does not.
>
> Let me know what you had to do to get a clean compile.
>
> If you run the program, the output should be "azrazPWCQJhyg".
>
> Many thanks.
>
> Philip
>
> -- 
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.

>
>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>