2 * This file is part of libsmack.
4 * Copyright (C) 2011 Intel Corporation
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * version 2.1 as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * Jarkko Sakkinen <jarkko.sakkinen@intel.com>
22 * Brian McGillion <brian.mcgillion@intel.com>
30 static int apply_all(void)
32 if (is_smackfs_mounted() != 1) {
33 fprintf(stderr, "ERROR: SmackFS is not mounted.\n");
40 if (apply_rules(ACCESSES_D_PATH, 0))
41 perror("apply_rules");
43 if (apply_cipso(CIPSO_D_PATH))
44 perror("apply_cipso");
49 static int status(void)
51 int ret = is_smackfs_mounted();
55 printf("SmackFS is mounted.\n");
58 printf("SmackFS is not mounted.\n");
65 int main(int argc, char **argv)
68 fprintf(stderr, "Usage: %s <action>\n", argv[0]);
72 if (!strcmp(argv[1], "apply")) {
75 } else if (!strcmp(argv[1], "clear")) {
78 } else if (!strcmp(argv[1], "status")) {
82 fprintf(stderr, "Uknown action: %s\n", argv[1]);