1 /**
2  * xrdp: A Remote Desktop Protocol server.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * This file contains the chansrv configuration parameters from sesman.ini
17  */
18 
19 #ifndef _CHANSRV_CONFIG
20 #define _CHANSRV_CONFIG
21 
22 #include <sys/stat.h>
23 
24 struct config_chansrv
25 {
26     /** Whether to use a UNIX socket for chansrv */
27     int use_unix_socket;
28 
29     /** Whether the FUSE mount is enabled or not */
30     int enable_fuse_mount;
31 
32     /** RestrictOutboundClipboard setting from sesman.ini */
33     int restrict_outbound_clipboard;
34 
35     /** * FuseMountName from sesman.ini */
36     char *fuse_mount_name;
37     /** FileUmask from sesman.ini */
38     mode_t file_umask;
39 };
40 
41 
42 /**
43  *
44  * @brief Reads sesman configuration
45  * @param use_logger Use logger to log errors (otherwise stdout)
46  * @param sesman_ini Name of configuration file to read
47  *
48  * @return configuration on success, NULL on failure
49  *
50  * @pre logging is assumed to be active
51  * @post pass return value to config_free() to prevent memory leaks
52  *
53  */
54 struct config_chansrv *
55 config_read(int use_logger, const char *sesman_ini);
56 
57 /**
58  *
59  * @brief Dumps configuration to stdout
60  * @param pointer to a config_chansrv struct
61  *
62  */
63 void
64 config_dump(struct config_chansrv *config);
65 
66 /**
67  *
68  * @brief Frees configuration allocated by config_read()
69  * @param pointer to a config_chansrv struct (may be NULL)
70  *
71  */
72 void
73 config_free(struct config_chansrv *cs);
74 
75 #endif /* _CHANSRV_CONFIG */
76