1 /* openat-style fd-relative functions for SE Linux
2 Copyright (C) 2007, 2009 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program 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 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 /* written by Jim Meyering */
21 #include "selinux-at.h"
29 #include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
32 #include "openat-priv.h"
34 #define AT_FUNC_NAME getfileconat
35 #define AT_FUNC_F1 getfilecon
36 #define AT_FUNC_F2 getfilecon
37 #define AT_FUNC_USE_F1_COND 1
38 #define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con
39 #define AT_FUNC_POST_FILE_ARGS , con
44 #undef AT_FUNC_USE_F1_COND
45 #undef AT_FUNC_POST_FILE_PARAM_DECLS
46 #undef AT_FUNC_POST_FILE_ARGS
48 #define AT_FUNC_NAME lgetfileconat
49 #define AT_FUNC_F1 lgetfilecon
50 #define AT_FUNC_F2 lgetfilecon
51 #define AT_FUNC_USE_F1_COND 1
52 #define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con
53 #define AT_FUNC_POST_FILE_ARGS , con
58 #undef AT_FUNC_USE_F1_COND
59 #undef AT_FUNC_POST_FILE_PARAM_DECLS
60 #undef AT_FUNC_POST_FILE_ARGS
62 #define AT_FUNC_NAME setfileconat
63 #define AT_FUNC_F1 setfilecon
64 #define AT_FUNC_F2 setfilecon
65 #define AT_FUNC_USE_F1_COND 1
66 #define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con
67 #define AT_FUNC_POST_FILE_ARGS , con
72 #undef AT_FUNC_USE_F1_COND
73 #undef AT_FUNC_POST_FILE_PARAM_DECLS
74 #undef AT_FUNC_POST_FILE_ARGS
76 #define AT_FUNC_NAME lsetfileconat
77 #define AT_FUNC_F1 lsetfilecon
78 #define AT_FUNC_F2 lsetfilecon
79 #define AT_FUNC_USE_F1_COND 1
80 #define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con
81 #define AT_FUNC_POST_FILE_ARGS , con
86 #undef AT_FUNC_USE_F1_COND
87 #undef AT_FUNC_POST_FILE_PARAM_DECLS
88 #undef AT_FUNC_POST_FILE_ARGS