VirtualBox

source: kBuild/trunk/src/sed/lib/se-selinux.in.h@ 3657

Last change on this file since 3657 was 3613, checked in by bird, 7 months ago

src/sed: Merged in changes between 4.1.5 and 4.9 from the vendor branch. (svn merge /vendor/sed/4.1.5 /vendor/sed/current .)

File size: 4.5 KB
Line 
1/* Replacement <selinux/selinux.h> for platforms that lack it.
2 Copyright (C) 2008-2022 Free Software Foundation, Inc.
3
4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) any later version.
8
9 This file is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16
17#if __GNUC__ >= 3
18@PRAGMA_SYSTEM_HEADER@
19#endif
20@PRAGMA_COLUMNS@
21
22#if HAVE_SELINUX_SELINUX_H
23
24#@INCLUDE_NEXT@ @NEXT_SELINUX_SELINUX_H@
25
26#else
27# if !defined _@GUARD_PREFIX@_SELINUX_SELINUX_H
28# define _@GUARD_PREFIX@_SELINUX_SELINUX_H
29
30# include <sys/types.h>
31# include <errno.h>
32
33# ifndef _GL_INLINE_HEADER_BEGIN
34 #error "Please include config.h first."
35# endif
36_GL_INLINE_HEADER_BEGIN
37# ifndef SE_SELINUX_INLINE
38# define SE_SELINUX_INLINE _GL_INLINE
39# endif
40
41/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
42 the entity is not used. The compiler should not warn if the entity is not
43 used. */
44# ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
45# if 0 /* no GCC or clang version supports this yet */
46# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
47# elif defined __GNUC__ || defined __clang__
48# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
49# else
50# define _GL_ATTRIBUTE_MAYBE_UNUSED
51# endif
52# endif
53
54# if !GNULIB_defined_security_types
55
56typedef unsigned short security_class_t;
57struct selinux_opt;
58# define is_selinux_enabled() 0
59
60SE_SELINUX_INLINE int
61getcon (_GL_ATTRIBUTE_MAYBE_UNUSED char **con)
62 { errno = ENOTSUP; return -1; }
63SE_SELINUX_INLINE void
64freecon (_GL_ATTRIBUTE_MAYBE_UNUSED char *con) {}
65
66SE_SELINUX_INLINE int
67getfscreatecon (_GL_ATTRIBUTE_MAYBE_UNUSED char **con)
68 { errno = ENOTSUP; return -1; }
69SE_SELINUX_INLINE int
70setfscreatecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
71 { errno = ENOTSUP; return -1; }
72SE_SELINUX_INLINE int
73matchpathcon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file,
74 _GL_ATTRIBUTE_MAYBE_UNUSED mode_t m,
75 _GL_ATTRIBUTE_MAYBE_UNUSED char **con)
76 { errno = ENOTSUP; return -1; }
77SE_SELINUX_INLINE int
78getfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file,
79 _GL_ATTRIBUTE_MAYBE_UNUSED char **con)
80 { errno = ENOTSUP; return -1; }
81SE_SELINUX_INLINE int
82lgetfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file,
83 _GL_ATTRIBUTE_MAYBE_UNUSED char **con)
84 { errno = ENOTSUP; return -1; }
85SE_SELINUX_INLINE int
86fgetfilecon (int fd,_GL_ATTRIBUTE_MAYBE_UNUSED char **con)
87 { errno = ENOTSUP; return -1; }
88SE_SELINUX_INLINE int
89setfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file,
90 _GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
91 { errno = ENOTSUP; return -1; }
92SE_SELINUX_INLINE int
93lsetfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *file,
94 _GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
95 { errno = ENOTSUP; return -1; }
96SE_SELINUX_INLINE int
97fsetfilecon (_GL_ATTRIBUTE_MAYBE_UNUSED int fd,
98 _GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
99 { errno = ENOTSUP; return -1; }
100
101SE_SELINUX_INLINE int
102security_check_context (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
103 { errno = ENOTSUP; return -1; }
104SE_SELINUX_INLINE int
105security_check_context_raw (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
106 { errno = ENOTSUP; return -1; }
107SE_SELINUX_INLINE int
108setexeccon (_GL_ATTRIBUTE_MAYBE_UNUSED char const *con)
109 { errno = ENOTSUP; return -1; }
110SE_SELINUX_INLINE int
111security_compute_create (_GL_ATTRIBUTE_MAYBE_UNUSED char const *scon,
112 _GL_ATTRIBUTE_MAYBE_UNUSED char const *tcon,
113 _GL_ATTRIBUTE_MAYBE_UNUSED security_class_t tclass,
114 _GL_ATTRIBUTE_MAYBE_UNUSED char **newcon)
115 { errno = ENOTSUP; return -1; }
116SE_SELINUX_INLINE security_class_t
117string_to_security_class (char const *name)
118 { errno = ENOTSUP; return 0; }
119SE_SELINUX_INLINE int
120matchpathcon_init_prefix (_GL_ATTRIBUTE_MAYBE_UNUSED char const *path,
121 _GL_ATTRIBUTE_MAYBE_UNUSED char const *prefix)
122 { errno = ENOTSUP; return -1; }
123
124# define GNULIB_defined_security_types 1
125# endif
126
127_GL_INLINE_HEADER_END
128
129# endif
130#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette