um.h

Go to the documentation of this file.
00001 /************************************ */
00002 /* Rule Set Based Access Control      */
00003 /* Author and (c) 1999-2004:          */
00004 /*   Amon Ott <ao@rsbac.org>          */
00005 /* API: Data structures               */
00006 /* and functions for User Management  */
00007 /* Last modified: 07/Dec/2004         */
00008 /************************************ */
00009 
00010 #ifndef __RSBAC_UM_H
00011 #define __RSBAC_UM_H
00012 
00013 #include <linux/init.h>
00014 #include <rsbac/types.h>
00015 #include <rsbac/um_types.h>
00016 
00017 /***************************************************/
00018 /*               General Prototypes                */
00019 /***************************************************/
00020 
00021 /* All functions return 0, if no error occurred, and a negative error code  */
00022 /* otherwise. The error codes are defined in rsbac_error.h.                 */
00023 
00024 /****************************************************************************/
00025 /* Initialization, including ACI restoration for all mounted devices from   */
00026 /* disk. After this call, all ACI is kept in memory for performance reasons,*/
00027 /* but user and file/dir object ACI are written to disk on every change.    */
00028 
00029 #ifdef CONFIG_RSBAC_INIT_DELAY
00030 extern int rsbac_init_um(void);
00031 #else
00032 extern int rsbac_init_um(void) __init;
00033 #endif
00034 
00035 /* Some information about the current status is also available */
00036 extern int rsbac_stats_um(void);
00037 
00038 /************************************************* */
00039 /*               Access functions                  */
00040 /************************************************* */
00041 
00042 /* Trying to access a never created or removed user entry returns an error! */
00043 
00044 /* rsbac_um_add_user */
00045 
00046 int rsbac_um_add_user(
00047   rsbac_list_ta_number_t ta_number,
00048   rsbac_uid_t user,
00049   struct rsbac_um_user_entry_t * entry_p,
00050   char * pass,
00051   rsbac_time_t ttl);
00052 
00053 int rsbac_um_add_group(
00054   rsbac_list_ta_number_t ta_number,
00055   rsbac_gid_t group,
00056   struct rsbac_um_group_entry_t * entry_p,
00057   char * pass,
00058   rsbac_time_t ttl);
00059 
00060 int rsbac_um_add_gm(
00061   rsbac_list_ta_number_t ta_number,
00062   rsbac_uid_t user,
00063   rsbac_gid_t group,
00064   rsbac_time_t ttl);
00065 
00066 int rsbac_um_mod_user(
00067   rsbac_list_ta_number_t ta_number,
00068   rsbac_uid_t user,
00069   enum rsbac_um_mod_t mod,
00070   union rsbac_um_mod_data_t * data_p);
00071 
00072 int rsbac_um_mod_group(
00073   rsbac_list_ta_number_t ta_number,
00074   rsbac_uid_t group,
00075   enum rsbac_um_mod_t mod,
00076   union rsbac_um_mod_data_t * data_p);
00077 
00078 int rsbac_um_get_user_item(
00079   rsbac_list_ta_number_t ta_number,
00080   rsbac_uid_t user,
00081   enum rsbac_um_mod_t mod,
00082   union rsbac_um_mod_data_t * data_p);
00083 
00084 int rsbac_um_get_group_item(
00085   rsbac_list_ta_number_t ta_number,
00086   rsbac_gid_t group,
00087   enum rsbac_um_mod_t mod,
00088   union rsbac_um_mod_data_t * data_p);
00089 
00090 int rsbac_um_user_exists(
00091   rsbac_list_ta_number_t ta_number,
00092   rsbac_uid_t user);
00093 
00094 int rsbac_um_group_exists(
00095   rsbac_list_ta_number_t ta_number,
00096   rsbac_gid_t group);
00097 
00098 int rsbac_um_remove_user(
00099   rsbac_list_ta_number_t ta_number,
00100   rsbac_uid_t user);
00101 
00102 int rsbac_um_remove_group(
00103   rsbac_list_ta_number_t ta_number,
00104   rsbac_gid_t group);
00105 
00106 int rsbac_um_remove_gm(
00107   rsbac_list_ta_number_t ta_number,
00108   rsbac_uid_t user,
00109   rsbac_gid_t group);
00110 
00111 int rsbac_um_get_next_user(
00112   rsbac_list_ta_number_t ta_number,
00113   rsbac_uid_t old_user,
00114   rsbac_uid_t * next_user_p);
00115 
00116 int rsbac_um_get_user_list(
00117   rsbac_list_ta_number_t ta_number,
00118   rsbac_uid_t ** list_pp);
00119 
00120 int rsbac_um_get_gm_list(
00121   rsbac_list_ta_number_t ta_number,
00122   rsbac_uid_t user,
00123   rsbac_gid_t ** list_pp);
00124 
00125 int rsbac_um_get_gm_user_list(
00126   rsbac_list_ta_number_t ta_number,
00127   rsbac_gid_t group,
00128   rsbac_uid_t ** list_pp);
00129 
00130 int rsbac_um_get_group_list(
00131   rsbac_list_ta_number_t ta_number,
00132   rsbac_gid_t ** list_pp);
00133 
00134 int rsbac_um_get_user_entry(
00135   rsbac_list_ta_number_t ta_number,
00136   rsbac_uid_t user,
00137   struct rsbac_um_user_entry_t * entry_p,
00138   rsbac_time_t * ttl_p);
00139 
00140 int rsbac_um_get_uid(
00141   rsbac_list_ta_number_t ta_number,
00142   char * name,
00143   rsbac_uid_t * uid_p);
00144 
00145 int rsbac_um_get_gid(
00146   rsbac_list_ta_number_t ta_number,
00147   char * name,
00148   rsbac_gid_t * gid_p);
00149 
00150 int rsbac_um_check_pass(rsbac_uid_t uid,
00151                         char * pass);
00152 
00153 int rsbac_um_set_pass(rsbac_uid_t uid,
00154                       char * pass);
00155 
00156 int rsbac_um_set_group_pass(rsbac_gid_t gid,
00157                             char * pass);
00158 
00159 int rsbac_um_check_account(rsbac_uid_t user);
00160 
00161 #endif

Generated on Fri Jun 17 09:45:18 2005 for RSBAC by  doxygen 1.4.2