Main Page   Compound List   File List   Compound Members   File Members  

user.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2000,2001 Red Hat, Inc.
00003  *
00004  * This is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Library General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 #ifndef libuser_user_h
00020 #define libuser_user_h
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00028 #include <sys/types.h>
00029 #include <glib.h>
00030 #include "config.h"
00031 #include "entity.h"
00032 #include "error.h"
00033 #include "prompt.h"
00034 
00038 typedef struct lu_context lu_context_t;
00039 
00044 typedef enum lu_type {lu_user = 0x2345, lu_group = 0x2346} lu_type_t;
00045 
00046 struct lu_context *lu_start(const char *authname, enum lu_type auth_type, const char *info_modules, const char *auth_modules,
00047                             lu_prompt_fn *prompter, gpointer callback_data, struct lu_error **error);
00048 void lu_end(struct lu_context *context);
00049 
00050 void lu_set_prompter(struct lu_context *context, lu_prompt_fn *prompter, gpointer callback_data);
00051 void lu_get_prompter(struct lu_context *context, lu_prompt_fn **prompter, gpointer *callback_data);
00052 
00053 gboolean lu_set_info_modules(struct lu_context *context, const char *list, struct lu_error **error);
00054 const char *lu_get_info_modules(struct lu_context *context);
00055 
00056 gboolean lu_set_auth_modules(struct lu_context *context, const char *list, struct lu_error **error);
00057 const char *lu_get_auth_modules(struct lu_context *context);
00058 
00059 void lu_user_default(struct lu_context *ctx, const char *name, gboolean system, struct lu_ent *ent);
00060 void lu_group_default(struct lu_context *ctx, const char *name, gboolean system, struct lu_ent *ent);
00061 
00062 gboolean lu_user_lookup_name(struct lu_context *context, const char *name, struct lu_ent *ent, struct lu_error **error);
00063 gboolean lu_group_lookup_name(struct lu_context *context, const char *name, struct lu_ent *ent, struct lu_error **error);
00064 gboolean lu_user_lookup_id(struct lu_context *context, uid_t uid, struct lu_ent *ent, struct lu_error **error);
00065 gboolean lu_group_lookup_id(struct lu_context *context, gid_t gid, struct lu_ent *ent, struct lu_error **error);
00066 gboolean lu_user_add(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00067 gboolean lu_group_add(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00068 gboolean lu_user_modify(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00069 gboolean lu_group_modify(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00070 gboolean lu_user_delete(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00071 gboolean lu_group_delete(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00072 
00073 gboolean lu_user_lock(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00074 gboolean lu_group_lock(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00075 gboolean lu_user_unlock(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00076 gboolean lu_group_unlock(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00077 
00078 gboolean lu_user_islocked(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00079 gboolean lu_group_islocked(struct lu_context *context, struct lu_ent *ent, struct lu_error **error);
00080 
00081 gboolean lu_user_setpass(struct lu_context *context, struct lu_ent *ent, const char *newpass, struct lu_error **error);
00082 gboolean lu_group_setpass(struct lu_context *context, struct lu_ent *ent, const char *newpass, struct lu_error **error);
00083 
00084 GList *lu_users_enumerate(struct lu_context *context, const char *pattern, const char *module, struct lu_error **error);
00085 GList *lu_groups_enumerate(struct lu_context *context, const char *pattern, const char *module, struct lu_error **error);
00086 GList *lu_users_enumerate_by_group(struct lu_context *context, const char *group, const char *module, struct lu_error **error);
00087 GList *lu_groups_enumerate_by_user(struct lu_context *context, const char *user, const char *module, struct lu_error **error);
00088 
00089 #ifdef __cplusplus
00090 };
00091 #endif
00092 
00093 #endif

Generated at Wed Aug 29 13:14:11 2001 for libuser by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001