Skip to content

Commit

Permalink
qemu-bridge-helper: relocate path to default ACL
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
bonzini committed Sep 30, 2020
1 parent 580e6ad commit f761b41
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions qemu-bridge-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#endif

#include "qemu/queue.h"
#include "qemu/cutils.h"

#include "net/tap-linux.h"

Expand Down Expand Up @@ -245,6 +246,7 @@ int main(int argc, char **argv)
ACLList acl_list;
int access_allowed, access_denied;
int ret = EXIT_SUCCESS;
g_autofree char *acl_file = NULL;

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

qemu_init_exec_dir(argv[0]);

/* parse arguments */
for (index = 1; index < argc; index++) {
if (strcmp(argv[index], "--use-vnet") == 0) {
Expand All @@ -282,9 +286,10 @@ int main(int argc, char **argv)

/* parse default acl file */
QSIMPLEQ_INIT(&acl_list);
if (parse_acl_file(DEFAULT_ACL_FILE, &acl_list) == -1) {
acl_file = get_relocated_path(DEFAULT_ACL_FILE);
if (parse_acl_file(acl_file, &acl_list) == -1) {
fprintf(stderr, "failed to parse default acl file `%s'\n",
DEFAULT_ACL_FILE);
acl_file);
ret = EXIT_FAILURE;
goto cleanup;
}
Expand Down

0 comments on commit f761b41

Please sign in to comment.