Skip to content

Commit

Permalink
xenstore_srv: use full path for xss_do_write errors
Browse files Browse the repository at this point in the history
Error logs used non-const variable "path" which is modified by strtok()
and divided into parts. Such messages are not helpful, because it
prints only first level of path.
Use const_path variable with full node path for error messages.

Signed-off-by: Dmytro Firsov <[email protected]>
Reviewed-by: Mykyta Poturai <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
Acked-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Leonid Komarianskyi <[email protected]>
  • Loading branch information
firscity committed May 9, 2024
1 parent 4feb5a0 commit a270391
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xenstore-srv/src/xenstore_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ static int xss_do_write(const char *const_path, const char *data, uint32_t domid

if (iter == NULL) {
if (parent_entry && !check_perms(parent_entry, XS_PERM_WRITE, domid)) {
LOG_INF("Permission denied for domid#%u (%s)", domid, path);
LOG_INF("Permission denied for domid#%u (%s)", domid, const_path);
rc = -EACCES;
goto free_allocated;
}
Expand Down Expand Up @@ -906,7 +906,7 @@ static int xss_do_write(const char *const_path, const char *data, uint32_t domid

if (iter && data_len > 0) {
if (!check_perms(iter, XS_PERM_WRITE, domid)) {
LOG_INF("Permission denied for domid#%u (%s)", domid, path);
LOG_INF("Permission denied for domid#%u (%s)", domid, const_path);
rc = -EACCES;
goto free_allocated;
}
Expand Down

0 comments on commit a270391

Please sign in to comment.