CRYPT_GENSALT man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

CRYPT_GENSALT(3C)					     CRYPT_GENSALT(3C)

NAME
       crypt_gensalt - generate salt string for string encoding

SYNOPSIS
       #include <crypt.h>

       char *crypt_gensalt(const char *oldsalt, const struct passwd *userinfo);

DESCRIPTION
       The  crypt_gensalt()  function  generates  the  salt string required by
       crypt(3C).

       If oldsalt is NULL,  crypt_gensalt()  uses  the	algorithm  defined  by
       CRYPT_DEFAULT in /etc/security/policy.conf. See policy.conf(4).

       If  oldsalt  is	non-null,  crypt_gensalt() determines if the algorithm
       specified  by  oldsalt  is  allowable  by  checking   the   CRYPT_ALGO‐
       RITHMS_ALLOW  and  CRYPT_ALGORITHMS_DEPRECATE  variables	 in /etc/secu‐
       rity/policy.conf. If the algorithm is  allowed,	crypt_gensalt()	 loads
       the appropriate shared library and calls crypt_gensalt_impl(3C). If the
       algorithm is not allowed or there is no entry  for  it  in  crypt.conf,
       crypt_gensalt() uses the default algorithm.

       The  mechanism  just described provides a means to migrate users to new
       password hashing algorithms when the password is changed.

RETURN VALUES
       Upon successful completion, crypt_gensalt() returns a  pointer  to  the
       new  salt.  Otherwise  a	 null  pointer is returned and errno is set to
       indicate the error.

ERRORS
       The crypt_gensalt() function will fail if:

       EINVAL
		  The configuration file crypt.conf contains an invalid entry.

       ELIBACC
		  The required shared library was not found.

       ENOMEM
		  There is insufficient memory to perform hashing.

USAGE
       The value returned  by  crypt_gensalt()	points	to  a  null-terminated
       string.	 The  caller  of  crypt_gensalt()  is  responsible for calling
       free(3C).

       Applications dealing with user  authentication  and  password  changing
       should  not  call  crypt_gensalt() directly but should instead call the
       appropriate pam(3PAM) functions.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌────────────────────┬─────────────────┐
       │  ATTRIBUTE TYPE    │ ATTRIBUTE VALUE │
       ├────────────────────┼─────────────────┤
       │Interface Stability │ Evolving	      │
       ├────────────────────┼─────────────────┤
       │MT-Level	    │ MT-Safe	      │
       └────────────────────┴─────────────────┘

SEE ALSO
       passwd(1), crypt(3C),  crypt_genhash_impl(3C),  crypt_gensalt_impl(3C),
       getpassphrase(3C),  malloc(3C),	pam(3PAM),  crypt.conf(4),  passwd(4),
       policy.conf(4), attributes(5)

				 Jun 10, 2002		     CRYPT_GENSALT(3C)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net