[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 22/25] tools/xenstore: merge get_spec_node() into get_node_canonicalized()



Hi,

On 24/07/2023 12:02, Juergen Gross wrote:
diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c
index 86cf8322b4..2662a3fa49 100644
--- a/tools/xenstore/xenstored_watch.c
+++ b/tools/xenstore/xenstored_watch.c
@@ -166,19 +166,12 @@ static int destroy_watch(void *_watch)
  static int check_watch_path(struct connection *conn, const void *ctx,
                            const char **path, bool *relative)
  {
-       /* Check if valid event. */
-       if (strstarts(*path, "@")) {
-               *relative = false;
-               if (strlen(*path) > XENSTORE_REL_PATH_MAX)
-                       goto inval;

I can't find an exact matching check in is_valid_nodename(). The call also seems to put more restriction on '@' node. Can you clarify?

-       } else {
-               *relative = !strstarts(*path, "/");
-               *path = canonicalize(conn, ctx, *path);
-               if (!*path)
-                       return errno;
-               if (!is_valid_nodename(conn, *path))
-                       goto inval;
-       }
+       *relative = !strstarts(*path, "/") && !strstarts(*path, "@");
+       *path = canonicalize(conn, ctx, *path);
+       if (!*path)
+               return errno;
+       if (!is_valid_nodename(conn, *path, true))
+               goto inval;
return 0;

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.