]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/dbus-snapshot.c
man: improve wording of systemctl's --after/--before
[thirdparty/systemd.git] / src / core / dbus-snapshot.c
CommitLineData
d6c9574f 1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
4139c1b2
LP
2
3/***
4 This file is part of systemd.
5
6 Copyright 2010 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
4139c1b2
LP
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 16 Lesser General Public License for more details.
4139c1b2 17
5430f7f2 18 You should have received a copy of the GNU Lesser General Public License
4139c1b2
LP
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
718db961
LP
22#include "selinux-access.h"
23#include "unit.h"
24#include "snapshot.h"
4139c1b2
LP
25#include "dbus-unit.h"
26#include "dbus-snapshot.h"
d200735e 27
ebcf1f97 28int bus_snapshot_method_remove(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
718db961 29 Snapshot *s = userdata;
ebcf1f97 30 int r;
4139c1b2 31
718db961
LP
32 assert(bus);
33 assert(message);
34 assert(s);
4139c1b2 35
ebcf1f97
LP
36 r = selinux_unit_access_check(UNIT(s), bus, message, "stop", error);
37 if (r < 0)
38 return r;
cad45ba1 39
718db961 40 snapshot_remove(s);
5dd9014f 41
df2d202e 42 return sd_bus_reply_method_return(message, NULL);
4139c1b2 43}
718db961
LP
44
45const sd_bus_vtable bus_snapshot_vtable[] = {
46 SD_BUS_VTABLE_START(0),
47 SD_BUS_METHOD("Remove", NULL, NULL, bus_snapshot_method_remove, 0),
556089dc 48 SD_BUS_PROPERTY("Cleanup", "b", bus_property_get_bool, offsetof(Snapshot, cleanup), SD_BUS_VTABLE_PROPERTY_CONST),
718db961
LP
49 SD_BUS_VTABLE_END
50};