


PEKS-MISC(3)    PEKS 0.8.13 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));;

       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.

       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.

       TTaaggssrreessoollvvee(()) uses ggeetthhoossttbbyynnaammee(3) to  resolve  all  host
       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--



PEKS CIPHER LAYER          Jul 06, 2000                         1





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


       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 eekkss__sseett__hhoommeevvaarr(()) func-
              tion to checked before the HHOOMMEE variable.  HHOOMMEE The
              path  to  the  user's  home directory.  uusseerrpprrooffiillee
              Ignored  on  non-Windows  machines,  this  variable
              takes  precedence  over  HOME,  which  has the same
              meaning in the given context.

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          Jul 06, 2000                         2


