crypt_gensalt(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

crypt_gensalt(3c)

crypt_gensalt(3C)        Standard C Library Functions        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(5).


       If  oldsalt  is  non-null,  crypt_gensalt() determines if the algorithm
       specified by oldsalt is allowable by checking the  CRYPT_ALGORITHMS_AL‐
       LOW  and  CRYPT_ALGORITHMS_DEPRECATE  variables  in  /etc/security/pol‐
       icy.conf. If the algorithm is allowed, crypt_gensalt() loads the appro‐
       priate shared library and calls crypt_gensalt_impl(3C).  If  the  algo‐
       rithm  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  in‐
       dicate 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(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe


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

Oracle Solaris 11.4               10 Jun 2002                crypt_gensalt(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3