apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/user/unix userinfo.c
Date Thu, 08 Mar 2001 00:35:39 GMT
rbb         01/03/07 16:35:38

  Modified:    .        CHANGES
               include  apr_user.h
               user/unix userinfo.c
  Log:
  Allow a way to get the password from the system password database.
  Non unix platforms will likely need a similar function.
  Submitted by:	John Barbee <jbarbee@covalent.net>
  
  Revision  Changes    Path
  1.72      +3 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -d -b -w -u -r1.71 -r1.72
  --- CHANGES	2001/03/07 22:09:12	1.71
  +++ CHANGES	2001/03/08 00:35:35	1.72
  @@ -1,5 +1,8 @@
   Changes with APR b1  
   
  +  *) Add a method to get the password from the system for a given
  +     user.  [John Barbee <jbarbee@covalent.net>]
  +
     *) Change the include path order, so that we look for included files
        in the APR paths first, and the system paths second.
        [jean-frederic clere <jfrederic.clere@fujitsu-siemens.com>]
  
  
  
  1.12      +10 -0     apr/include/apr_user.h
  
  Index: apr_user.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_user.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -d -b -w -u -r1.11 -r1.12
  --- apr_user.h	2001/02/21 23:38:47	1.11
  +++ apr_user.h	2001/03/08 00:35:36	1.12
  @@ -161,6 +161,16 @@
   #define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH)
   #endif
   
  +/**
  + * Get a password from the system, given a username.
  + * @param passwd The returned password
  + * @param username The username to get the password for
  + * @param p The pool to allocate out of.
  + * @deffunc apr_status_t apr_get_user_passwd(char **passwd, const char *username, apr_pool_t
*p);
  + */
  +APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd,
  +                                         const char *username, apr_pool_t *p);
  +
   #endif  /* ! APR_HAS_USER */
   
   #ifdef __cplusplus
  
  
  
  1.10      +14 -0     apr/user/unix/userinfo.c
  
  Index: userinfo.c
  ===================================================================
  RCS file: /home/cvs/apr/user/unix/userinfo.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -d -b -w -u -r1.9 -r1.10
  --- userinfo.c	2001/02/21 23:38:43	1.9
  +++ userinfo.c	2001/03/08 00:35:37	1.10
  @@ -129,4 +129,18 @@
       *username = apr_pstrdup(p, pw->pw_name);
       return APR_SUCCESS;
   }
  +
  +APR_DECLARE(apr_status_t) apr_get_user_passwd(char **passwd,
  +                                         const char *username, apr_pool_t *p)
  +{
  +    struct passwd *pw;
  +    apr_status_t rv;
  +        
  +    if ((rv = getpwnam_safe(username, &pw)) != APR_SUCCESS)
  +        return rv;
  +
  +    *passwd = apr_pstrdup(p, pw->pw_passwd);
  +
  +    return APR_SUCCESS;
  +}
     
  
  
  

Mime
View raw message