Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
safe_is_path_trusted.h
1 #ifndef SAFE_IS_PATH_TRUSTED_H_
2 #define SAFE_IS_PATH_TRUSTED_H_
3 
4 /*
5  * safefile package http://www.cs.wisc.edu/~kupsch/safefile
6  *
7  * Copyright 2007-2008 James A. Kupsch
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 
23 #include <sys/stat.h>
24 #include <sys/types.h>
25 
26 struct safe_id_range_list;
27 
28 #ifndef SAFE_IS_PATH_TRUSTED_RETRY_MAX
29 #define SAFE_IS_PATH_TRUSTED_RETRY_MAX 50
30 #endif
31 
32 
33 
34 enum {
35  SAFE_PATH_ERROR = -1,
36  SAFE_PATH_UNTRUSTED,
37  SAFE_PATH_TRUSTED_STICKY_DIR,
38  SAFE_PATH_TRUSTED,
39  SAFE_PATH_TRUSTED_CONFIDENTIAL
40  };
41 
42 int safe_is_path_trusted(
43  const char *pathname,
44  struct safe_id_range_list *trusted_uids,
45  struct safe_id_range_list *trusted_gids
46  );
47 int safe_is_path_trusted_fork(
48  const char *pathname,
49  struct safe_id_range_list *trusted_uids,
50  struct safe_id_range_list *trusted_gids
51  );
52 int safe_is_path_trusted_r(
53  const char *pathname,
54  struct safe_id_range_list *trusted_uids,
55  struct safe_id_range_list *trusted_gids
56  );
57 
58 
59 #endif