dbus-credentials.h

00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
00002 /* dbus-credentials.h Credentials provable through authentication
00003  *
00004  * Copyright (C) 2007 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 #ifndef DBUS_CREDENTIALS_H
00024 #define DBUS_CREDENTIALS_H
00025 
00026 #include <dbus/dbus-macros.h>
00027 #include <dbus/dbus-errors.h>
00028 #include <dbus/dbus-string.h>
00029 #include <dbus/dbus-sysdeps.h>
00030 
00031 DBUS_BEGIN_DECLS
00032 
00033 typedef enum {
00034   DBUS_CREDENTIAL_UNIX_PROCESS_ID,
00035   DBUS_CREDENTIAL_UNIX_USER_ID,
00036   DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID,
00037   DBUS_CREDENTIAL_WINDOWS_SID
00038 } DBusCredentialType;
00039 
00040 DBusCredentials* _dbus_credentials_new_from_current_process (void);
00041 DBusCredentials* _dbus_credentials_new                      (void);
00042 void             _dbus_credentials_ref                      (DBusCredentials    *credentials);
00043 void             _dbus_credentials_unref                    (DBusCredentials    *credentials);
00044 dbus_bool_t      _dbus_credentials_add_unix_pid             (DBusCredentials    *credentials,
00045                                                              dbus_pid_t          pid);
00046 dbus_bool_t      _dbus_credentials_add_unix_uid             (DBusCredentials    *credentials,
00047                                                              dbus_uid_t          uid);
00048 dbus_bool_t      _dbus_credentials_add_windows_sid          (DBusCredentials    *credentials,
00049                                                              const char         *windows_sid);
00050 dbus_bool_t      _dbus_credentials_add_adt_audit_data       (DBusCredentials    *credentials,
00051                                                              void               *audit_data,
00052                                                              dbus_int32_t        size);
00053 dbus_bool_t      _dbus_credentials_include                  (DBusCredentials    *credentials,
00054                                                              DBusCredentialType  type);
00055 dbus_pid_t       _dbus_credentials_get_unix_pid             (DBusCredentials    *credentials);
00056 dbus_uid_t       _dbus_credentials_get_unix_uid             (DBusCredentials    *credentials);
00057 const char*      _dbus_credentials_get_windows_sid          (DBusCredentials    *credentials);
00058 void *           _dbus_credentials_get_adt_audit_data       (DBusCredentials    *credentials);
00059 dbus_int32_t     _dbus_credentials_get_adt_audit_data_size  (DBusCredentials    *credentials);
00060 dbus_bool_t      _dbus_credentials_are_superset             (DBusCredentials    *credentials,
00061                                                              DBusCredentials    *possible_subset);
00062 dbus_bool_t      _dbus_credentials_are_empty                (DBusCredentials    *credentials);
00063 dbus_bool_t      _dbus_credentials_are_anonymous            (DBusCredentials    *credentials);
00064 dbus_bool_t      _dbus_credentials_add_credentials          (DBusCredentials    *credentials,
00065                                                              DBusCredentials    *other_credentials);
00066 /* must silently allow 'which' to not exist */
00067 dbus_bool_t      _dbus_credentials_add_credential           (DBusCredentials    *credentials,
00068                                                              DBusCredentialType  which,
00069                                                              DBusCredentials    *other_credentials);
00070 void             _dbus_credentials_clear                    (DBusCredentials    *credentials);
00071 DBusCredentials* _dbus_credentials_copy                     (DBusCredentials    *credentials);
00072 dbus_bool_t      _dbus_credentials_same_user                (DBusCredentials    *credentials,
00073                                                              DBusCredentials    *other_credentials);
00074 
00075 
00076 DBUS_END_DECLS
00077 
00078 #endif /* DBUS_CREDENTIALS_H */

Generated on Tue Feb 24 16:40:39 2009 for D-Bus by  doxygen 1.5.1