LCOV - code coverage report
Current view: top level - core - dbus-snapshot.c (source / functions) Hit Total Coverage
Test: systemd test coverage Lines: 0 14 0.0 %
Date: 2015-07-29 18:47:03 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
       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
       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
      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
      16             :   Lesser General Public License for more details.
      17             : 
      18             :   You should have received a copy of the GNU Lesser General Public License
      19             :   along with systemd; If not, see <http://www.gnu.org/licenses/>.
      20             : ***/
      21             : 
      22             : #include "selinux-access.h"
      23             : #include "unit.h"
      24             : #include "dbus.h"
      25             : #include "snapshot.h"
      26             : #include "dbus-snapshot.h"
      27             : 
      28           0 : int bus_snapshot_method_remove(sd_bus_message *message, void *userdata, sd_bus_error *error) {
      29           0 :         Snapshot *s = userdata;
      30             :         int r;
      31             : 
      32           0 :         assert(message);
      33           0 :         assert(s);
      34             : 
      35           0 :         r = mac_selinux_unit_access_check(UNIT(s), message, "stop", error);
      36           0 :         if (r < 0)
      37           0 :                 return r;
      38             : 
      39           0 :         r = bus_verify_manage_units_async(UNIT(s)->manager, message, error);
      40           0 :         if (r < 0)
      41           0 :                 return r;
      42           0 :         if (r == 0)
      43           0 :                 return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
      44             : 
      45           0 :         snapshot_remove(s);
      46             : 
      47           0 :         return sd_bus_reply_method_return(message, NULL);
      48             : }
      49             : 
      50             : const sd_bus_vtable bus_snapshot_vtable[] = {
      51             :         SD_BUS_VTABLE_START(0),
      52             :         SD_BUS_PROPERTY("Cleanup", "b", bus_property_get_bool, offsetof(Snapshot, cleanup), SD_BUS_VTABLE_PROPERTY_CONST),
      53             :         SD_BUS_METHOD("Remove", NULL, NULL, bus_snapshot_method_remove, SD_BUS_VTABLE_UNPRIVILEGED),
      54             :         SD_BUS_VTABLE_END
      55             : };

Generated by: LCOV version 1.11