apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/user/win32 groupinfo.c userinfo.c
Date Tue, 04 Jun 2002 04:57:22 GMT
wrowe       2002/06/03 21:57:22

  Modified:    user/win32 groupinfo.c userinfo.c
  Log:
    More CE porting.  I'd prefer to see us return a stock value of 0 for the
    user and group ID functions rather than returning ENOTIMPL.  There are no
    groups or users on WinCE.  Comments?
  
  Submitted by:	Mladen Turk <mturk@mappingsoft.com>
  
  Revision  Changes    Path
  1.9       +10 -0     apr/user/win32/groupinfo.c
  
  Index: groupinfo.c
  ===================================================================
  RCS file: /home/cvs/apr/user/win32/groupinfo.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- groupinfo.c	22 Apr 2002 10:24:41 -0000	1.8
  +++ groupinfo.c	4 Jun 2002 04:57:22 -0000	1.9
  @@ -63,6 +63,9 @@
   APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid, 
                                            const char *groupname, apr_pool_t *p)
   {
  +#ifdef _WIN32_WCE
  +    return APR_ENOTIMPL;
  +#else
       SID_NAME_USE sidtype;
       char anydomain[256];
       char *domain;
  @@ -98,10 +101,14 @@
           return apr_get_os_error();
       }
       return APR_SUCCESS;
  +#endif
   }
   
   APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t
*p)
   {
  +#ifdef _WIN32_WCE
  +    *groupname = apr_pstrdup(p, "Administrators");
  +#else
       SID_NAME_USE type;
       char name[MAX_PATH], domain[MAX_PATH];
       DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
  @@ -113,6 +120,7 @@
                                && type != SidTypeAlias)
           return APR_EINVAL;
       *groupname = apr_pstrdup(p, name);
  +#endif
       return APR_SUCCESS;
   }
     
  @@ -120,9 +128,11 @@
   {
       if (!left || !right)
           return APR_EINVAL;
  +#ifndef _WIN32_WCE
       if (!IsValidSid(left) || !IsValidSid(right))
           return APR_EINVAL;
       if (!EqualSid(left, right))
           return APR_EMISMATCH;
  +#endif
       return APR_SUCCESS;
   }
  
  
  
  1.19      +22 -1     apr/user/win32/userinfo.c
  
  Index: userinfo.c
  ===================================================================
  RCS file: /home/cvs/apr/user/win32/userinfo.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- userinfo.c	13 Mar 2002 20:39:32 -0000	1.18
  +++ userinfo.c	4 Jun 2002 04:57:22 -0000	1.19
  @@ -61,6 +61,7 @@
   #include <sys/types.h>
   #endif
   
  +#ifndef _WIN32_WCE
   /* Internal sid binary to string translation, see MSKB Q131320.
    * Several user related operations require our SID to access
    * the registry, but in a string format.  All error handling
  @@ -97,12 +98,16 @@
                                *GetSidSubAuthority(id, sa));
       }
   } 
  -
  +#endif
   /* Query the ProfileImagePath from the version-specific branch, where the
    * regkey uses the user's name on 9x, and user's sid string on NT.
    */
   APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username,
apr_pool_t *p)
   {
  +#ifdef _WIN32_WCE
  +    *dirname = apr_pstrdup(p, "/My Documents");
  +    return APR_SUCCESS;
  +#else
       apr_status_t rv;
       char regkey[MAX_PATH * 2];
       char *fixch;
  @@ -189,12 +194,16 @@
           if (*fixch == '\\')
               *fixch = '/';
       return APR_SUCCESS;
  +#endif /* _WIN32_WCE */
   }
   
   APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid,
                                                apr_gid_t *gid,
                                                apr_pool_t *p)
   {
  +#ifdef _WIN32_WCE
  +    return APR_ENOTIMPL;
  +#else
       HANDLE threadtok;
       DWORD needed;
       TOKEN_USER *usr;
  @@ -222,11 +231,15 @@
           return apr_get_os_error();
   
       return APR_SUCCESS;
  +#endif 
   }
   
   APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
                                            const char *username, apr_pool_t *p)
   {
  +#ifdef _WIN32_WCE
  +    return APR_ENOTIMPL;
  +#else
       SID_NAME_USE sidtype;
       char anydomain[256];
       char *domain;
  @@ -265,10 +278,15 @@
        */
       *gid = NULL;
       return APR_SUCCESS;
  +#endif
   }
   
   APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t
*p)
   {
  +#ifdef _WIN32_WCE
  +    *username = apr_pstrdup(p, "Administrator");
  +    return APR_SUCCESS;
  +#else
       SID_NAME_USE type;
       char name[MAX_PATH], domain[MAX_PATH];
       DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
  @@ -280,15 +298,18 @@
           return APR_EINVAL;
       *username = apr_pstrdup(p, name);
       return APR_SUCCESS;
  +#endif
   }
     
   APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right)
   {
       if (!left || !right)
           return APR_EINVAL;
  +#ifndef _WIN32_WCE
       if (!IsValidSid(left) || !IsValidSid(right))
           return APR_EINVAL;
       if (!EqualSid(left, right))
           return APR_EMISMATCH;
  +#endif
       return APR_SUCCESS;
   }
  
  
  

Mime
View raw message