[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

crypt problem



Hej. 

Jeg forsøger at bruge crypt(), jeg har lavet et lille test
program som:

#include <fstream.h>
// extern char *crypt __P ((__const char *__key, __const char *__salt));
#define _XOPEN_SOURCE
#include <unistd.h>
#include <string.h>

void main()
{
    char pass[9];
    char word[9];   
        
    cout << "Enter a password: ";
    cin.getline(pass,8);

    strcpy(word,crypt(pass,"zq"));
    cout << "Encrypted: " << word << "\n";
}

Men den kan ikke finde definitionen af crypt fra unistd.h, denne kræver
at __USE_XOPEN er erklæret, men selv hvis jeg gør dette virker det ikke.
Uncommenter jeg "extern char .." der stammer fra unistd.h kan den ikke
linke objekt filen. Hvad skal jeg linke filen mod for at få det til
at virke?

Jeg skal bruge programmet til password protecte websider i apache, 
det kræver at man har crypt() encryptered passwordet.
Jeg kunne selvfølgeligt bare ændre mit password og hente det fra
/etc/passwd, men det burde være muligt at gøre det med ovenstående.

-- 
	Sometimes it's better to light a       Carsten Svaneborg
      flamethrower than curse the darkness.      sslug@sslug
	-- (Terry Pratchett, Men At Arms)    Fight Bill - use Linux


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *