src/security: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jonathon Jongsma 2019-06-18 11:12:41 -05:00 committed by Ján Tomko
parent d9b16e4436
commit 55474a8ce7
8 changed files with 22 additions and 46 deletions

View File

@ -16,15 +16,12 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_SECURITY_APPARMOR_H #pragma once
# define LIBVIRT_SECURITY_APPARMOR_H
# include "security_driver.h" #include "security_driver.h"
extern virSecurityDriver virAppArmorSecurityDriver; extern virSecurityDriver virAppArmorSecurityDriver;
# define AA_PREFIX "libvirt-" #define AA_PREFIX "libvirt-"
# define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid */ #define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid */
# define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check */ #define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check */
#endif /* LIBVIRT_SECURITY_APPARMOR_H */

View File

@ -18,10 +18,9 @@
* POSIX DAC security driver * POSIX DAC security driver
*/ */
#ifndef LIBVIRT_SECURITY_DAC_H #pragma once
# define LIBVIRT_SECURITY_DAC_H
# include "security_driver.h" #include "security_driver.h"
extern virSecurityDriver virSecurityDriverDAC; extern virSecurityDriver virSecurityDriverDAC;
@ -37,5 +36,3 @@ void virSecurityDACSetMountNamespace(virSecurityManagerPtr mgr,
void virSecurityDACSetChownCallback(virSecurityManagerPtr mgr, void virSecurityDACSetChownCallback(virSecurityManagerPtr mgr,
virSecurityManagerDACChownCallback chownCallback); virSecurityManagerDACChownCallback chownCallback);
#endif /* LIBVIRT_SECURITY_DAC_H */

View File

@ -16,13 +16,12 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_SECURITY_DRIVER_H #pragma once
# define LIBVIRT_SECURITY_DRIVER_H
# include "internal.h" #include "internal.h"
# include "domain_conf.h" #include "domain_conf.h"
# include "security_manager.h" #include "security_manager.h"
/* /*
* Return values for security driver probing: the driver will determine * Return values for security driver probing: the driver will determine
@ -216,5 +215,3 @@ struct _virSecurityDriver {
virSecurityDriverPtr virSecurityDriverLookup(const char *name, virSecurityDriverPtr virSecurityDriverLookup(const char *name,
const char *virtDriver); const char *virtDriver);
#endif /* LIBVIRT_SECURITY_DRIVER_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_SECURITY_MANAGER_H #pragma once
# define LIBVIRT_SECURITY_MANAGER_H
# include "domain_conf.h" #include "domain_conf.h"
# include "vircommand.h" #include "vircommand.h"
# include "virstoragefile.h" #include "virstoragefile.h"
typedef struct _virSecurityManager virSecurityManager; typedef struct _virSecurityManager virSecurityManager;
typedef virSecurityManager *virSecurityManagerPtr; typedef virSecurityManager *virSecurityManagerPtr;
@ -36,7 +35,7 @@ typedef enum {
VIR_SECURITY_MANAGER_MOUNT_NAMESPACE = 1 << 5, VIR_SECURITY_MANAGER_MOUNT_NAMESPACE = 1 << 5,
} virSecurityManagerNewFlags; } virSecurityManagerNewFlags;
# define VIR_SECURITY_MANAGER_NEW_MASK \ #define VIR_SECURITY_MANAGER_NEW_MASK \
(VIR_SECURITY_MANAGER_DEFAULT_CONFINED | \ (VIR_SECURITY_MANAGER_DEFAULT_CONFINED | \
VIR_SECURITY_MANAGER_REQUIRE_CONFINED | \ VIR_SECURITY_MANAGER_REQUIRE_CONFINED | \
VIR_SECURITY_MANAGER_PRIVILEGED) VIR_SECURITY_MANAGER_PRIVILEGED)
@ -207,5 +206,3 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr,
void void
virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr, virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr,
virSecurityManagerMetadataLockStatePtr *state); virSecurityManagerMetadataLockStatePtr *state);
#endif /* LIBVIRT_SECURITY_MANAGER_H */

View File

@ -17,11 +17,8 @@
* *
*/ */
#ifndef LIBVIRT_SECURITY_NOP_H #pragma once
# define LIBVIRT_SECURITY_NOP_H
# include "security_driver.h" #include "security_driver.h"
extern virSecurityDriver virSecurityDriverNop; extern virSecurityDriver virSecurityDriverNop;
#endif /* LIBVIRT_SECURITY_NOP_H */

View File

@ -16,9 +16,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_SECURITY_SELINUX_H #pragma once
# define LIBVIRT_SECURITY_SELINUX_H
extern virSecurityDriver virSecurityDriverSELinux; extern virSecurityDriver virSecurityDriverSELinux;
#endif /* LIBVIRT_SECURITY_SELINUX_H */

View File

@ -18,10 +18,9 @@
* Stacked security driver * Stacked security driver
*/ */
#ifndef LIBVIRT_SECURITY_STACK_H #pragma once
# define LIBVIRT_SECURITY_STACK_H
# include "security_driver.h" #include "security_driver.h"
extern virSecurityDriver virSecurityDriverStack; extern virSecurityDriver virSecurityDriverStack;
@ -34,5 +33,3 @@ virSecurityStackGetPrimary(virSecurityManagerPtr mgr);
virSecurityManagerPtr* virSecurityManagerPtr*
virSecurityStackGetNested(virSecurityManagerPtr mgr); virSecurityStackGetNested(virSecurityManagerPtr mgr);
#endif /* LIBVIRT_SECURITY_STACK_H */

View File

@ -16,8 +16,7 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_SECURITY_UTIL_H #pragma once
# define LIBVIRT_SECURITY_UTIL_H
int int
virSecurityGetRememberedLabel(const char *name, virSecurityGetRememberedLabel(const char *name,
@ -28,5 +27,3 @@ int
virSecuritySetRememberedLabel(const char *name, virSecuritySetRememberedLabel(const char *name,
const char *path, const char *path,
const char *label); const char *label);
#endif /* LIBVIRT_SECURITY_UTIL_H */