apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suss...@apache.org
Subject cvs commit: apr/user/unix userinfo.c
Date Thu, 26 Jul 2001 21:49:32 GMT
sussman     01/07/26 14:49:32

  Modified:    include  apr_user.h
               user/unix userinfo.c
  Log:
  * apr_user.h (apr_current_userid):  new declaration.
  
  * userinfo.c (apr_current_userid):  implement Unix version.
                                      Somebody want to write a Win32 equivalent?
  
  Revision  Changes    Path
  1.14      +12 -0     apr/include/apr_user.h
  
  Index: apr_user.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_user.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- apr_user.h	2001/07/21 11:14:56	1.13
  +++ apr_user.h	2001/07/26 21:49:32	1.14
  @@ -90,6 +90,18 @@
   #if APR_HAS_USER
   
   /***
  + * Get the userid (and groupid) of the calling process
  + * @param userid   Returns the user id
  + * @param groupid  Returns the user's group id
  + * @param p The pool from which to allocate working space
  + * @tip This function is available only if APR_HAS_USER is defined.
  + * @deffunc apr_status_t apr_current_userid(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t
*p)
  + */
  +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid,
  +                                             apr_gid_t *groupid,
  +                                             apr_pool_t *p);
  +
  +/***
    * Get the user name for a specified userid
    * @param username Pointer to new string containing user name (on output)
    * @param userid The userid
  
  
  
  1.16      +15 -0     apr/user/unix/userinfo.c
  
  Index: userinfo.c
  ===================================================================
  RCS file: /home/cvs/apr/user/unix/userinfo.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- userinfo.c	2001/07/21 11:14:56	1.15
  +++ userinfo.c	2001/07/26 21:49:32	1.16
  @@ -111,6 +111,21 @@
       return APR_SUCCESS;
   }
   
  +
  +
  +APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid,
  +                                             apr_gid_t *gid,
  +                                             apr_pool_t *p)
  +{
  +    *uid = getuid();
  +    *gid = getgid();
  +  
  +    return APR_SUCCESS;
  +}
  +
  +
  +
  +
   APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
                                            const char *username, apr_pool_t *p)
   {
  
  
  

Mime
View raw message