Skip to content

Commit f761b41

Browse files
committed
qemu-bridge-helper: relocate path to default ACL
Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 580e6ad commit f761b41

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

qemu-bridge-helper.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#endif
4141

4242
#include "qemu/queue.h"
43+
#include "qemu/cutils.h"
4344

4445
#include "net/tap-linux.h"
4546

@@ -245,6 +246,7 @@ int main(int argc, char **argv)
245246
ACLList acl_list;
246247
int access_allowed, access_denied;
247248
int ret = EXIT_SUCCESS;
249+
g_autofree char *acl_file = NULL;
248250

249251
#ifdef CONFIG_LIBCAP_NG
250252
/* if we're run from an suid binary, immediately drop privileges preserving
@@ -257,6 +259,8 @@ int main(int argc, char **argv)
257259
}
258260
#endif
259261

262+
qemu_init_exec_dir(argv[0]);
263+
260264
/* parse arguments */
261265
for (index = 1; index < argc; index++) {
262266
if (strcmp(argv[index], "--use-vnet") == 0) {
@@ -282,9 +286,10 @@ int main(int argc, char **argv)
282286

283287
/* parse default acl file */
284288
QSIMPLEQ_INIT(&acl_list);
285-
if (parse_acl_file(DEFAULT_ACL_FILE, &acl_list) == -1) {
289+
acl_file = get_relocated_path(DEFAULT_ACL_FILE);
290+
if (parse_acl_file(acl_file, &acl_list) == -1) {
286291
fprintf(stderr, "failed to parse default acl file `%s'\n",
287-
DEFAULT_ACL_FILE);
292+
acl_file);
288293
ret = EXIT_FAILURE;
289294
goto cleanup;
290295
}

0 commit comments

Comments
 (0)