2004-07-30 05:59:34 +00:00
|
|
|
/* selinux.h SELinux security check headers for D-BUS
|
|
|
|
|
*
|
|
|
|
|
* Author: Matthew Rickard <mjricka@epoch.ncsc.mil>
|
|
|
|
|
*
|
2004-08-10 03:07:01 +00:00
|
|
|
* Licensed under the Academic Free License version 2.1
|
2004-07-30 05:59:34 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BUS_SELINUX_H
|
|
|
|
|
#define BUS_SELINUX_H
|
|
|
|
|
|
|
|
|
|
#include <dbus/dbus-hash.h>
|
|
|
|
|
#include <dbus/dbus-connection.h>
|
|
|
|
|
#include "services.h"
|
|
|
|
|
|
2004-11-02 20:27:48 +00:00
|
|
|
dbus_bool_t bus_selinux_pre_init (void);
|
|
|
|
|
dbus_bool_t bus_selinux_full_init(void);
|
2004-07-30 05:59:34 +00:00
|
|
|
void bus_selinux_shutdown (void);
|
|
|
|
|
|
2004-10-18 04:04:12 +00:00
|
|
|
dbus_bool_t bus_selinux_enabled (void);
|
|
|
|
|
|
2004-07-30 05:59:34 +00:00
|
|
|
void bus_selinux_id_ref (BusSELinuxID *sid);
|
|
|
|
|
void bus_selinux_id_unref (BusSELinuxID *sid);
|
|
|
|
|
|
|
|
|
|
DBusHashTable* bus_selinux_id_table_new (void);
|
|
|
|
|
BusSELinuxID* bus_selinux_id_table_lookup (DBusHashTable *service_table,
|
|
|
|
|
const DBusString *service_name);
|
|
|
|
|
dbus_bool_t bus_selinux_id_table_insert (DBusHashTable *service_table,
|
|
|
|
|
const char *service_name,
|
|
|
|
|
const char *service_context);
|
|
|
|
|
void bus_selinux_id_table_print (DBusHashTable *service_table);
|
2004-08-23 16:09:54 +00:00
|
|
|
const char* bus_selinux_get_policy_root (void);
|
2004-07-30 05:59:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
dbus_bool_t bus_selinux_allows_acquire_service (DBusConnection *connection,
|
2004-11-09 Colin Walters <walters@verbum.org>
* dbus/dbus-string.c (_dbus_string_get_length): New
function, writes DBusString to C buffer.
* dbus/dbus-string.h: Prototype it.
* dbus/dbus-message.c (dbus_message_type_to_string): New
function, converts message type into C string.
* dbus/dbus-message.h: Prototype it.
* bus/selinux.c (bus_selinux_check): Take source pid,
target pid, and audit data. Pass audit data to
avc_has_perm.
(log_audit_callback): New function, appends extra
audit information.
(bus_selinux_allows_acquire_service): Also take
service name, add it to audit data.
(bus_selinux_allows_send): Also take message
type, interface, method member, error name,
and destination, and add them to audit data.
(log_cb): Initialize func_audit.
* bus/selinux.h (bus_selinux_allows_acquire_service)
(bus_selinux_allows_send): Update prototypes
* bus/services.c (bus_registry_acquire_service): Pass
service name to bus_selinux_allows_acquire_service.
* bus/bus.c (bus_context_check_security_policy): Pass
additional audit data. Move assignment of dest
to its own line.
2004-11-09 06:11:33 +00:00
|
|
|
BusSELinuxID *service_sid,
|
2005-04-13 14:27:11 +00:00
|
|
|
const char *service_name,
|
|
|
|
|
DBusError *error);
|
|
|
|
|
|
2004-07-30 05:59:34 +00:00
|
|
|
dbus_bool_t bus_selinux_allows_send (DBusConnection *sender,
|
2004-11-09 Colin Walters <walters@verbum.org>
* dbus/dbus-string.c (_dbus_string_get_length): New
function, writes DBusString to C buffer.
* dbus/dbus-string.h: Prototype it.
* dbus/dbus-message.c (dbus_message_type_to_string): New
function, converts message type into C string.
* dbus/dbus-message.h: Prototype it.
* bus/selinux.c (bus_selinux_check): Take source pid,
target pid, and audit data. Pass audit data to
avc_has_perm.
(log_audit_callback): New function, appends extra
audit information.
(bus_selinux_allows_acquire_service): Also take
service name, add it to audit data.
(bus_selinux_allows_send): Also take message
type, interface, method member, error name,
and destination, and add them to audit data.
(log_cb): Initialize func_audit.
* bus/selinux.h (bus_selinux_allows_acquire_service)
(bus_selinux_allows_send): Update prototypes
* bus/services.c (bus_registry_acquire_service): Pass
service name to bus_selinux_allows_acquire_service.
* bus/bus.c (bus_context_check_security_policy): Pass
additional audit data. Move assignment of dest
to its own line.
2004-11-09 06:11:33 +00:00
|
|
|
DBusConnection *proposed_recipient,
|
|
|
|
|
const char *msgtype, /* Supplementary audit data */
|
|
|
|
|
const char *interface,
|
|
|
|
|
const char *member,
|
|
|
|
|
const char *error_name,
|
2005-04-13 14:27:11 +00:00
|
|
|
const char *destination,
|
|
|
|
|
DBusError *error);
|
2004-07-30 05:59:34 +00:00
|
|
|
|
|
|
|
|
BusSELinuxID* bus_selinux_init_connection_id (DBusConnection *connection,
|
|
|
|
|
DBusError *error);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* BUS_SELINUX_H */
|