


PEKS-PASSWD(3)  PEKS 0.8.13 Programming Interface  PEKS-PASSWD(3)


NNAAMMEE
       peks_edit_passwd_file - handling user passwords

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<ppeekkss..hh>>

       cchhaarr **ppeekkss__eeddiitt__ppaasssswwdd__ffiillee
              ((ccoonnsstt ppeekkss__kkeeyy **_p_r_v___k_e_y,, ccoonnsstt cchhaarr **_u_s_r___a_t___h_o_s_t,,
               iinntt _c_o_u_n_t,, ccoonnsstt cchhaarr **_p_a_s_s_w_d,,
               ccoonnsstt cchhaarr **_p_w_d___f_i_l_e));;

DDEESSCCRRIIPPTTIIOONN
       PPeekkss__eeddiitt__ppaasssswwdd__ffiillee  (())  manipulates passwords which can
       be stored together with any kind of user,  or  host  keys.
       Passwords  are  tagged as user keys, so the same selection
       algorithm applies as in ppeekkss--kkeeyyss(3).

       If the first  argument  _p_r_v___k_e_y  and  the  forth  argument
       _p_a_s_s_w_d  are  non  NULL,  the password line selected by the
       second  argument  _u_s_r___a_t___h_o_s_t  is  appended,  or  replaced
       respectively with an prv_key-encrypted version of the text

           <count> <usr> <passwd>

       where count is the letter '0' + _c_o_u_n_t modulo 32 (_c_o_u_n_t  is
       the  third  argument,)  <usr>  is  the  user  name part of
       _u_s_r___a_t___h_o_s_t (looking like "usr@host"), and <passwd> is the
       text given as the forth argument _p_a_s_s_w_d.

       If  the  first  argument _p_r_v___k_e_y is non NULL but the forth
       argument _p_a_s_s_w_d is  NULL, the passwd line is  decoded  and
       returned.  With  a  non-negative third argument _c_o_u_n_t, the
       three fields

           <count> <usr> <passwd>

       are  returned  which  is  the  literal  contents  of   the
       encrypted  password  text, stored in the data base. If the
       argument _c_o_u_n_t is negative, a  fourth  field  is  possibly
       appended as in

           <count> <usr> <passwd> <netspecs>

       This forth field is a copy of the access specification. Is
       is the optional host or network part in the user@host:, or
       user@network:  tag  stored in the data base (see ppeekkss--kkeeyy--
       ffiillee(5) for derails on the syntax.)

       If the first argument _p_r_v___k_e_y is NULL, the  password  line
       is deleted.

RREETTUURRNN VVAALLUUEE
       If  there was no error, a character string is returned, an
       NULL otherwise (while the global variable _e_r_r_n_o is  set  -



PEKS CIPHER LAYER          Jul 06, 2000                         1





PEKS-PASSWD(3)  PEKS 0.8.13 Programming Interface  PEKS-PASSWD(3)


       see eerrrrnnoo(3) for details).

       In  case  that  a  password  line  is appended/replaced or
       deleted, this return value is the empty string "".

       Otherwise the password line is returned as a  string  with
       the  three  text  fields  as indicated above, separated by
       exactly one space.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       HHOOMMEE   Used for the key file name expansion when there  is
              a leading tilde-slash as in "~/<pwd_file>".

SSEEEE AALLSSOO
       ppeekkss--kkeeyyss(3). ppeekkss--kkeeyyffiillee(5), ttaaggssrreessoollvvee(3), eerrrrnnoo(3).

AAUUTTHHOORR
       The ppeekkss package where these functions belong to was writ-
       ten by Jordan Hrycaj <jordan@teddy-net.com>, originally to
       support the nneessssuuss security scanner.





































PEKS CIPHER LAYER          Jul 06, 2000                         2


