~snappy-dev/snapd/master

« back to all changes in this revision

Viewing changes to cmd/snap-confine/seccomp-support.h

  • Committer: GitHub
  • Author(s): Zygmunt Krynicki
  • Date: 2016-12-06 13:54:07 UTC
  • mfrom: (2661.2.15)
  • Revision ID: git-v1:0ac9c21d5bf0d4d7db987cbe985a49f755295d0b
Merge pull request #2268 from zyga/merged-snap-confine

many: merge snap-confine into snapd

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 */
 
17
#ifndef SNAP_CONFINE_SECCOMP_SUPPORT_H
 
18
#define SNAP_CONFINE_SECCOMP_SUPPORT_H
 
19
 
 
20
#include <seccomp.h>
 
21
 
 
22
/**
 
23
 * Prepare seccomp profile associated with the security tag.
 
24
 *
 
25
 * This function loads the seccomp profile from
 
26
 * /var/lib/snapd/seccomp/profiles/$SECURITY_TAG and stores it into
 
27
 * scmp_filter_ctx object.
 
28
 *
 
29
 * The object is returned to the caller and can be made effective with a call
 
30
 * to sc_load_seccomp_context(). The returned value should be cleaned up with
 
31
 * seccomp_release().
 
32
 *
 
33
 * This function calls die() on all errors.
 
34
 **/
 
35
 
 
36
scmp_filter_ctx sc_prepare_seccomp_context(const char *security_tag);
 
37
 
 
38
/**
 
39
 * Load a seccomp context.
 
40
 *
 
41
 * This function calls seccomp_load(3) and handles errors if it fails.
 
42
 **/
 
43
void sc_load_seccomp_context(scmp_filter_ctx ctx);
 
44
 
 
45
#endif