@@ -96,8 +96,10 @@ struct qrexec_parsed_command {
96
96
97
97
/* Parse a command, return NULL on failure. Uses cmd->cmdline
98
98
(do not free until destroy is called) */
99
+ __attribute__((visibility ("default" )))
99
100
struct qrexec_parsed_command * parse_qubes_rpc_command (
100
101
const char * cmdline , bool strip_username );
102
+ __attribute__((visibility ("default" )))
101
103
void destroy_qrexec_parsed_command (struct qrexec_parsed_command * cmd );
102
104
103
105
/* Load service configuration.
@@ -111,20 +113,32 @@ void destroy_qrexec_parsed_command(struct qrexec_parsed_command *cmd);
111
113
*/
112
114
int load_service_config (struct qrexec_parsed_command * cmd_name ,
113
115
int * wait_for_session , char * * user )
114
- __attribute__((deprecated ("use load_service_config_v2() instead" )));
115
- int load_service_config_v2 (struct qrexec_parsed_command * cmd );
116
+ __attribute__((deprecated ("use load_service_config_v2() instead" ), visibility ("default" )));
117
+ /* Load service configuration.
118
+ *
119
+ * Return:
120
+ * 1 - config successfuly loaded
121
+ * 0 - config not found
122
+ * -1 - other error
123
+ */
124
+ __attribute__((visibility ("default" )))
125
+ int load_service_config_v2 (struct qrexec_parsed_command * cmd_name );
116
126
117
127
typedef void (do_exec_t )(const char * cmdline , const char * user );
128
+ __attribute__((visibility ("default" )))
118
129
void register_exec_func (do_exec_t * func );
119
130
/*
120
131
* exec() qubes-rpc-multiplexer if *prog* starts with magic "QUBESRPC" keyword,
121
132
* do not return in that case; pass *envp* to execve() as en environment
122
133
* otherwise, return false without any action
123
134
*/
135
+ __attribute__((visibility ("default" )))
124
136
void exec_qubes_rpc_if_requested (const char * prog , char * const envp []);
125
137
138
+ __attribute__((visibility ("default" )))
126
139
int exec_wait_for_session (const char * source_domain );
127
140
141
+ __attribute__((visibility ("default" )))
128
142
void buffer_init (struct buffer * b );
129
143
void buffer_free (struct buffer * b );
130
144
void buffer_append (struct buffer * b , const char * data , int len );
@@ -150,6 +164,7 @@ int write_stdin(int fd, const char *data, int len, struct buffer *buffer);
150
164
* @return 0 if it spawned (or might have spawned) an external process,
151
165
* nonzero on failure.
152
166
*/
167
+ __attribute__((visibility ("default" )))
153
168
int execute_parsed_qubes_rpc_command (
154
169
struct qrexec_parsed_command * cmd , int * pid , int * stdin_fd ,
155
170
int * stdout_fd , int * stderr_fd , struct buffer * stdin_buffer );
@@ -165,8 +180,9 @@ int execute_parsed_qubes_rpc_command(
165
180
* @return 0 if the implementation is found (and, for sockets, connected to)
166
181
* successfully, -1 if not found, -2 if problem.
167
182
*/
183
+ __attribute__((visibility ("default" )))
168
184
int find_qrexec_service (
169
- struct qrexec_parsed_command * cmd ,
185
+ const struct qrexec_parsed_command * cmd ,
170
186
int * socket_fd , struct buffer * stdin_buffer );
171
187
172
188
/** Suggested buffer size for the path buffer of find_qrexec_service. */
@@ -189,25 +205,34 @@ int find_qrexec_service(
189
205
* @return 0 if it spawned (or might have spawned) an external process,
190
206
* nonzero on failure.
191
207
*/
208
+ __attribute__((visibility ("default" )))
192
209
int execute_qubes_rpc_command (const char * cmdline , int * pid , int * stdin_fd ,
193
210
int * stdout_fd , int * stderr_fd ,
194
211
bool strip_username , struct buffer * buffer );
195
212
/*
196
213
* A version of ppoll() that also correctly handles vchan's event pending
197
214
* flag. fds[0] is used internally and fds[0].fd must be equal to -1 on entry.
198
215
*/
216
+ __attribute__((visibility ("default" )))
199
217
int ppoll_vchan (libvchan_t * ctrl , struct pollfd * fds , size_t nfds ,
200
218
struct timespec * timeout , const sigset_t * sigmask );
201
219
220
+ __attribute__((visibility ("default" )))
202
221
int read_vchan_all (libvchan_t * vchan , void * data , size_t size );
222
+ __attribute__((visibility ("default" )))
203
223
int write_vchan_all (libvchan_t * vchan , const void * data , size_t size );
224
+ __attribute__((visibility ("default" )))
204
225
int read_all (int fd , void * buf , int size );
226
+ __attribute__((visibility ("default" )))
205
227
int write_all (int fd , const void * buf , int size );
228
+ __attribute__((visibility ("default" )))
206
229
void fix_fds (int fdin , int fdout , int fderr );
207
230
void set_nonblock (int fd );
208
231
void set_block (int fd );
209
232
233
+ __attribute__((visibility ("default" )))
210
234
int get_server_socket (const char * );
235
+ __attribute__((visibility ("default" )))
211
236
int do_accept (int s );
212
237
213
238
void set_nonblock (int fd );
@@ -234,6 +259,7 @@ struct prefix_data {
234
259
size_t len ;
235
260
};
236
261
262
+ __attribute__((visibility ("default" )))
237
263
int send_exit_code (libvchan_t * vchan , int status );
238
264
239
265
/* Set of options for process_io(). */
@@ -277,6 +303,7 @@ struct process_io_request {
277
303
*
278
304
* Returns intended exit code (local or remote), but calls exit() on errors.
279
305
*/
306
+ __attribute__((visibility ("default" )))
280
307
int process_io (const struct process_io_request * req );
281
308
282
309
// Logging
@@ -301,10 +328,11 @@ int process_io(const struct process_io_request *req);
301
328
302
329
#endif
303
330
304
-
331
+ __attribute__(( visibility ( "default" )))
305
332
void qrexec_log (int level , int errnoval , const char * file , int line ,
306
333
const char * func , const char * fmt , ...) __attribute__((format (printf , 6 , 7 )));
307
334
335
+ __attribute__((visibility ("default" )))
308
336
void setup_logging (const char * program_name );
309
337
310
338
/**
@@ -317,6 +345,7 @@ void setup_logging(const char *program_name);
317
345
* @param len The length of the data returned
318
346
* @return The value on success. On failure returns NULL and sets errno.
319
347
*/
348
+ __attribute__((visibility ("default" )))
320
349
char * qubesd_call (const char * dest , char * method , char * arg , size_t * len );
321
350
322
351
/**
@@ -331,13 +360,15 @@ char *qubesd_call(const char *dest, char *method, char *arg, size_t *len);
331
360
* @param[out] len The number of bytes read.
332
361
* @return A buffer to the number of bytes read. On failure returns NULL and sets errno.
333
362
*/
363
+ __attribute__((visibility ("default" )))
334
364
void * qubes_read_all_to_malloc (int fd , size_t initial_buffer_size , size_t max_bytes , size_t * len );
335
365
336
366
/**
337
367
* Send all data in the given msghdr. Short writes are retried as necessary.
338
368
*
339
369
* Returns true on success. Otherwise returns false setting errno.
340
370
*/
371
+ __attribute__((visibility ("default" )))
341
372
bool qubes_sendmsg_all (struct msghdr * msg , int sock );
342
373
343
374
/**
@@ -349,6 +380,7 @@ bool qubes_sendmsg_all(struct msghdr *msg, int sock);
349
380
* @param is_server Is this a server or a client vchan?
350
381
* @param timeout The timeout to use.
351
382
*/
383
+ __attribute__((visibility ("default" )))
352
384
int qubes_wait_for_vchan_connection_with_timeout (
353
385
libvchan_t * conn , int wait_fd , bool is_server , time_t timeout );
354
386
#endif /* LIBQREXEC_UTILS_H */
0 commit comments