


PEKS-MISC(3)    PEKS 0.8.18 Programming Interface    PEKS-MISC(3)


NNAAMMEE
       peks_get_homedir peks_get_username - query user character-
       istics

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

       cchhaarr **ppeekkss__ggeett__hhoommeeddiirr ((ccoonnsstt cchhaarr **_f_i_l_e));;

       cchhaarr **ppeekkss__ggeett__ddiirrffiillee ((ccoonnsstt cchhaarr **_f_i_l_e));;

       vvooiidd ppeekkss__sseett__hhoommeevvaarr ((ccoonnsstt cchhaarr **_h_o_m_e));;

       vvooiidd ppeekkss__sseett__uusseerrvvaarr ((ccoonnsstt cchhaarr **_u_s_e_r));;

       cchhaarr **ppeekkss__ggeett__uusseerrnnaammee ((vvooiidd));;

       cchhaarr **ttaaggrreessoollvvee ((ccoonnsstt cchhaarr **_p_a_t_t_e_r_n,, ssiizzee__tt _l_e_n));;


DDEESSCCRRIIPPTTIIOONN
       PPeekkss__ggeett__hhoommeeddiirr(()) appends the string _f_i_l_e given as  argu-
       ment  to  the  vakue  of the HHOOMMEE environment variable. If
       there is no HHOOMMEE variable, the passwd table is  looked  up
       for an appropriate value of a home directory.

       Passing  a NULL argument to ppeekkss__ggeett__hhoommeeddiirr(()) is allowed.
       In that case only the home directory (without  a  trailing
       slash) is returned.

       PPeekkss__ggeett__ddiirrffiillee(())  returns a string with an absolute path
       according to the argument _f_i_l_e. If  this  argument  starts
       with  a tilde-slash looking like ~~//ffiilleennaammee, the tilde wil
       be substituted by the home directory using  ppeekkss__ggeett__hhoommee--
       ddiirr(()).   If  _f_i_l_e  does  not start with a slash it will be
       prepended by the current working directory.

       PPeekkss__sseett__hhoommeevvaarr(()) stores the name of a custom environment
       variable  to be checked before the HHOOMMEE variable.  Passing
       a NULL argument disables this feature.

       PPeekkss__sseett__uusseerrvvaarr(()) stores the name of a custom environment
       variable  to be checked as the user's login name.  Passing
       a NULL argument disables this feature.

       Passing a NULL argument ppeekkss__ggeett__ddiirrffiillee(()) is allowed.  In
       that  case  only the current directory (without a trailing
       slash) is returned.

       PPeekkss__ggeett__uusseerrnnaammee(()) returns the user's  current  name.  If
       present,  this is the contents of the environment variable
       passed to the fuction ppeekkss__sseett__uusseerrvvaarr(()).

       TTaaggssrreessoollvvee(()) uses ggeetthhoossttbbyynnaammee(3) to  resolve  all  host



PEKS CIPHER LAYER          Jan 21, 2001                         1





PEKS-MISC(3)    PEKS 0.8.18 Programming Interface    PEKS-MISC(3)


       and  network  names  that  occur  in  a complex key tag as
       defined in ppeekkss--kkeeyyffiillee(5). Formally, the input syntax can
       be a <<nneettssppeeccss>> or a <<uussrrssppeeccss>>.  But most commonly, it is
       a simple <<uussrrssppeeccss>>, a user name with an ip-address  or  a
       network appended like <user>@<network>/<mask>.

       In  order to pre-evaluate such an expression before passed
       to a  function  like  ppeekkss__eeddiitt__ppaasssswwdd__ffiillee(())  (see  ppeekkss--
       ppaasssswwdd(3) for details,) this function is used.

       It  evaluates  the  input  argument _p_a_t_t_e_r_n and returnes a
       string with all host and network names resolved.

RREETTUURRNN VVAALLUUEE
       All functions return dynamically allocated space that must
       be  returned  using  xxffrreeee(()),  when  done.   In case of an
       error, NULL is returned while the global variable _e_r_r_n_o is
       set to some error code (see ppeekkss--eerrrrnnuumm(3).)

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       _h_o_m_e   The  argument given to the ppeekkss__sseett__hhoommeevvaarr(()) func-
              tion to checked before the HHOOMMEE variable.  If  pre-
              sent  on  Windows  machines,  this  variable  takes
              precedence over uusseerrpprrooffiillee.

       uusseerrpprrooffiillee
              Ignored  on  non-Windows  machines,  this  variable
              takes  precedence  over  HHOOMMEE,  which  has the same
              meaning in the given context.

       HHOOMMEE   The path to the user's home directory.

       _u_s_e_r   The argument given to the ppeekkss__sseett__uusseerrvvaarr(())  func-
              tion to set a user login name variable.

SSEEEE AALLSSOO
       xxffrreeee(3), eerrrrnnoo(3), ppeekkss--eerrrrnnuumm(3), ppeekkss--kkeeyyffiillee(5), ppeekkss--
       ppaasssswwdd(3), ppeekkss--kkeeyy(3),  ggeetthhoossttbbyynnaammee (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          Jan 21, 2001                         2


