~ubuntu-branches/ubuntu/saucy/apparmor/saucy

« back to all changes in this revision

Viewing changes to .pc/0053-libapparmor-Export-a-label-based-query-interface.patch/libraries/libapparmor/src/apparmor.h

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks, Tyler Hicks, Jamie Strandboge
  • Date: 2013-08-26 15:32:12 UTC
  • mfrom: (49.1.6 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130826153212-5oehf9eda64lkpze
Tags: 2.8.0-0ubuntu25
[ Tyler Hicks ]
* Add support for mediation of D-Bus messages and services. AppArmor D-Bus
  rules are described in the apparmor.d(5) man page. dbus-daemon will use
  libapparmor to perform queries against the AppArmor policies to determine
  if a connection should be able to send messages to another connection, if
  a connection should be able to receive messages from another connection,
  and if a connection should be able to bind to a well-known name.
  - 0042-Fix-mount-rule-preprocessor-output.patch,
    0043-libapparmor-Safeguard-aa_getpeercon-buffer-reallocat.patch,
    0044-libapparmor-fix-return-value-of-aa_getpeercon_raw.patch,
    0045-libapparmor-Move-mode-parsing-into-separate-function.patch,
    0046-libapparmor-Parse-mode-from-confinement-string-in-ge.patch,
    0047-libapparmor-Make-aa_getpeercon_raw-similar-to-aa_get.patch,
    0048-libapparmor-Update-aa_getcon-man-page-to-reflect-get.patch:
    Backport parser and libapparmor pre-requisites for D-Bus mediation
  - 0049-parser-Update-man-page-for-DBus-rules.patch: Update apparmor.d man
    page
  - 0050-parser-Add-support-for-DBus-rules.patch,
    0051-parser-Regression-tests-for-DBus-rules.patch,
    0052-parser-Binary-profile-equality-tests-for-DBus-rules.patch: Add
    apparmor_parser support for D-Bus mediation rules
  - 0053-libapparmor-Export-a-label-based-query-interface.patch,
    debian/libapparmor1.symbols: Provide the libapparmor interface necessary
    for trusted helpers to make security decisions based upon AppArmor
    policy
  - 0054-libaalogparse-Parse-dbus-daemon-audit-messages.patch,
    0055-libaalogparse-Regression-tests-for-dbus-daemon-audit.patch: Allow
    applications to parse denials, generated by dbus-daemon, using
    libaalogparse and add a set of regression tests
  - 0056-tests-Add-an-optional-final-check-to-checktestfg.patch,
    0057-tests-Add-required-features-check.patch,
    0058-tests-Add-regression-tests-for-dbus.patch: Add regression tests
    which start their own dbus-daemon, load profiles containing D-Bus rules,
    and confine simple D-Bus service and client applications
  - 0059-dbus-rules-for-dbus-abstractions.patch: Add bus-specific, but
    otherwise permissive, D-Bus rules to the dbus and dbus-session
    abstractions. Confined applications that use D-Bus should already be
    including these abstractions in their profiles so this should be a
    seamless transition for those profiles.
* 0060-utils-make_clean_fixup.patch: Clean up the Python cache in the
  AppArmor tests directory
* 0061-profiles-dnsmasq-needs-dbus-abstraction.patch: Dnsmasq uses the
  system D-Bus when it is started with --enable-dbus, so its AppArmor
  profile needs to include the system bus abstraction
* 0062-fix-clone-test-on-arm.patch: Fix compiler error when building
  regression tests on ARM
* 0063-utils-ignore-unsupported-rules.patch: Utilities that use the
  Immunix::AppArmor perl module, such as aa-logprof and aa-genprof, error
  out when they encounter rules unsupported by the perl module. This patch
  ignores unsupported rules.

[ Jamie Strandboge ]
* debian/control: don't have easyprof Depends on apparmor-easyprof-ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2003-2008 Novell, Inc. (All rights reserved)
 
3
 * Copyright 2009-2010 Canonical Ltd.
 
4
 *
 
5
 * The libapparmor library is licensed under the terms of the GNU
 
6
 * Lesser General Public License, version 2.1. Please see the file
 
7
 * COPYING.LGPL.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public License
 
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 */
 
17
 
 
18
#ifndef _SYS_APPARMOR_H_
 
19
#define _SYS_APPARMOR_H 1
 
20
 
 
21
#include <sys/types.h>
 
22
 
 
23
__BEGIN_DECLS
 
24
 
 
25
/* Prototypes for apparmor state queries */
 
26
extern int aa_is_enabled(void);
 
27
extern int aa_find_mountpoint(char **mnt);
 
28
 
 
29
/* Prototypes for self directed domain transitions
 
30
 * see <http://apparmor.net>
 
31
 * Please see the change_hat(2) manpage for information.
 
32
 */
 
33
 
 
34
#define change_hat(X, Y) aa_change_hat((X), (Y))
 
35
extern int (change_hat)(const char *subprofile, unsigned int magic_token);
 
36
extern int aa_change_hat(const char *subprofile, unsigned long magic_token);
 
37
extern int aa_change_profile(const char *profile);
 
38
extern int aa_change_onexec(const char *profile);
 
39
 
 
40
extern int aa_change_hatv(const char *subprofiles[], unsigned long token);
 
41
extern int (aa_change_hat_vargs)(unsigned long token, int count, ...);
 
42
 
 
43
/* Protypes for introspecting task confinement
 
44
 * Please see the aa_getcon(2) manpage for information
 
45
 */
 
46
extern int aa_getprocattr_raw(pid_t tid, const char *attr, char *buf, int len,
 
47
                              char **mode);
 
48
extern int aa_getprocattr(pid_t tid, const char *attr, char **buf, char **mode);
 
49
extern int aa_gettaskcon(pid_t target, char **con, char **mode);
 
50
extern int aa_getcon(char **con, char **mode);
 
51
extern int aa_getpeercon_raw(int fd, char *buf, int *len, char **mode);
 
52
extern int aa_getpeercon(int fd, char **con, char **mode);
 
53
 
 
54
#define __macroarg_counter(Y...) __macroarg_count1 ( , ##Y)
 
55
#define __macroarg_count1(Y...) __macroarg_count2 (Y, 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
 
56
#define __macroarg_count2(_,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,n,Y...) n
 
57
 
 
58
/**
 
59
 * change_hat_vargs - a wrapper macro for change_hat_vargs
 
60
 * @T: the magic token
 
61
 * @X...: the parameter list of hats being passed
 
62
 *
 
63
 * The change_hat_vargs macro makes it so the caller doesn't have to
 
64
 * specify the number of hats passed as parameters to the change_hat_vargs
 
65
 * fn.
 
66
 *
 
67
 * eg.
 
68
 * change_hat_vargs(10, hat1, hat2, hat3, hat4);
 
69
 * expandes to
 
70
 * (change_hat_vargs)(10, 4, hat1, hat2, hat3, hat4);
 
71
 *
 
72
 * to call change_hat_vargs direction do
 
73
 * (change_hat_vargs)(token, nhats, hat1, hat2...)
 
74
 */
 
75
#define aa_change_hat_vargs(T, X...) \
 
76
        (aa_change_hat_vargs)(T, __macroarg_counter(X), X)
 
77
 
 
78
__END_DECLS
 
79
 
 
80
#endif  /* sys/apparmor.h */