Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

apr_user.h

Go to the documentation of this file.
00001 /* ====================================================================
00002  * The Apache Software License, Version 1.1
00003  *
00004  * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
00005  * reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in
00016  *    the documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  * 3. The end-user documentation included with the redistribution,
00020  *    if any, must include the following acknowledgment:
00021  *       "This product includes software developed by the
00022  *        Apache Software Foundation (http://www.apache.org/)."
00023  *    Alternately, this acknowledgment may appear in the software itself,
00024  *    if and wherever such third-party acknowledgments normally appear.
00025  *
00026  * 4. The names "Apache" and "Apache Software Foundation" must
00027  *    not be used to endorse or promote products derived from this
00028  *    software without prior written permission. For written
00029  *    permission, please contact apache@apache.org.
00030  *
00031  * 5. Products derived from this software may not be called "Apache",
00032  *    nor may "Apache" appear in their name, without prior written
00033  *    permission of the Apache Software Foundation.
00034  *
00035  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00036  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00037  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00038  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00039  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00040  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00041  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00042  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00043  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00045  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00046  * SUCH DAMAGE.
00047  * ====================================================================
00048  *
00049  * This software consists of voluntary contributions made by many
00050  * individuals on behalf of the Apache Software Foundation.  For more
00051  * information on the Apache Software Foundation, please see
00052  * <http://www.apache.org/>.
00053  */
00054 
00055 #ifndef APR_USER_H
00056 #define APR_USER_H
00057 
00063 #include "apr.h"
00064 #include "apr_errno.h"
00065 #include "apr_pools.h"
00066 
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif /* __cplusplus */
00070 
00080 #ifdef WIN32
00081 typedef PSID                      apr_uid_t;
00082 #else
00083 typedef uid_t                     apr_uid_t;
00084 #endif
00085 
00089 #ifdef WIN32
00090 typedef PSID                      apr_gid_t;
00091 #else
00092 typedef gid_t                     apr_gid_t;
00093 #endif
00094 
00095 #if APR_HAS_USER 
00096 
00104 APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid,
00105                                           apr_gid_t *groupid,
00106                                           apr_pool_t *p);
00107 
00109 APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *userid,
00110                                              apr_gid_t *groupid,
00111                                              apr_pool_t *p);
00119 APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid,
00120                                            apr_pool_t *p);
00121 
00123 APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid,
00124                                            apr_pool_t *p);
00133 APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid,
00134                                       const char *username, apr_pool_t *p);
00135 
00137 APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *userid, apr_gid_t *groupid,
00138                                          const char *username, apr_pool_t *p);
00139 
00147 APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, 
00148                                                const char *username, 
00149                                                apr_pool_t *p);
00150 
00152 APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, 
00153                                                  const char *username, 
00154                                                  apr_pool_t *p);
00155 
00164 #if defined(WIN32)
00165 APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right);
00166 
00168 APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right);
00169 #else
00170 #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00172 #define apr_compare_users(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00173 #endif
00174 
00182 APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, 
00183                                              apr_gid_t groupid, apr_pool_t *p);
00184 
00186 APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, 
00187                                              apr_gid_t groupid, apr_pool_t *p);
00188 
00190 APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, 
00191                                             apr_gid_t groupid, apr_pool_t *p);
00192 
00200 APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, 
00201                                       const char *groupname, apr_pool_t *p);
00202 
00204 APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *groupid, 
00205                                           const char *groupname, apr_pool_t *p);
00206 
00215 #if defined(WIN32)
00216 APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right);
00218 APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right);
00219 #else
00220 #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00222 #define apr_compare_groups(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH)
00223 #endif
00224 
00225 #endif  /* ! APR_HAS_USER */
00226 
00229 #ifdef __cplusplus
00230 }
00231 #endif
00232 
00233 #endif  /* ! APR_USER_H */

Generated on Tue Aug 23 04:59:10 2005 for Apache Portable Runtime by  doxygen 1.3.9.1