2012-01-20 18:02:55 +00:00
|
|
|
/*
|
|
|
|
* viraccessdrivernop.c: no-op access control driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012-2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "access/viraccessdrivernop.h"
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckConnect(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
|
|
|
virAccessPermConnect perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckDomain(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainDef *domain G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermDomain perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckInterface(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virInterfaceDef *iface G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermInterface perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckNetwork(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virNetworkDef *network G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermNetwork perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
2018-11-30 16:34:21 +00:00
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckNetworkPort(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virNetworkDef *network G_GNUC_UNUSED,
|
|
|
|
virNetworkPortDef *port G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermNetworkPort perm G_GNUC_UNUSED)
|
2018-11-30 16:34:21 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
2012-01-20 18:02:55 +00:00
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckNodeDevice(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virNodeDeviceDef *nodedev G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermNodeDevice perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckNWFilter(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virNWFilterDef *nwfilter G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermNWFilter perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
2018-05-09 16:19:55 +00:00
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckNWFilterBinding(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virNWFilterBindingDef *binding G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermNWFilterBinding perm G_GNUC_UNUSED)
|
2018-05-09 16:19:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
2012-01-20 18:02:55 +00:00
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckSecret(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virSecretDef *secret G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermSecret perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckStoragePool(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virStoragePoolDef *pool G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermStoragePool perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2021-03-11 07:16:13 +00:00
|
|
|
virAccessDriverNopCheckStorageVol(virAccessManager *manager G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
const char *driverName G_GNUC_UNUSED,
|
2021-03-11 07:16:13 +00:00
|
|
|
virStoragePoolDef *pool G_GNUC_UNUSED,
|
|
|
|
virStorageVolDef *vol G_GNUC_UNUSED,
|
2019-10-14 12:45:33 +00:00
|
|
|
virAccessPermStorageVol perm G_GNUC_UNUSED)
|
2012-01-20 18:02:55 +00:00
|
|
|
{
|
|
|
|
return 1; /* Allow */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virAccessDriver accessDriverNop = {
|
|
|
|
.name = "none",
|
|
|
|
.checkConnect = virAccessDriverNopCheckConnect,
|
|
|
|
.checkDomain = virAccessDriverNopCheckDomain,
|
|
|
|
.checkInterface = virAccessDriverNopCheckInterface,
|
|
|
|
.checkNetwork = virAccessDriverNopCheckNetwork,
|
2018-11-30 16:34:21 +00:00
|
|
|
.checkNetworkPort = virAccessDriverNopCheckNetworkPort,
|
2012-01-20 18:02:55 +00:00
|
|
|
.checkNodeDevice = virAccessDriverNopCheckNodeDevice,
|
|
|
|
.checkNWFilter = virAccessDriverNopCheckNWFilter,
|
2018-05-09 16:19:55 +00:00
|
|
|
.checkNWFilterBinding = virAccessDriverNopCheckNWFilterBinding,
|
2012-01-20 18:02:55 +00:00
|
|
|
.checkSecret = virAccessDriverNopCheckSecret,
|
|
|
|
.checkStoragePool = virAccessDriverNopCheckStoragePool,
|
|
|
|
.checkStorageVol = virAccessDriverNopCheckStorageVol,
|
|
|
|
};
|