Problem with crypt on linux 
Author Message
 Problem with crypt on linux

Hello group,

I have not done anything in C for quit some time. I have a software
package I am trying to compile and I get the following error on make:

cc -O -DNOSHADOW -o radiusd.esva radiusd.o dict.o users.o util.o md5.o
attrprint
.o acct.o version.o
radiusd.o: In function `unix_pass':
radiusd.o(.text+0x1ebb): undefined reference to `crypt'
make: *** [radiusd.esva] Error 1

Looking at the source code I found the following:

unix_pass(name, passwd)
char    *name;
char    *passwd;
{
        struct passwd   *pwd;
        struct passwd   *getpwnam();
        char            *encpw;
        char            *crypt();
        char            *encrypted_pass;

I am not really sure what is going on or if there are statements
missing. Can any one give me a direction to look for use of crypt in C
on Linux?

Thanks.
--
#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql)

$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,
-68,4,-3,-1,7,1,14,-68,6,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);



Sat, 21 Apr 2001 03:00:00 GMT  
 Problem with crypt on linux


...

Quote:
>I am not really sure what is going on or if there are statements
>missing. Can any one give me a direction to look for use of crypt in C
>on Linux?

One of the Linux newsgroups perhaps? Crypt isn't defined by the C language
so there's not much that can usefully be said about it here.

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


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



Sun, 22 Apr 2001 03:00:00 GMT  
 Problem with crypt on linux
: Hello group,

: I have not done anything in C for quit some time. I have a software
: package I am trying to compile and I get the following error on make:

: cc -O -DNOSHADOW -o radiusd.esva radiusd.o dict.o users.o util.o md5.o
: attrprint
: .o acct.o version.o
: radiusd.o: In function `unix_pass':
: radiusd.o(.text+0x1ebb): undefined reference to `crypt'
: make: *** [radiusd.esva] Error 1

: Looking at the source code I found the following:

: unix_pass(name, passwd)
: char    *name;
: char    *passwd;
: {
:         struct passwd   *pwd;
:         struct passwd   *getpwnam();
:         char            *encpw;
:         char            *crypt();
:         char            *encrypted_pass;

: I am not really sure what is going on or if there are statements
: missing. Can any one give me a direction to look for use of crypt in C
: on Linux?

It looks as if it's a library function; it's not part of any standard
library I know, but I don't have a linux system running to check it.
Certainly some Unix systems have a crypt() function.  Your best bet
is to check your library sources, and add the appropriate library
name to the list of files to be linked.

Will



Mon, 23 Apr 2001 03:00:00 GMT  
 Problem with crypt on linux

Quote:

>: cc -O -DNOSHADOW -o radiusd.esva radiusd.o dict.o users.o util.o md5.o
>: attrprint
>: .o acct.o version.o
>: radiusd.o: In function `unix_pass':
>: radiusd.o(.text+0x1ebb): undefined reference to `crypt'
>: make: *** [radiusd.esva] Error 1
...
>: I am not really sure what is going on or if there are statements
>: missing. Can any one give me a direction to look for use of crypt in C
>: on Linux?

>It looks as if it's a library function; it's not part of any standard
>library I know, but I don't have a linux system running to check it.

It's part of any Unix system you're likely to encounter.  Although not
POSIX, it's required by SVID and X/OPEN.

Quote:
>Certainly some Unix systems have a crypt() function.

It's an esential function on a Unix system, because it's the function
used to generate the encrypted passwords in /etc/passwd (or whatever) and
to encrypt the user input when they are asked to type their login
passwords.  The only way to ensure that all programs that authenticate
users against their records from /etc/passwd work properly, they have
to use the same encryption function and that function is crypt.

Quote:
>Your best bet
>is to check your library sources, and add the appropriate library
>name to the list of files to be linked.

On older Linux distributions it used to be in libc, so it was automatically
found by the linker.  On the most recent ones, it's been moved to libcrypt,
so a -lcrypt is required at link time.

Checking library sources is overkill when all you need is to discover which
library contains a certain function on a Unix system.  nm can list the
contents of a library and that can be easily piped into grep.  And most
system libraries can be found in /lib.

Ideally, the man pages should explicitly say which library is required for
any function that is not in libc, but they omit this helpful bit of
information quite often.

Dan
--
Dan Pop
CERN, IT Division

Mail:  CERN - EP, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland



Tue, 24 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. crypt on a Linux machine

2. searching linux-compatible crypt() for Winwos 95/98/NT

3. Problem with MS Crypt API

4. Crypt problems

5. Linux(Yes, linux, I don't know where else to put it) .H file

6. Who uses Linux (was: The future of Linux...?)

7. Who uses Linux (was: The future of Linux...?)

8. I need the equivalent of crypt on my linux box. Where to get it?

9. Linux to aix buffer problem

10. Signal Handling Problem for GNU C on Linux

11. Problems with 2GB RAM on Linux and libc's sbrk

12. Problems with 2GB RAM on Linux and libc's sbrk

 

 
Powered by phpBB® Forum Software