ofdbus/dbus/bus/selinux.h
changeset 0 e4d67989cc36
child 18 47c74d1534e1
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /* selinux.h  SELinux security check headers for D-BUS
       
     2  * Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
       
     3  * Author: Matthew Rickard <mjricka@epoch.ncsc.mil>
       
     4  *
       
     5  * Licensed under the Academic Free License version 2.1
       
     6  * 
       
     7  * This program is free software; you can redistribute it and/or modify
       
     8  * it under the terms of the GNU General Public License as published by
       
     9  * the Free Software Foundation; either version 2 of the License, or
       
    10  * (at your option) any later version.
       
    11  *
       
    12  * This program is distributed in the hope that it will be useful,
       
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    15  * GNU General Public License for more details.
       
    16  * 
       
    17  * You should have received a copy of the GNU General Public License
       
    18  * along with this program; if not, write to the Free Software
       
    19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
       
    20  *
       
    21  */
       
    22 
       
    23 
       
    24 
       
    25 #ifndef BUS_SELINUX_H
       
    26 #define BUS_SELINUX_H
       
    27 
       
    28 #ifndef __SYMBIAN32__
       
    29 #include <dbus/dbus-hash.h>
       
    30 #else
       
    31 #include "dbus-hash.h"
       
    32 #endif //__SYMBIAN32__
       
    33 #include <dbus/dbus-connection.h>
       
    34 #include "services.h"
       
    35 
       
    36 dbus_bool_t bus_selinux_pre_init (void);
       
    37 dbus_bool_t bus_selinux_full_init(void);
       
    38 void        bus_selinux_shutdown (void);
       
    39 
       
    40 dbus_bool_t bus_selinux_enabled  (void);
       
    41 
       
    42 void bus_selinux_id_ref    (BusSELinuxID *sid);
       
    43 void bus_selinux_id_unref  (BusSELinuxID *sid);
       
    44 
       
    45 DBusHashTable* bus_selinux_id_table_new    (void);
       
    46 BusSELinuxID*  bus_selinux_id_table_lookup (DBusHashTable    *service_table,
       
    47                                             const DBusString *service_name);
       
    48 dbus_bool_t    bus_selinux_id_table_insert (DBusHashTable    *service_table,
       
    49                                             const char       *service_name,
       
    50                                             const char       *service_context);
       
    51 void           bus_selinux_id_table_print  (DBusHashTable    *service_table);
       
    52 const char*    bus_selinux_get_policy_root (void);
       
    53 
       
    54 dbus_bool_t    bus_selinux_append_context      (DBusMessage    *message,
       
    55 						BusSELinuxID   *context,
       
    56 						DBusError      *error);
       
    57 
       
    58 dbus_bool_t bus_selinux_allows_acquire_service (DBusConnection *connection,
       
    59                                                 BusSELinuxID   *service_sid,
       
    60 						const char     *service_name,
       
    61 						DBusError      *error);
       
    62 
       
    63 dbus_bool_t bus_selinux_allows_send            (DBusConnection *sender,
       
    64                                                 DBusConnection *proposed_recipient,
       
    65 						const char     *msgtype, /* Supplementary audit data */
       
    66 						const char     *interface,
       
    67 						const char     *member,
       
    68 						const char     *error_name,
       
    69 						const char     *destination,
       
    70 						DBusError      *error);
       
    71 
       
    72 BusSELinuxID* bus_selinux_init_connection_id (DBusConnection *connection,
       
    73                                               DBusError      *error);
       
    74 
       
    75 
       
    76 
       
    77 #endif /* BUS_SELINUX_H */