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

dbus-userdb.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-userdb.h User database abstraction
00003  * 
00004  * Copyright (C) 2003  Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.1
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 #ifndef DBUS_USERDB_H
00025 #define DBUS_USERDB_H
00026 
00027 #include <dbus/dbus-sysdeps.h>
00028 
00029 DBUS_BEGIN_DECLS
00030 
00031 typedef struct DBusUserDatabase DBusUserDatabase;
00032 
00033 DBusUserDatabase* _dbus_user_database_new           (void);
00034 DBusUserDatabase* _dbus_user_database_ref           (DBusUserDatabase     *db);
00035 void              _dbus_user_database_unref         (DBusUserDatabase     *db);
00036 dbus_bool_t       _dbus_user_database_get_groups    (DBusUserDatabase     *db,
00037                                                      dbus_uid_t            uid,
00038                                                      dbus_gid_t          **group_ids,
00039                                                      int                  *n_group_ids,
00040                                                      DBusError            *error);
00041 dbus_bool_t       _dbus_user_database_get_uid       (DBusUserDatabase     *db,
00042                                                      dbus_uid_t            uid,
00043                                                      const DBusUserInfo  **info,
00044                                                      DBusError            *error);
00045 dbus_bool_t       _dbus_user_database_get_gid       (DBusUserDatabase     *db,
00046                                                      dbus_gid_t            gid,
00047                                                      const DBusGroupInfo **info,
00048                                                      DBusError            *error);
00049 dbus_bool_t       _dbus_user_database_get_username  (DBusUserDatabase     *db,
00050                                                      const DBusString     *username,
00051                                                      const DBusUserInfo  **info,
00052                                                      DBusError            *error);
00053 dbus_bool_t       _dbus_user_database_get_groupname (DBusUserDatabase     *db,
00054                                                      const DBusString     *groupname,
00055                                                      const DBusGroupInfo **info,
00056                                                      DBusError            *error);
00057 
00058 
00059 DBusUserDatabase* _dbus_user_database_get_system    (void);
00060 void              _dbus_user_database_lock_system   (void);
00061 void              _dbus_user_database_unlock_system (void);
00062 
00063 dbus_bool_t _dbus_username_from_current_process (const DBusString **username);
00064 dbus_bool_t _dbus_homedir_from_current_process  (const DBusString **homedir);
00065 dbus_bool_t _dbus_homedir_from_username         (const DBusString  *username,
00066                                                  DBusString        *homedir);
00067 dbus_bool_t _dbus_get_user_id                   (const DBusString  *username,
00068                                                  dbus_uid_t        *uid);
00069 dbus_bool_t _dbus_get_group_id                  (const DBusString  *group_name,
00070                                                  dbus_gid_t        *gid);
00071 dbus_bool_t _dbus_uid_from_string               (const DBusString  *uid_str,
00072                                                  dbus_uid_t        *uid);
00073 dbus_bool_t _dbus_credentials_from_username     (const DBusString  *username,
00074                                                  DBusCredentials   *credentials);
00075 dbus_bool_t _dbus_credentials_from_uid          (dbus_uid_t         user_id,
00076                                                  DBusCredentials   *credentials);
00077 dbus_bool_t _dbus_is_console_user               (dbus_uid_t         uid,
00078                                                  DBusError         *error);
00079 
00080 
00081 DBUS_END_DECLS
00082 
00083 #endif /* DBUS_USERDB_H */

Generated on Tue Dec 20 14:16:43 2005 for D-BUS by  doxygen 1.4.2